ExtensionField.h 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. // Protocol Buffers for Objective C
  2. //
  3. // Copyright 2010 Booyah Inc.
  4. // Copyright 2008 Cyrus Najmabadi
  5. //
  6. // Licensed under the Apache License, Version 2.0 (the "License");
  7. // you may not use this file except in compliance with the License.
  8. // You may obtain a copy of the License at
  9. //
  10. // http://www.apache.org/licenses/LICENSE-2.0
  11. //
  12. // Unless required by applicable law or agreed to in writing, software
  13. // distributed under the License is distributed on an "AS IS" BASIS,
  14. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  15. // See the License for the specific language governing permissions and
  16. // limitations under the License.
  17. #import "WireFormat.h"
  18. @class PBCodedInputStream;
  19. @class PBCodedOutputStream;
  20. //@class PBExtendableMessageBuilder;
  21. @class PBExtensionRegistry;
  22. @class PBUnknownFieldSetBuilder;
  23. @protocol PBExtensionField
  24. /**
  25. * @brief fieldNumber
  26. *
  27. * @return int32
  28. */
  29. - (SInt32) fieldNumber;
  30. /**
  31. * @brief wireType
  32. *
  33. * @return PBWireFormat
  34. */
  35. - (PBWireFormat) wireType;
  36. /**
  37. * @brief isRepeated
  38. *
  39. * @return YES/NO
  40. */
  41. - (BOOL) isRepeated;
  42. /**
  43. * @brief extendedClass
  44. *
  45. * @return CLass
  46. */
  47. - (Class) extendedClass;
  48. /**
  49. * @brief 默认值
  50. *
  51. * @return instance
  52. */
  53. - (instancetype) defaultValue;
  54. //- (void) mergeFromCodedInputStream:(PBCodedInputStream*) input
  55. // unknownFields:(PBUnknownFieldSetBuilder*) unknownFields
  56. // extensionRegistry:(PBExtensionRegistry*) extensionRegistry
  57. // builder:(PBExtendableMessageBuilder*) builder
  58. // tag:(SInt32) tag;
  59. - (void) writeValue:(id) value includingTagToCodedOutputStream:(PBCodedOutputStream*) output;
  60. /**
  61. * @brief 计算长度
  62. *
  63. * @return size
  64. */
  65. - (SInt32) computeSerializedSizeIncludingTag:(id) value;
  66. /**
  67. * @brief 打印描述
  68. *
  69. * @return
  70. */
  71. - (void) writeDescriptionOf:(id) value
  72. to:(NSMutableString*) output
  73. withIndent:(NSString*) indent;
  74. /**
  75. * @brief 添加到dic
  76. *
  77. * @return
  78. */
  79. - (void) addDictionaryEntriesOf:(id) value
  80. to:(NSMutableDictionary*) dictionary;
  81. @end