public override void WriteSetBegin(TSet set)
 {
     WriteJSONArrayStart();
 }
 public override void WriteSetBegin(TSet set)
 {
 }
Beispiel #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);
 }
Beispiel #6
0
        public override TSet ReadSetBegin()
        {
            TSet set = new TSet();
            set.ElementType = (TType)ReadByte();
            set.Count = ReadI32();

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

            await WriteCollectionBeginAsync(set.ElementType, set.Count, cancellationToken);
        }
Beispiel #12
0
 /**
  * Write a set header.
  */
 public override Task WriteSetBeginAsync(TSet set)
 {
     return WriteCollectionBeginAsync(set.ElementType, set.Count);
 }
Beispiel #13
0
 public override void WriteSetBegin(TSet set)
 {
     WriteJSONArrayStart();
     WriteJSONString(GetTypeNameForTypeID(set.ElementType));
     WriteJSONInteger(set.Count);
 }
 /**
  * Write a set header.
  */
 public override void WriteSetBegin(TSet set)
 {
     WriteCollectionBegin(set.ElementType, set.Count);
 }
Beispiel #15
0
 public virtual async Task WriteSetBeginAsync(TSet set)
 {
     await WriteSetBeginAsync(set, CancellationToken.None);
 }
Beispiel #16
0
 public abstract Task WriteSetBeginAsync(TSet set);
Beispiel #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;
 }
Beispiel #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;
            }
        }
Beispiel #20
0
 public override void WriteSetBegin(TSet tSet)  
 {
     WrappedProtocol.WriteSetBegin(tSet);
 }
Beispiel #21
0
 public override void WriteSetBegin(TSet set)
 {
     WriteByte((byte)set.ElementType);
     WriteI32(set.Count);
 }
Beispiel #22
0
 public override void WriteSetBegin(TSet set)
 {
     WriteByte((byte)set.ElementType);
     WriteI32(set.Count);
 }
 public override async Task WriteSetBeginAsync(TSet set, CancellationToken cancellationToken)
 {
     await _wrappedProtocol.WriteSetBeginAsync(set, cancellationToken);
 }