Beispiel #1
0
        public void Write(CacheWriter f)
        {
            var flags = (UxlMethodFlags)EntityFlags;

            if (Condition != null)
            {
                flags |= UxlMethodFlags.HasCondition;
            }
            if (IsDefault)
            {
                flags |= UxlMethodFlags.IsDefault;
            }
            if (Implementations.Count > 0)
            {
                flags |= UxlMethodFlags.Implementations;
            }

            f.Write((byte)flags);
            f.WriteGlobal(Signature);

            if (flags.HasFlag(UxlMethodFlags.HasCondition))
            {
                f.WriteGlobal(Condition.Value);
            }
            if (flags.HasFlag(UxlMethodFlags.Implementations))
            {
                f.WriteList(Implementations, (w, x) => x.Write(w));
            }

            WriteEntity(f, (UxlEntityFlags)flags);
        }
Beispiel #2
0
        public static void Write(this CacheWriter f, CopyFile e)
        {
            var flags = (UxlCopyFileFlags)e.Flags & UxlCopyFileFlags.FlagsMask;

            if (e.TargetName != null)
            {
                flags |= UxlCopyFileFlags.HasTargetName;
            }
            if (e.Condition != null)
            {
                flags |= UxlCopyFileFlags.HasCondition;
            }
            if (e.Type != null)
            {
                flags |= UxlCopyFileFlags.HasType;
            }

            f.Write((byte)flags);
            f.WriteGlobal(e.SourceName);

            if (flags.HasFlag(UxlCopyFileFlags.HasTargetName))
            {
                f.WriteGlobal(e.TargetName.Value);
            }
            if (flags.HasFlag(UxlCopyFileFlags.HasCondition))
            {
                f.WriteGlobal(e.Condition.Value);
            }
            if (flags.HasFlag(UxlCopyFileFlags.HasType))
            {
                f.WriteGlobal(e.Type.Value);
            }
        }
Beispiel #3
0
        public void Write(CacheWriter f)
        {
            var flags = (UxlTypeFlags)EntityFlags;

            if (Condition.HasValue)
            {
                flags |= UxlTypeFlags.HasCondition;
            }
            if (IsDefault)
            {
                flags |= UxlTypeFlags.IsDefault;
            }
            if (Methods.Count > 0)
            {
                flags |= UxlTypeFlags.Methods;
            }

            f.Write((byte)flags);
            f.WriteGlobal(Name);

            if (flags.HasFlag(UxlTypeFlags.HasCondition))
            {
                f.WriteGlobal(Condition.Value);
            }
            if (flags.HasFlag(UxlTypeFlags.Methods))
            {
                f.WriteList(Methods, (w, x) => x.Write(w));
            }

            WriteEntity(f, (UxlEntityFlags)flags);
        }
Beispiel #4
0
        public void Write(CacheWriter f)
        {
            var flags = Flags;

            f.Write((byte)flags);
            f.WriteGlobal(Name);

            if (flags.HasFlag(UxlTemplateFlags.HasCondition))
            {
                f.WriteGlobal(Condition.Value);
            }

            WriteEntity(f, (UxlEntityFlags)flags);
        }
Beispiel #5
0
        public void Write(CacheWriter f)
        {
            var flags = (UxlDeclareFlags)Type;

            if (Condition != null)
            {
                flags |= UxlDeclareFlags.HasCondition;
            }

            f.Write((byte)flags);
            f.Write(Source);
            f.WriteGlobal(Key);

            if (flags.HasFlag(UxlDeclareFlags.HasCondition))
            {
                f.WriteGlobal(Condition.Value);
            }
        }
