GPBUnknownField.h 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. // Protocol Buffers - Google's data interchange format
  2. // Copyright 2008 Google Inc. All rights reserved.
  3. //
  4. // Use of this source code is governed by a BSD-style
  5. // license that can be found in the LICENSE file or at
  6. // https://developers.google.com/open-source/licenses/bsd
  7. #import <Foundation/Foundation.h>
  8. @class GPBCodedOutputStream;
  9. @class GPBUInt32Array;
  10. @class GPBUInt64Array;
  11. @class GPBUnknownFieldSet;
  12. NS_ASSUME_NONNULL_BEGIN
  13. /**
  14. * Store an unknown field. These are used in conjunction with
  15. * GPBUnknownFieldSet.
  16. **/
  17. __attribute__((objc_subclassing_restricted))
  18. @interface GPBUnknownField : NSObject<NSCopying>
  19. /** Initialize a field with the given number. */
  20. - (instancetype)initWithNumber:(int32_t)number;
  21. /** The field number the data is stored under. */
  22. @property(nonatomic, readonly, assign) int32_t number;
  23. /** An array of varint values for this field. */
  24. @property(nonatomic, readonly, strong) GPBUInt64Array *varintList;
  25. /** An array of fixed32 values for this field. */
  26. @property(nonatomic, readonly, strong) GPBUInt32Array *fixed32List;
  27. /** An array of fixed64 values for this field. */
  28. @property(nonatomic, readonly, strong) GPBUInt64Array *fixed64List;
  29. /** An array of data values for this field. */
  30. @property(nonatomic, readonly, strong) NSArray<NSData *> *lengthDelimitedList;
  31. /** An array of groups of values for this field. */
  32. @property(nonatomic, readonly, strong) NSArray<GPBUnknownFieldSet *> *groupList;
  33. /**
  34. * Add a value to the varintList.
  35. *
  36. * @param value The value to add.
  37. **/
  38. - (void)addVarint:(uint64_t)value;
  39. /**
  40. * Add a value to the fixed32List.
  41. *
  42. * @param value The value to add.
  43. **/
  44. - (void)addFixed32:(uint32_t)value;
  45. /**
  46. * Add a value to the fixed64List.
  47. *
  48. * @param value The value to add.
  49. **/
  50. - (void)addFixed64:(uint64_t)value;
  51. /**
  52. * Add a value to the lengthDelimitedList.
  53. *
  54. * @param value The value to add.
  55. **/
  56. - (void)addLengthDelimited:(NSData *)value;
  57. /**
  58. * Add a value to the groupList.
  59. *
  60. * @param value The value to add.
  61. **/
  62. - (void)addGroup:(GPBUnknownFieldSet *)value;
  63. @end
  64. NS_ASSUME_NONNULL_END