Read() public method

public Read ( TProtocol iprot ) : void
iprot Thrift.Protocol.TProtocol
return void
Esempio n. 1
0
 public void Read (TProtocol iprot)
 {
   TField field;
   iprot.ReadStructBegin();
   while (true)
   {
     field = iprot.ReadFieldBegin();
     if (field.Type == TType.Stop) { 
       break;
     }
     switch (field.ID)
     {
       case 1:
         if (field.Type == TType.String) {
           Guid = iprot.ReadString();
         } else { 
           TProtocolUtil.Skip(iprot, field.Type);
         }
         break;
       case 2:
         if (field.Type == TType.String) {
           Title = iprot.ReadString();
         } else { 
           TProtocolUtil.Skip(iprot, field.Type);
         }
         break;
       case 3:
         if (field.Type == TType.String) {
           Content = iprot.ReadString();
         } else { 
           TProtocolUtil.Skip(iprot, field.Type);
         }
         break;
       case 4:
         if (field.Type == TType.String) {
           ContentHash = iprot.ReadBinary();
         } else { 
           TProtocolUtil.Skip(iprot, field.Type);
         }
         break;
       case 5:
         if (field.Type == TType.I32) {
           ContentLength = iprot.ReadI32();
         } else { 
           TProtocolUtil.Skip(iprot, field.Type);
         }
         break;
       case 6:
         if (field.Type == TType.I64) {
           Created = iprot.ReadI64();
         } else { 
           TProtocolUtil.Skip(iprot, field.Type);
         }
         break;
       case 7:
         if (field.Type == TType.I64) {
           Updated = iprot.ReadI64();
         } else { 
           TProtocolUtil.Skip(iprot, field.Type);
         }
         break;
       case 8:
         if (field.Type == TType.I64) {
           Deleted = iprot.ReadI64();
         } else { 
           TProtocolUtil.Skip(iprot, field.Type);
         }
         break;
       case 9:
         if (field.Type == TType.Bool) {
           Active = iprot.ReadBool();
         } else { 
           TProtocolUtil.Skip(iprot, field.Type);
         }
         break;
       case 10:
         if (field.Type == TType.I32) {
           UpdateSequenceNum = iprot.ReadI32();
         } else { 
           TProtocolUtil.Skip(iprot, field.Type);
         }
         break;
       case 11:
         if (field.Type == TType.String) {
           NotebookGuid = iprot.ReadString();
         } else { 
           TProtocolUtil.Skip(iprot, field.Type);
         }
         break;
       case 12:
         if (field.Type == TType.List) {
           {
             TagGuids = new List<string>();
             TList _list17 = iprot.ReadListBegin();
             for( int _i18 = 0; _i18 < _list17.Count; ++_i18)
             {
               string _elem19 = null;
               _elem19 = iprot.ReadString();
               TagGuids.Add(_elem19);
             }
             iprot.ReadListEnd();
           }
         } else { 
           TProtocolUtil.Skip(iprot, field.Type);
         }
         break;
       case 13:
         if (field.Type == TType.List) {
           {
             Resources = new List<Resource>();
             TList _list20 = iprot.ReadListBegin();
             for( int _i21 = 0; _i21 < _list20.Count; ++_i21)
             {
               Resource _elem22 = new Resource();
               _elem22 = new Resource();
               _elem22.Read(iprot);
               Resources.Add(_elem22);
             }
             iprot.ReadListEnd();
           }
         } else { 
           TProtocolUtil.Skip(iprot, field.Type);
         }
         break;
       case 14:
         if (field.Type == TType.Struct) {
           Attributes = new NoteAttributes();
           Attributes.Read(iprot);
         } else { 
           TProtocolUtil.Skip(iprot, field.Type);
         }
         break;
       case 15:
         if (field.Type == TType.List) {
           {
             TagNames = new List<string>();
             TList _list23 = iprot.ReadListBegin();
             for( int _i24 = 0; _i24 < _list23.Count; ++_i24)
             {
               string _elem25 = null;
               _elem25 = iprot.ReadString();
               TagNames.Add(_elem25);
             }
             iprot.ReadListEnd();
           }
         } else { 
           TProtocolUtil.Skip(iprot, field.Type);
         }
         break;
       default: 
         TProtocolUtil.Skip(iprot, field.Type);
         break;
     }
     iprot.ReadFieldEnd();
   }
   iprot.ReadStructEnd();
 }
