1 // Protocol Buffers - Google's data interchange format
2 // Copyright 2008 Google Inc. All rights reserved.
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
8 #import <Foundation/Foundation.h>
11 #import "GPBUnknownFields.h"
13 @
class GPBUnknownFields
;
15 NS_ASSUME_NONNULL_BEGIN
17 typedef NS_ENUM(uint8_t, GPBUnknownFieldType
) {
18 GPBUnknownFieldTypeVarint
,
19 GPBUnknownFieldTypeFixed32
,
20 GPBUnknownFieldTypeFixed64
,
21 GPBUnknownFieldTypeLengthDelimited
, // Length prefixed
22 GPBUnknownFieldTypeGroup
, // Tag delimited
26 * Store an unknown field. These are used in conjunction with GPBUnknownFields.
28 __attribute__((objc_subclassing_restricted
))
29 @interface GPBUnknownField
: NSObject
<NSCopying
>
31 /** The field number the data is stored under. */
32 @
property(nonatomic
, readonly
, assign
) int32_t number
;
34 /** The type of the field. */
35 @
property(nonatomic
, readonly
, assign
) GPBUnknownFieldType type
;
38 * Fetch the varint value.
40 * It is a programming error to call this when the `type` is not a varint.
42 @
property(nonatomic
, readonly
, assign
) uint64_t varint
;
45 * Fetch the fixed32 value.
47 * It is a programming error to call this when the `type` is not a fixed32.
49 @
property(nonatomic
, readonly
, assign
) uint32_t fixed32
;
52 * Fetch the fixed64 value.
54 * It is a programming error to call this when the `type` is not a fixed64.
56 @
property(nonatomic
, readonly
, assign
) uint64_t fixed64
;
59 * Fetch the length delimited (length prefixed) value.
61 * It is a programming error to call this when the `type` is not a length
64 @
property(nonatomic
, readonly
, strong
, nonnull
) NSData
*lengthDelimited
;
67 * Fetch the group (tag delimited) value.
69 * It is a programming error to call this when the `type` is not a group.
71 @
property(nonatomic
, readonly
, strong
, nonnull
) GPBUnknownFields
*group
;