aboutsummaryrefslogtreecommitdiffhomepage
path: root/objectivec/google/protobuf/Type.pbobjc.h
blob: 652a33a766ecc521d0564265ff2ee61e9a1d2ed8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
// Generated by the protocol buffer compiler.  DO NOT EDIT!
// source: google/protobuf/type.proto

#import "GPBProtocolBuffers.h"

#if GOOGLE_PROTOBUF_OBJC_GEN_VERSION != 30000
#error This file was generated by a different version of protoc-gen-objc which is incompatible with your Protocol Buffer sources.
#endif

// @@protoc_insertion_point(imports)

CF_EXTERN_C_BEGIN

@class GPBAny;
@class GPBSourceContext;

#pragma mark - Enum GPBField_Kind

// Kind represents a basic field type.
typedef GPB_ENUM(GPBField_Kind) {
  GPBField_Kind_GPBUnrecognizedEnumeratorValue = kGPBUnrecognizedEnumeratorValue,
  // Field type unknown.
  GPBField_Kind_TypeUnknown = 0,

  // Field type double.
  GPBField_Kind_TypeDouble = 1,

  // Field type float.
  GPBField_Kind_TypeFloat = 2,

  // Field type int64.
  GPBField_Kind_TypeInt64 = 3,

  // Field type uint64.
  GPBField_Kind_TypeUint64 = 4,

  // Field type int32.
  GPBField_Kind_TypeInt32 = 5,

  // Field type fixed64.
  GPBField_Kind_TypeFixed64 = 6,

  // Field type fixed32.
  GPBField_Kind_TypeFixed32 = 7,

  // Field type bool.
  GPBField_Kind_TypeBool = 8,

  // Field type string.
  GPBField_Kind_TypeString = 9,

  // Field type message.
  GPBField_Kind_TypeMessage = 11,

  // Field type bytes.
  GPBField_Kind_TypeBytes = 12,

  // Field type uint32.
  GPBField_Kind_TypeUint32 = 13,

  // Field type enum.
  GPBField_Kind_TypeEnum = 14,

  // Field type sfixed32.
  GPBField_Kind_TypeSfixed32 = 15,

  // Field type sfixed64.
  GPBField_Kind_TypeSfixed64 = 16,

  // Field type sint32.
  GPBField_Kind_TypeSint32 = 17,

  // Field type sint64.
  GPBField_Kind_TypeSint64 = 18,
};

GPBEnumDescriptor *GPBField_Kind_EnumDescriptor(void);

BOOL GPBField_Kind_IsValidValue(int32_t value);

#pragma mark - Enum GPBField_Cardinality

// Cardinality represents whether a field is optional, required, or
// repeated.
typedef GPB_ENUM(GPBField_Cardinality) {
  GPBField_Cardinality_GPBUnrecognizedEnumeratorValue = kGPBUnrecognizedEnumeratorValue,
  // The field cardinality is unknown. Typically an error condition.
  GPBField_Cardinality_CardinalityUnknown = 0,

  // For optional fields.
  GPBField_Cardinality_CardinalityOptional = 1,

  // For required fields. Not used for proto3.
  GPBField_Cardinality_CardinalityRequired = 2,

  // For repeated fields.
  GPBField_Cardinality_CardinalityRepeated = 3,
};

GPBEnumDescriptor *GPBField_Cardinality_EnumDescriptor(void);

BOOL GPBField_Cardinality_IsValidValue(int32_t value);


#pragma mark - GPBTypeRoot

@interface GPBTypeRoot : GPBRootObject

// The base class provides:
//   + (GPBExtensionRegistry *)extensionRegistry;
// which is an GPBExtensionRegistry that includes all the extensions defined by
// this file and all files that it depends on.

@end

#pragma mark - GPBType

typedef GPB_ENUM(GPBType_FieldNumber) {
  GPBType_FieldNumber_Name = 1,
  GPBType_FieldNumber_FieldsArray = 2,
  GPBType_FieldNumber_OneofsArray = 3,
  GPBType_FieldNumber_OptionsArray = 4,
  GPBType_FieldNumber_SourceContext = 5,
};

// A light-weight descriptor for a proto message type.
@interface GPBType : GPBMessage

// The fully qualified message name.
@property(nonatomic, readwrite, copy) NSString *name;

// The list of fields.
// |fieldsArray| contains |GPBField|
@property(nonatomic, readwrite, strong) NSMutableArray *fieldsArray;

// The list of oneof definitions.
// The list of oneofs declared in this Type
// |oneofsArray| contains |NSString|
@property(nonatomic, readwrite, strong) NSMutableArray *oneofsArray;