Esempio n. 2
0
 public void Read(TProtocol iprot)
 {
     TField field;
       iprot.ReadStructBegin();
       while (true)
       {
     field = iprot.ReadFieldBegin();
     if (field.Type == TType.Stop) {
       break;
     }
     switch (field.ID)
     {
       case 1:
     if (field.Type == TType.String) {
       this.guid = iprot.ReadString();
       this.__isset.guid = true;
     } else {
       TProtocolUtil.Skip(iprot, field.Type);
     }
     break;
       case 2:
     if (field.Type == TType.String) {
       this.title = iprot.ReadString();
       this.__isset.title = true;
     } else {
       TProtocolUtil.Skip(iprot, field.Type);
     }
     break;
       case 3:
     if (field.Type == TType.String) {
       this.content = iprot.ReadString();
       this.__isset.content = true;
     } else {
       TProtocolUtil.Skip(iprot, field.Type);
     }
     break;
       case 4:
     if (field.Type == TType.String) {
       this.contentHash = iprot.ReadBinary();
       this.__isset.contentHash = true;
     } else {
       TProtocolUtil.Skip(iprot, field.Type);
     }
     break;
       case 5:
     if (field.Type == TType.I32) {
       this.contentLength = iprot.ReadI32();
       this.__isset.contentLength = true;
     } else {
       TProtocolUtil.Skip(iprot, field.Type);
     }
     break;
       case 6:
     if (field.Type == TType.I64) {
       this.created = iprot.ReadI64();
       this.__isset.created = true;
     } else {
       TProtocolUtil.Skip(iprot, field.Type);
     }
     break;
       case 7:
     if (field.Type == TType.I64) {
       this.updated = iprot.ReadI64();
       this.__isset.updated = true;
     } else {
       TProtocolUtil.Skip(iprot, field.Type);
     }
     break;
       case 8:
     if (field.Type == TType.I64) {
       this.deleted = iprot.ReadI64();
       this.__isset.deleted = true;
     } else {
       TProtocolUtil.Skip(iprot, field.Type);
     }
     break;
       case 9:
     if (field.Type == TType.Bool) {
       this.active = iprot.ReadBool();
       this.__isset.active = true;
     } else {
       TProtocolUtil.Skip(iprot, field.Type);
     }
     break;
       case 10:
     if (field.Type == TType.I32) {
       this.updateSequenceNum = iprot.ReadI32();
       this.__isset.updateSequenceNum = true;
     } else {
       TProtocolUtil.Skip(iprot, field.Type);
     }
     break;
       case 11:
     if (field.Type == TType.String) {
       this.notebookGuid = iprot.ReadString();
       this.__isset.notebookGuid = true;
     } else {
       TProtocolUtil.Skip(iprot, field.Type);
     }
     break;
       case 12:
     if (field.Type == TType.List) {
       {
         this.tagGuids = new List<string>();
         TList _list8 = iprot.ReadListBegin();
         for( int _i9 = 0; _i9 < _list8.Count; ++_i9)
         {
           string _elem10 = null;
           _elem10 = iprot.ReadString();
           this.tagGuids.Add(_elem10);
         }
         iprot.ReadListEnd();
       }
       this.__isset.tagGuids = true;
     } else {
       TProtocolUtil.Skip(iprot, field.Type);
     }
     break;
       case 13:
     if (field.Type == TType.List) {
       {
         this.resources = new List<Resource>();
         TList _list11 = iprot.ReadListBegin();
         for( int _i12 = 0; _i12 < _list11.Count; ++_i12)
         {
           Resource _elem13 = new Resource();
           _elem13 = new Resource();
           _elem13.Read(iprot);
           this.resources.Add(_elem13);
         }
         iprot.ReadListEnd();
       }
       this.__isset.resources = true;
     } else {
       TProtocolUtil.Skip(iprot, field.Type);
     }
     break;
       case 14:
     if (field.Type == TType.Struct) {
       this.attributes = new NoteAttributes();
       this.attributes.Read(iprot);
       this.__isset.attributes = true;
     } else {
       TProtocolUtil.Skip(iprot, field.Type);
     }
     break;
       case 15:
     if (field.Type == TType.List) {
       {
         this.tagNames = new List<string>();
         TList _list14 = iprot.ReadListBegin();
         for( int _i15 = 0; _i15 < _list14.Count; ++_i15)
         {
           string _elem16 = null;
           _elem16 = iprot.ReadString();
           this.tagNames.Add(_elem16);
         }
         iprot.ReadListEnd();
       }
       this.__isset.tagNames = true;
     } else {
       TProtocolUtil.Skip(iprot, field.Type);
     }
     break;
       default:
     TProtocolUtil.Skip(iprot, field.Type);
     break;
     }
     iprot.ReadFieldEnd();
       }
       iprot.ReadStructEnd();
 }