Beispiel #6
0
        public static void Write(this CacheWriter f, ImageFile e)
        {
            UxlImageFileFlags flags = 0;

            if (e.Condition != null)
            {
                flags |= UxlImageFileFlags.HasCondition;
            }
            if (e.TargetName != null)
            {
                flags |= UxlImageFileFlags.HasTargetName;
            }
            if (e.TargetWidth != null)
            {
                flags |= UxlImageFileFlags.HasTargetWidth;
            }
            if (e.TargetHeight != null)
            {
                flags |= UxlImageFileFlags.HasTargetHeight;
            }

            f.Write((byte)flags);
            f.WriteGlobal(e.SourceName);

            if (flags.HasFlag(UxlImageFileFlags.HasCondition))
            {
                f.WriteGlobal(e.Condition.Value);
            }
            if (flags.HasFlag(UxlImageFileFlags.HasTargetName))
            {
                f.WriteGlobal(e.TargetName.Value);
            }
            if (flags.HasFlag(UxlImageFileFlags.HasTargetWidth))
            {
                f.WriteCompressed(e.TargetWidth.Value);
            }
            if (flags.HasFlag(UxlImageFileFlags.HasTargetHeight))
            {
                f.WriteCompressed(e.TargetHeight.Value);
            }
        }
Beispiel #7
0
        public void Write(CacheWriter f)
        {
            var flags = (UxlImplementationFlags)Type & UxlImplementationFlags.TypeMask;

            if (Condition != null)
            {
                flags |= UxlImplementationFlags.HasCondition;
            }
            if (IsDefault)
            {
                flags |= UxlImplementationFlags.IsDefault;
            }

            f.Write((byte)flags);
            f.Write(Source);
            f.WriteGlobal(Body);

            if (flags.HasFlag(UxlImplementationFlags.HasCondition))
            {
                f.WriteGlobal(Condition.Value);
            }
        }
Beispiel #8
0
 public void Write(CacheWriter f)
 {
     f.Write(Source);
     f.WriteGlobal(OldName);
     f.WriteGlobal(NewName);
 }
Beispiel #9
0
        public void Write(CacheWriter f)
        {
            UxlDocumentFlags flags = 0;

            if (Condition != null)
            {
                flags |= UxlDocumentFlags.HasCondition;
            }
            if (Defines.Count > 0)
            {
                flags |= UxlDocumentFlags.Defines;
            }
            if (Usings.Count > 0)
            {
                flags |= UxlDocumentFlags.Usings;
            }
            if (Declarations.Count > 0)
            {
                flags |= UxlDocumentFlags.Declarations;
            }
            if (Deprecations.Count > 0)
            {
                flags |= UxlDocumentFlags.Deprecations;
            }
            if (Templates.Count > 0)
            {
                flags |= UxlDocumentFlags.Templates;
            }
            if (Types.Count > 0)
            {
                flags |= UxlDocumentFlags.Types;
            }

            f.Write((byte)Backend);
            f.Write((byte)flags);
            if (flags.HasFlag(UxlDocumentFlags.HasCondition))
            {
                f.WriteGlobal(Condition.Value);
            }
            if (flags.HasFlag(UxlDocumentFlags.Defines))
            {
                f.WriteList(Defines, (w, x) => x.Write(w));
            }
            if (flags.HasFlag(UxlDocumentFlags.Usings))
            {
                f.WriteList(Usings, (w, x) => w.WriteGlobal(x));
            }
            if (flags.HasFlag(UxlDocumentFlags.Declarations))
            {
                f.WriteList(Declarations, (w, x) => x.Write(w));
            }
            if (flags.HasFlag(UxlDocumentFlags.Deprecations))
            {
                f.WriteList(Deprecations, (w, x) => x.Write(w));
            }
            if (flags.HasFlag(UxlDocumentFlags.Templates))
            {
                f.WriteList(Templates, (w, x) => x.Write(w));
            }
            if (flags.HasFlag(UxlDocumentFlags.Types))
            {
                f.WriteList(Types, (w, x) => x.Write(w));
            }

            var entityFlags = EntityFlags;

            f.Write((byte)entityFlags);
            WriteEntity(f, entityFlags);
        }
Beispiel #10
0
 public void Write(CacheWriter f)
 {
     f.WriteGlobal(Name);
     f.WriteGlobal(Condition);
 }