// The proto options.
// |optionsArray| contains |GPBOption|
@property(nonatomic, readwrite, strong) NSMutableArray *optionsArray;

// The source context.
@property(nonatomic, readwrite) BOOL hasSourceContext;
@property(nonatomic, readwrite, strong) GPBSourceContext *sourceContext;

@end

#pragma mark - GPBField

typedef GPB_ENUM(GPBField_FieldNumber) {
  GPBField_FieldNumber_Kind = 1,
  GPBField_FieldNumber_Cardinality = 2,
  GPBField_FieldNumber_Number = 3,
  GPBField_FieldNumber_Name = 4,
  GPBField_FieldNumber_TypeURL = 6,
  GPBField_FieldNumber_OneofIndex = 7,
  GPBField_FieldNumber_Packed = 8,
  GPBField_FieldNumber_OptionsArray = 9,
};

// Field represents a single field of a message type.
@interface GPBField : GPBMessage

// The field kind.
@property(nonatomic, readwrite) GPBField_Kind kind;

// The field cardinality, i.e. optional/required/repeated.
@property(nonatomic, readwrite) GPBField_Cardinality cardinality;

// The proto field number.
@property(nonatomic, readwrite) int32_t number;

// The field name.
@property(nonatomic, readwrite, copy) NSString *name;

// The type URL (without the scheme) when the type is MESSAGE or ENUM,
// such as `type.googleapis.com/google.protobuf.Empty`.
@property(nonatomic, readwrite, copy) NSString *typeURL;

// Index in Type.oneofs. Starts at 1. Zero means no oneof mapping.
@property(nonatomic, readwrite) int32_t oneofIndex;

// Whether to use alternative packed wire representation.
@property(nonatomic, readwrite) BOOL packed;

// The proto options.
// |optionsArray| contains |GPBOption|
@property(nonatomic, readwrite, strong) NSMutableArray *optionsArray;

@end

int32_t GPBField_Kind_RawValue(GPBField *message);
void SetGPBField_Kind_RawValue(GPBField *message, int32_t value);

int32_t GPBField_Cardinality_RawValue(GPBField *message);
void SetGPBField_Cardinality_RawValue(GPBField *message, int32_t value);

#pragma mark - GPBEnum

typedef GPB_ENUM(GPBEnum_FieldNumber) {
  GPBEnum_FieldNumber_Name = 1,
  GPBEnum_FieldNumber_EnumvalueArray = 2,
  GPBEnum_FieldNumber_OptionsArray = 3,
  GPBEnum_FieldNumber_SourceContext = 4,
};

// Enum type definition.
@interface GPBEnum : GPBMessage

// Enum type name.
@property(nonatomic, readwrite, copy) NSString *name;

// Enum value definitions.
// |enumvalueArray| contains |GPBEnumValue|
@property(nonatomic, readwrite, strong) NSMutableArray *enumvalueArray;

// Proto options for the enum type.
// |optionsArray| contains |GPBOption|
@property(nonatomic, readwrite, strong) NSMutableArray *optionsArray;

// The source context.
@property(nonatomic, readwrite) BOOL hasSourceContext;
@property(nonatomic, readwrite, strong) GPBSourceContext *sourceContext;

@end

#pragma mark - GPBEnumValue

typedef GPB_ENUM(GPBEnumValue_FieldNumber) {
  GPBEnumValue_FieldNumber_Name = 1,
  GPBEnumValue_FieldNumber_Number = 2,
  GPBEnumValue_FieldNumber_OptionsArray = 3,
};

// Enum value definition.
@interface GPBEnumValue : GPBMessage

// Enum value name.
@property(nonatomic, readwrite, copy) NSString *name;

// Enum value number.
@property(nonatomic, readwrite) int32_t number;

// Proto options for the enum value.
// |optionsArray| contains |GPBOption|
@property(nonatomic, readwrite, strong) NSMutableArray *optionsArray;

@end

#pragma mark - GPBOption

typedef GPB_ENUM(GPBOption_FieldNumber) {
  GPBOption_FieldNumber_Name = 1,
  GPBOption_FieldNumber_Value = 2,
};

// Proto option attached to messages/fields/enums etc.
@interface GPBOption : GPBMessage

// Proto option name.
@property(nonatomic, readwrite, copy) NSString *name;

// Proto option value.
@property(nonatomic, readwrite) BOOL hasValue;
@property(nonatomic, readwrite, strong) GPBAny *value;

@end

CF_EXTERN_C_END

// @@protoc_insertion_point(global_scope)