GPBUnknownFieldSet.h 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  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. #import "GPBUnknownField.h"
  9. @class GPBUnknownField;
  10. NS_ASSUME_NONNULL_BEGIN
  11. /**
  12. * A collection of unknown fields. Fields parsed from the binary representation
  13. * of a message that are unknown end up in an instance of this set.
  14. **/
  15. __attribute__((deprecated("Use GPBUnknownFields instead.", "GPBUnknownFields")))
  16. __attribute__((objc_subclassing_restricted))
  17. @interface GPBUnknownFieldSet : NSObject<NSCopying>
  18. /**
  19. * Tests to see if the given field number has a value.
  20. *
  21. * @param number The field number to check.
  22. *
  23. * @return YES if there is an unknown field for the given field number.
  24. **/
  25. - (BOOL)hasField:(int32_t)number;
  26. /**
  27. * Fetches the GPBUnknownField for the given field number.
  28. *
  29. * @param number The field number to look up.
  30. *
  31. * @return The GPBUnknownField or nil if none found.
  32. **/
  33. - (nullable GPBUnknownField *)getField:(int32_t)number;
  34. /**
  35. * @return The number of fields in this set.
  36. **/
  37. - (NSUInteger)countOfFields;
  38. /**
  39. * Adds the given field to the set.
  40. *
  41. * @param field The field to add to the set.
  42. **/
  43. - (void)addField:(GPBUnknownField *)field;
  44. /**
  45. * @return An array of the GPBUnknownFields sorted by the field numbers.
  46. **/
  47. - (NSArray<GPBUnknownField *> *)sortedFields;
  48. @end
  49. NS_ASSUME_NONNULL_END