public void ReadFrom(FCSerialize ar) { int nTag = 0; int nFiledIndex = 0; bool bSucRead = false; //while(nTag = ar.ProtobufReadTag()) // C#不支持这样的写法 while ((nTag = ar.ProtobufReadTag()) != 0) { nFiledIndex = nTag >> 3; bSucRead = false; switch (nFiledIndex) { case 1: if (nTag == 10) // MakeTag(1, 2) { bSucRead = ar.ProtobufRead(value, 1, PB_ZipType.PB_Zip_Varint); } break; default: break; } if (!bSucRead) { ar.ProtobufSkipField(nTag); } } }
public void ReadFrom(FCSerialize ar) { int nTag = 0; int nFiledIndex = 0; bool bSucRead = false; //while(nTag = ar.ProtobufReadTag()) // C#不支持这样的写法 while ((nTag = ar.ProtobufReadTag()) != 0) { nFiledIndex = nTag >> 3; bSucRead = false; switch (nFiledIndex) { case 1: if (nTag == 10) // MakeTag(1, 2) { bSucRead = ar.ProtobufRead(name, 1, PB_ZipType.PB_Zip_Varint); } break; case 2: if (nTag == 16) // MakeTag(2, 0) { bSucRead = ar.ProtobufRead(phonenumber, 2, PB_ZipType.PB_Zip_Varint); } break; case 3: if (nTag == 24) // MakeTag(3, 0) { _oneof_case_0 = 3; // val1 bSucRead = ar.ProtobufRead(val1, 3, PB_ZipType.PB_Zip_Varint); } break; case 4: if (nTag == 32) // MakeTag(4, 0) { _oneof_case_0 = 4; // val2 bSucRead = ar.ProtobufRead(val2, 4, PB_ZipType.PB_Zip_Varint); } break; case 5: if (nTag == 42) // MakeTag(5, 2) { bSucRead = ar.ProtobufReadMap(map_test, 5, PB_ZipType.PB_Zip_Varint, PB_ZipType.PB_Zip_Varint); } break; default: break; } if (!bSucRead) { ar.ProtobufSkipField(nTag); } } }
public void ReadFrom(FCSerialize ar) { int nTag = 0; int nFiledIndex = 0; bool bSucRead = false; //while(nTag = ar.ProtobufReadTag()) // C#不支持这样的写法 while ((nTag = ar.ProtobufReadTag()) != 0) { nFiledIndex = nTag >> 3; bSucRead = false; switch (nFiledIndex) { case 1: if (nTag == 10) // MakeTag(1, 2) { bSucRead = ar.ProtobufRead(name, 1, PB_ZipType.PB_Zip_Varint); } break; case 2: if (nTag == 16) // MakeTag(2, 0) { bSucRead = ar.ProtobufRead(age, 2, PB_ZipType.PB_Zip_Varint); } break; case 3: if (nTag == 26) // MakeTag(3, 2) { bSucRead = ar.ProtobufRead(address, 3, PB_ZipType.PB_Zip_Varint); } break; case 4: if (nTag == 34) // MakeTag(4, 2) { bSucRead = ar.ProtobufRead(contacts, 4, PB_ZipType.PB_Zip_Varint); } break; default: break; } if (!bSucRead) { ar.ProtobufSkipField(nTag); } } }
public void ReadFrom(FCSerialize ar) { int nTag = 0; int nFiledIndex = 0; bool bSucRead = false; //while(nTag = ar.ProtobufReadTag()) // C#不支持这样的写法 while ((nTag = ar.ProtobufReadTag()) != 0) { nFiledIndex = nTag >> 3; bSucRead = false; switch (nFiledIndex) { case 1: if (nTag == 10) // MakeTag(1, 2) { bSucRead = ar.ProtobufRead(value, 1, PB_ZipType.PB_Zip_Varint); } break; case 2: if (nTag == 18) // MakeTag(2, 2) { bSucRead = ar.ProtobufRead(optional_bytes, 2, PB_ZipType.PB_Zip_Varint); } break; case 3: if (nTag == 26) // MakeTag(3, 2) { bSucRead = ar.ProtobufRead(optional_data, 3, PB_ZipType.PB_Zip_Varint); } break; case 4: if (nTag == 34) // MakeTag(4, 2) { bSucRead = ar.ProtobufRead(second_data, 4, PB_ZipType.PB_Zip_Varint); } break; case 5: if (nTag == 42) // MakeTag(5, 2) { _oneof_case_0 = 5; // str_data bSucRead = ar.ProtobufRead(str_data, 5, PB_ZipType.PB_Zip_Varint); } break; case 6: if (nTag == 48) // MakeTag(6, 0) { _oneof_case_0 = 6; // int_data bSucRead = ar.ProtobufRead(int_data, 6, PB_ZipType.PB_Zip_Varint); } break; case 7: if (nTag == 58) // MakeTag(7, 2) { _oneof_case_0 = 7; // message_data bSucRead = ar.ProtobufRead(message_data, 7, PB_ZipType.PB_Zip_Varint); } break; case 8: if (nTag == 66) // MakeTag(8, 2) { _oneof_case_0 = 8; // more_data bSucRead = ar.ProtobufRead(more_data, 8, PB_ZipType.PB_Zip_Varint); } break; case 9: if (nTag == 74) // MakeTag(9, 2) { _oneof_case_1 = 9; // str_data3 bSucRead = ar.ProtobufRead(str_data3, 9, PB_ZipType.PB_Zip_Varint); } break; case 10: if (nTag == 80) // MakeTag(10, 0) { _oneof_case_1 = 10; // int_data3 bSucRead = ar.ProtobufRead(int_data3, 10, PB_ZipType.PB_Zip_Varint); } break; case 11: if (nTag == 90) // MakeTag(11, 2) { _oneof_case_1 = 11; // message_data3 bSucRead = ar.ProtobufRead(message_data3, 11, PB_ZipType.PB_Zip_Varint); } break; case 12: if (nTag == 98) // MakeTag(12, 2) { _oneof_case_1 = 12; // more_data3 bSucRead = ar.ProtobufRead(more_data3, 12, PB_ZipType.PB_Zip_Varint); } break; default: break; } if (!bSucRead) { ar.ProtobufSkipField(nTag); } } }