public override void WriteSetBegin(TSet set)
 {
     WriteJSONArrayStart();
 }
 public override void WriteSetBegin(TSet set)
 {
 }
Exemplo n.º 3
0
 public override async Task WriteSetBeginAsync(TSet set, CancellationToken cancellationToken)
 {
     await WriteJsonArrayStartAsync(cancellationToken);
     await WriteJsonStringAsync(TJSONProtocolHelper.GetTypeNameForTypeId(set.ElementType), cancellationToken);
     await WriteJsonIntegerAsync(set.Count, cancellationToken);
 }
 public override TSet ReadSetBegin()
 {
     TSet set = new TSet();
     ReadJSONArrayStart();
     set.ElementType = TType.Struct;
     set.Count = 1; // hack for now
     return set;
 }
 public override void WriteSetBegin(TSet set)
 {
     WriteJSONArrayStart();
     WriteJSONString(GetTypeNameForTypeID(set.ElementType));
     WriteJSONInteger(set.Count);
 }
Exemplo n.º 6
0
        public override TSet ReadSetBegin()
        {
            TSet set = new TSet();
            set.ElementType = (TType)ReadByte();
            set.Count = ReadI32();

            return set;
        }
Exemplo n.º 7
0
 public override void WriteSetBegin(TSet set)
 {
     this.WriteCollectionBegin(set.ElementType, set.Count);
 }
Exemplo n.º 8
0
		public abstract void WriteSetBegin(TSet set);
Exemplo n.º 9
0
 public override async Task WriteSetBeginAsync(TSet set, CancellationToken cancellationToken)
 {
     cancellationToken.ThrowIfCancellationRequested();
     await WriteByteAsync((sbyte)set.ElementType, cancellationToken);
     await WriteI32Async(set.Count, cancellationToken);
 }
Exemplo n.º 10
0
 public abstract void WriteSetBegin(TSet set);
Exemplo n.º 11
0
        public override async Task WriteSetBeginAsync(TSet set, CancellationToken cancellationToken)
        {
            cancellationToken.ThrowIfCancellationRequested();

            await WriteCollectionBeginAsync(set.ElementType, set.Count, cancellationToken);
        }
Exemplo n.º 12
0
 /**
  * Write a set header.
  */
 public override Task WriteSetBeginAsync(TSet set)
 {
     return WriteCollectionBeginAsync(set.ElementType, set.Count);
 }
Exemplo n.º 13
0
 public override void WriteSetBegin(TSet set)
 {
     WriteJSONArrayStart();
     WriteJSONString(GetTypeNameForTypeID(set.ElementType));
     WriteJSONInteger(set.Count);
 }
Exemplo n.º 14
0
 /**
  * Write a set header.
  */
 public override void WriteSetBegin(TSet set)
 {
     WriteCollectionBegin(set.ElementType, set.Count);
 }
Exemplo n.º 15
0
 public virtual async Task WriteSetBeginAsync(TSet set)
 {
     await WriteSetBeginAsync(set, CancellationToken.None);
 }
Exemplo n.º 16
0
 public abstract Task WriteSetBeginAsync(TSet set);
Exemplo n.º 17
0
 public abstract Task WriteSetBeginAsync(TSet set, CancellationToken cancellationToken);
 public override TSet ReadSetBegin()
 {
     TSet set = new TSet();
     ReadJSONArrayStart();
     set.ElementType = GetTypeIDForTypeName(ReadJSONString(false));
     set.Count = (int)ReadJSONInteger();
     return set;
 }
Exemplo n.º 19
0
        public static void Skip(TProtocol prot, TType type)
        {
            switch (type)
            {
            case TType.Bool:
                prot.ReadBool();
                break;

            case TType.Byte:
                prot.ReadByte();
                break;

            case TType.I16:
                prot.ReadI16();
                break;

            case TType.I32:
                prot.ReadI32();
                break;

            case TType.I64:
                prot.ReadI64();
                break;

            case TType.Double:
                prot.ReadDouble();
                break;

            case TType.String:
                // Don't try to decode the string, just skip it.
                prot.ReadBinary();
                break;

            case TType.Struct:
                prot.ReadStructBegin();
                while (true)
                {
                    TField field = prot.ReadFieldBegin();
                    if (field.Type == TType.Stop)
                    {
                        break;
                    }
                    Skip(prot, field.Type);
                    prot.ReadFieldEnd();
                }
                prot.ReadStructEnd();
                break;

            case TType.Map:
                TMap map = prot.ReadMapBegin();
                for (int i = 0; i < map.Count; i++)
                {
                    Skip(prot, map.KeyType);
                    Skip(prot, map.ValueType);
                }
                prot.ReadMapEnd();
                break;

            case TType.Set:
                TSet set = prot.ReadSetBegin();
                for (int i = 0; i < set.Count; i++)
                {
                    Skip(prot, set.ElementType);
                }
                prot.ReadSetEnd();
                break;

            case TType.List:
                TList list = prot.ReadListBegin();
                for (int i = 0; i < list.Count; i++)
                {
                    Skip(prot, list.ElementType);
                }
                prot.ReadListEnd();
                break;
            }
        }
Exemplo n.º 20
0
 public override void WriteSetBegin(TSet tSet)  
 {
     WrappedProtocol.WriteSetBegin(tSet);
 }
Exemplo n.º 21
0
 public override void WriteSetBegin(TSet set)
 {
     WriteByte((byte)set.ElementType);
     WriteI32(set.Count);
 }
Exemplo n.º 22
0
 public override void WriteSetBegin(TSet set)
 {
     WriteByte((byte)set.ElementType);
     WriteI32(set.Count);
 }
Exemplo n.º 23
0
 public override async Task WriteSetBeginAsync(TSet set, CancellationToken cancellationToken)
 {
     await _wrappedProtocol.WriteSetBeginAsync(set, cancellationToken);
 }