Descriptor.pbobjc.h 46 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144
  1. // Generated by the protocol buffer compiler. DO NOT EDIT!
  2. // source: google/protobuf/descriptor.proto
  3. #import "GPBProtocolBuffers.h"
  4. #if GOOGLE_PROTOBUF_OBJC_GEN_VERSION != 30000
  5. #error This file was generated by a different version of protoc-gen-objc which is incompatible with your Protocol Buffer sources.
  6. #endif
  7. // @@protoc_insertion_point(imports)
  8. CF_EXTERN_C_BEGIN
  9. @class GPBEnumOptions;
  10. @class GPBEnumValueOptions;
  11. @class GPBFieldOptions;
  12. @class GPBFileOptions;
  13. @class GPBMessageOptions;
  14. @class GPBMethodOptions;
  15. @class GPBServiceOptions;
  16. @class GPBSourceCodeInfo;
  17. NS_ASSUME_NONNULL_BEGIN
  18. #pragma mark - Enum GPBFieldDescriptorProto_Type
  19. typedef GPB_ENUM(GPBFieldDescriptorProto_Type) {
  20. // 0 is reserved for errors.
  21. // Order is weird for historical reasons.
  22. GPBFieldDescriptorProto_Type_TypeDouble = 1,
  23. GPBFieldDescriptorProto_Type_TypeFloat = 2,
  24. // Not ZigZag encoded. Negative numbers take 10 bytes. Use TYPE_SINT64 if
  25. // negative values are likely.
  26. GPBFieldDescriptorProto_Type_TypeInt64 = 3,
  27. GPBFieldDescriptorProto_Type_TypeUint64 = 4,
  28. // Not ZigZag encoded. Negative numbers take 10 bytes. Use TYPE_SINT32 if
  29. // negative values are likely.
  30. GPBFieldDescriptorProto_Type_TypeInt32 = 5,
  31. GPBFieldDescriptorProto_Type_TypeFixed64 = 6,
  32. GPBFieldDescriptorProto_Type_TypeFixed32 = 7,
  33. GPBFieldDescriptorProto_Type_TypeBool = 8,
  34. GPBFieldDescriptorProto_Type_TypeString = 9,
  35. // Tag-delimited aggregate.
  36. GPBFieldDescriptorProto_Type_TypeGroup = 10,
  37. // Length-delimited aggregate.
  38. GPBFieldDescriptorProto_Type_TypeMessage = 11,
  39. // New in version 2.
  40. GPBFieldDescriptorProto_Type_TypeBytes = 12,
  41. GPBFieldDescriptorProto_Type_TypeUint32 = 13,
  42. GPBFieldDescriptorProto_Type_TypeEnum = 14,
  43. GPBFieldDescriptorProto_Type_TypeSfixed32 = 15,
  44. GPBFieldDescriptorProto_Type_TypeSfixed64 = 16,
  45. // Uses ZigZag encoding.
  46. GPBFieldDescriptorProto_Type_TypeSint32 = 17,
  47. // Uses ZigZag encoding.
  48. GPBFieldDescriptorProto_Type_TypeSint64 = 18,
  49. };
  50. GPBEnumDescriptor *GPBFieldDescriptorProto_Type_EnumDescriptor(void);
  51. BOOL GPBFieldDescriptorProto_Type_IsValidValue(int32_t value);
  52. #pragma mark - Enum GPBFieldDescriptorProto_Label
  53. typedef GPB_ENUM(GPBFieldDescriptorProto_Label) {
  54. // 0 is reserved for errors
  55. GPBFieldDescriptorProto_Label_LabelOptional = 1,
  56. GPBFieldDescriptorProto_Label_LabelRequired = 2,
  57. // TODO(sanjay): Should we add LABEL_MAP?
  58. GPBFieldDescriptorProto_Label_LabelRepeated = 3,
  59. };
  60. GPBEnumDescriptor *GPBFieldDescriptorProto_Label_EnumDescriptor(void);
  61. BOOL GPBFieldDescriptorProto_Label_IsValidValue(int32_t value);
  62. #pragma mark - Enum GPBFileOptions_OptimizeMode
  63. // Generated classes can be optimized for speed or code size.
  64. typedef GPB_ENUM(GPBFileOptions_OptimizeMode) {
  65. // Generate complete code for parsing, serialization,
  66. GPBFileOptions_OptimizeMode_Speed = 1,
  67. // etc.
  68. GPBFileOptions_OptimizeMode_CodeSize = 2,
  69. // Generate code using MessageLite and the lite runtime.
  70. GPBFileOptions_OptimizeMode_LiteRuntime = 3,
  71. };
  72. GPBEnumDescriptor *GPBFileOptions_OptimizeMode_EnumDescriptor(void);
  73. BOOL GPBFileOptions_OptimizeMode_IsValidValue(int32_t value);
  74. #pragma mark - Enum GPBFieldOptions_CType
  75. typedef GPB_ENUM(GPBFieldOptions_CType) {
  76. // Default mode.
  77. GPBFieldOptions_CType_String = 0,
  78. GPBFieldOptions_CType_Cord = 1,
  79. GPBFieldOptions_CType_StringPiece = 2,
  80. };
  81. GPBEnumDescriptor *GPBFieldOptions_CType_EnumDescriptor(void);
  82. BOOL GPBFieldOptions_CType_IsValidValue(int32_t value);
  83. #pragma mark - Enum GPBFieldOptions_JSType
  84. typedef GPB_ENUM(GPBFieldOptions_JSType) {
  85. // Use the default type.
  86. GPBFieldOptions_JSType_JsNormal = 0,
  87. // Use JavaScript strings.
  88. GPBFieldOptions_JSType_JsString = 1,
  89. // Use JavaScript numbers.
  90. GPBFieldOptions_JSType_JsNumber = 2,
  91. };
  92. GPBEnumDescriptor *GPBFieldOptions_JSType_EnumDescriptor(void);
  93. BOOL GPBFieldOptions_JSType_IsValidValue(int32_t value);
  94. #pragma mark - GPBDescriptorRoot
  95. @interface GPBDescriptorRoot : GPBRootObject
  96. // The base class provides:
  97. // + (GPBExtensionRegistry *)extensionRegistry;
  98. // which is an GPBExtensionRegistry that includes all the extensions defined by
  99. // this file and all files that it depends on.
  100. @end
  101. #pragma mark - GPBFileDescriptorSet
  102. typedef GPB_ENUM(GPBFileDescriptorSet_FieldNumber) {
  103. GPBFileDescriptorSet_FieldNumber_FileArray = 1,
  104. };
  105. // The protocol compiler can output a FileDescriptorSet containing the .proto
  106. // files it parses.
  107. @interface GPBFileDescriptorSet : GPBMessage
  108. // |fileArray| contains |GPBFileDescriptorProto|
  109. @property(nonatomic, readwrite, strong, null_resettable) NSMutableArray *fileArray;
  110. @property(nonatomic, readonly) NSUInteger fileArray_Count;
  111. @end
  112. #pragma mark - GPBFileDescriptorProto
  113. typedef GPB_ENUM(GPBFileDescriptorProto_FieldNumber) {
  114. GPBFileDescriptorProto_FieldNumber_Name = 1,
  115. GPBFileDescriptorProto_FieldNumber_Package = 2,
  116. GPBFileDescriptorProto_FieldNumber_DependencyArray = 3,
  117. GPBFileDescriptorProto_FieldNumber_MessageTypeArray = 4,
  118. GPBFileDescriptorProto_FieldNumber_EnumTypeArray = 5,
  119. GPBFileDescriptorProto_FieldNumber_ServiceArray = 6,
  120. GPBFileDescriptorProto_FieldNumber_ExtensionArray = 7,
  121. GPBFileDescriptorProto_FieldNumber_Options = 8,
  122. GPBFileDescriptorProto_FieldNumber_SourceCodeInfo = 9,
  123. GPBFileDescriptorProto_FieldNumber_PublicDependencyArray = 10,
  124. GPBFileDescriptorProto_FieldNumber_WeakDependencyArray = 11,
  125. GPBFileDescriptorProto_FieldNumber_Syntax = 12,
  126. };
  127. // Describes a complete .proto file.
  128. @interface GPBFileDescriptorProto : GPBMessage
  129. // file name, relative to root of source tree
  130. @property(nonatomic, readwrite) BOOL hasName;
  131. @property(nonatomic, readwrite, copy, null_resettable) NSString *name;
  132. // e.g. "foo", "foo.bar", etc.
  133. @property(nonatomic, readwrite) BOOL hasPackage;
  134. @property(nonatomic, readwrite, copy, null_resettable) NSString *package;
  135. // Names of files imported by this file.
  136. // |dependencyArray| contains |NSString|
  137. @property(nonatomic, readwrite, strong, null_resettable) NSMutableArray *dependencyArray;
  138. @property(nonatomic, readonly) NSUInteger dependencyArray_Count;
  139. // Indexes of the public imported files in the dependency list above.
  140. @property(nonatomic, readwrite, strong, null_resettable) GPBInt32Array *publicDependencyArray;
  141. @property(nonatomic, readonly) NSUInteger publicDependencyArray_Count;
  142. // Indexes of the weak imported files in the dependency list.
  143. // For Google-internal migration only. Do not use.
  144. @property(nonatomic, readwrite, strong, null_resettable) GPBInt32Array *weakDependencyArray;
  145. @property(nonatomic, readonly) NSUInteger weakDependencyArray_Count;
  146. // All top-level definitions in this file.
  147. // |messageTypeArray| contains |GPBDescriptorProto|
  148. @property(nonatomic, readwrite, strong, null_resettable) NSMutableArray *messageTypeArray;
  149. @property(nonatomic, readonly) NSUInteger messageTypeArray_Count;
  150. // |enumTypeArray| contains |GPBEnumDescriptorProto|
  151. @property(nonatomic, readwrite, strong, null_resettable) NSMutableArray *enumTypeArray;
  152. @property(nonatomic, readonly) NSUInteger enumTypeArray_Count;
  153. // |serviceArray| contains |GPBServiceDescriptorProto|
  154. @property(nonatomic, readwrite, strong, null_resettable) NSMutableArray *serviceArray;
  155. @property(nonatomic, readonly) NSUInteger serviceArray_Count;
  156. // |extensionArray| contains |GPBFieldDescriptorProto|
  157. @property(nonatomic, readwrite, strong, null_resettable) NSMutableArray *extensionArray;
  158. @property(nonatomic, readonly) NSUInteger extensionArray_Count;
  159. @property(nonatomic, readwrite) BOOL hasOptions;
  160. @property(nonatomic, readwrite, strong, null_resettable) GPBFileOptions *options;
  161. // This field contains optional information about the original source code.
  162. // You may safely remove this entire field without harming runtime
  163. // functionality of the descriptors -- the information is needed only by
  164. // development tools.
  165. @property(nonatomic, readwrite) BOOL hasSourceCodeInfo;
  166. @property(nonatomic, readwrite, strong, null_resettable) GPBSourceCodeInfo *sourceCodeInfo;
  167. // The syntax of the proto file.
  168. // The supported values are "proto2" and "proto3".
  169. @property(nonatomic, readwrite) BOOL hasSyntax;
  170. @property(nonatomic, readwrite, copy, null_resettable) NSString *syntax;
  171. @end
  172. #pragma mark - GPBDescriptorProto
  173. typedef GPB_ENUM(GPBDescriptorProto_FieldNumber) {
  174. GPBDescriptorProto_FieldNumber_Name = 1,
  175. GPBDescriptorProto_FieldNumber_FieldArray = 2,
  176. GPBDescriptorProto_FieldNumber_NestedTypeArray = 3,
  177. GPBDescriptorProto_FieldNumber_EnumTypeArray = 4,
  178. GPBDescriptorProto_FieldNumber_ExtensionRangeArray = 5,
  179. GPBDescriptorProto_FieldNumber_ExtensionArray = 6,
  180. GPBDescriptorProto_FieldNumber_Options = 7,
  181. GPBDescriptorProto_FieldNumber_OneofDeclArray = 8,
  182. GPBDescriptorProto_FieldNumber_ReservedRangeArray = 9,
  183. GPBDescriptorProto_FieldNumber_ReservedNameArray = 10,
  184. };
  185. // Describes a message type.
  186. @interface GPBDescriptorProto : GPBMessage
  187. @property(nonatomic, readwrite) BOOL hasName;
  188. @property(nonatomic, readwrite, copy, null_resettable) NSString *name;
  189. // |fieldArray| contains |GPBFieldDescriptorProto|
  190. @property(nonatomic, readwrite, strong, null_resettable) NSMutableArray *fieldArray;
  191. @property(nonatomic, readonly) NSUInteger fieldArray_Count;
  192. // |extensionArray| contains |GPBFieldDescriptorProto|
  193. @property(nonatomic, readwrite, strong, null_resettable) NSMutableArray *extensionArray;
  194. @property(nonatomic, readonly) NSUInteger extensionArray_Count;
  195. // |nestedTypeArray| contains |GPBDescriptorProto|
  196. @property(nonatomic, readwrite, strong, null_resettable) NSMutableArray *nestedTypeArray;
  197. @property(nonatomic, readonly) NSUInteger nestedTypeArray_Count;
  198. // |enumTypeArray| contains |GPBEnumDescriptorProto|
  199. @property(nonatomic, readwrite, strong, null_resettable) NSMutableArray *enumTypeArray;
  200. @property(nonatomic, readonly) NSUInteger enumTypeArray_Count;
  201. // |extensionRangeArray| contains |GPBDescriptorProto_ExtensionRange|
  202. @property(nonatomic, readwrite, strong, null_resettable) NSMutableArray *extensionRangeArray;
  203. @property(nonatomic, readonly) NSUInteger extensionRangeArray_Count;
  204. // |oneofDeclArray| contains |GPBOneofDescriptorProto|
  205. @property(nonatomic, readwrite, strong, null_resettable) NSMutableArray *oneofDeclArray;
  206. @property(nonatomic, readonly) NSUInteger oneofDeclArray_Count;
  207. @property(nonatomic, readwrite) BOOL hasOptions;
  208. @property(nonatomic, readwrite, strong, null_resettable) GPBMessageOptions *options;
  209. // |reservedRangeArray| contains |GPBDescriptorProto_ReservedRange|
  210. @property(nonatomic, readwrite, strong, null_resettable) NSMutableArray *reservedRangeArray;
  211. @property(nonatomic, readonly) NSUInteger reservedRangeArray_Count;
  212. // Reserved field names, which may not be used by fields in the same message.
  213. // A given name may only be reserved once.
  214. // |reservedNameArray| contains |NSString|
  215. @property(nonatomic, readwrite, strong, null_resettable) NSMutableArray *reservedNameArray;
  216. @property(nonatomic, readonly) NSUInteger reservedNameArray_Count;
  217. @end
  218. #pragma mark - GPBDescriptorProto_ExtensionRange
  219. typedef GPB_ENUM(GPBDescriptorProto_ExtensionRange_FieldNumber) {
  220. GPBDescriptorProto_ExtensionRange_FieldNumber_Start = 1,
  221. GPBDescriptorProto_ExtensionRange_FieldNumber_End = 2,
  222. };
  223. @interface GPBDescriptorProto_ExtensionRange : GPBMessage
  224. @property(nonatomic, readwrite) BOOL hasStart;
  225. @property(nonatomic, readwrite) int32_t start;
  226. @property(nonatomic, readwrite) BOOL hasEnd;
  227. @property(nonatomic, readwrite) int32_t end;
  228. @end
  229. #pragma mark - GPBDescriptorProto_ReservedRange
  230. typedef GPB_ENUM(GPBDescriptorProto_ReservedRange_FieldNumber) {
  231. GPBDescriptorProto_ReservedRange_FieldNumber_Start = 1,
  232. GPBDescriptorProto_ReservedRange_FieldNumber_End = 2,
  233. };
  234. // Range of reserved tag numbers. Reserved tag numbers may not be used by
  235. // fields or extension ranges in the same message. Reserved ranges may
  236. // not overlap.
  237. @interface GPBDescriptorProto_ReservedRange : GPBMessage
  238. // Inclusive.
  239. @property(nonatomic, readwrite) BOOL hasStart;
  240. @property(nonatomic, readwrite) int32_t start;
  241. // Exclusive.
  242. @property(nonatomic, readwrite) BOOL hasEnd;
  243. @property(nonatomic, readwrite) int32_t end;
  244. @end
  245. #pragma mark - GPBFieldDescriptorProto
  246. typedef GPB_ENUM(GPBFieldDescriptorProto_FieldNumber) {
  247. GPBFieldDescriptorProto_FieldNumber_Name = 1,
  248. GPBFieldDescriptorProto_FieldNumber_Extendee = 2,
  249. GPBFieldDescriptorProto_FieldNumber_Number = 3,
  250. GPBFieldDescriptorProto_FieldNumber_Label = 4,
  251. GPBFieldDescriptorProto_FieldNumber_Type = 5,
  252. GPBFieldDescriptorProto_FieldNumber_TypeName = 6,
  253. GPBFieldDescriptorProto_FieldNumber_DefaultValue = 7,
  254. GPBFieldDescriptorProto_FieldNumber_Options = 8,
  255. GPBFieldDescriptorProto_FieldNumber_OneofIndex = 9,
  256. };
  257. // Describes a field within a message.
  258. @interface GPBFieldDescriptorProto : GPBMessage
  259. @property(nonatomic, readwrite) BOOL hasName;
  260. @property(nonatomic, readwrite, copy, null_resettable) NSString *name;
  261. @property(nonatomic, readwrite) BOOL hasNumber;
  262. @property(nonatomic, readwrite) int32_t number;
  263. @property(nonatomic, readwrite) BOOL hasLabel;
  264. @property(nonatomic, readwrite) GPBFieldDescriptorProto_Label label;
  265. // If type_name is set, this need not be set. If both this and type_name
  266. // are set, this must be one of TYPE_ENUM, TYPE_MESSAGE or TYPE_GROUP.
  267. @property(nonatomic, readwrite) BOOL hasType;
  268. @property(nonatomic, readwrite) GPBFieldDescriptorProto_Type type;
  269. // For message and enum types, this is the name of the type. If the name
  270. // starts with a '.', it is fully-qualified. Otherwise, C++-like scoping
  271. // rules are used to find the type (i.e. first the nested types within this
  272. // message are searched, then within the parent, on up to the root
  273. // namespace).
  274. @property(nonatomic, readwrite) BOOL hasTypeName;
  275. @property(nonatomic, readwrite, copy, null_resettable) NSString *typeName;
  276. // For extensions, this is the name of the type being extended. It is
  277. // resolved in the same manner as type_name.
  278. @property(nonatomic, readwrite) BOOL hasExtendee;
  279. @property(nonatomic, readwrite, copy, null_resettable) NSString *extendee;
  280. // For numeric types, contains the original text representation of the value.
  281. // For booleans, "true" or "false".
  282. // For strings, contains the default text contents (not escaped in any way).
  283. // For bytes, contains the C escaped value. All bytes >= 128 are escaped.
  284. // TODO(kenton): Base-64 encode?
  285. @property(nonatomic, readwrite) BOOL hasDefaultValue;
  286. @property(nonatomic, readwrite, copy, null_resettable) NSString *defaultValue;
  287. // If set, gives the index of a oneof in the containing type's oneof_decl
  288. // list. This field is a member of that oneof.
  289. @property(nonatomic, readwrite) BOOL hasOneofIndex;
  290. @property(nonatomic, readwrite) int32_t oneofIndex;
  291. @property(nonatomic, readwrite) BOOL hasOptions;
  292. @property(nonatomic, readwrite, strong, null_resettable) GPBFieldOptions *options;
  293. @end
  294. #pragma mark - GPBOneofDescriptorProto
  295. typedef GPB_ENUM(GPBOneofDescriptorProto_FieldNumber) {
  296. GPBOneofDescriptorProto_FieldNumber_Name = 1,
  297. };
  298. // Describes a oneof.
  299. @interface GPBOneofDescriptorProto : GPBMessage
  300. @property(nonatomic, readwrite) BOOL hasName;
  301. @property(nonatomic, readwrite, copy, null_resettable) NSString *name;
  302. @end
  303. #pragma mark - GPBEnumDescriptorProto
  304. typedef GPB_ENUM(GPBEnumDescriptorProto_FieldNumber) {
  305. GPBEnumDescriptorProto_FieldNumber_Name = 1,
  306. GPBEnumDescriptorProto_FieldNumber_ValueArray = 2,
  307. GPBEnumDescriptorProto_FieldNumber_Options = 3,
  308. };
  309. // Describes an enum type.
  310. @interface GPBEnumDescriptorProto : GPBMessage
  311. @property(nonatomic, readwrite) BOOL hasName;
  312. @property(nonatomic, readwrite, copy, null_resettable) NSString *name;
  313. // |valueArray| contains |GPBEnumValueDescriptorProto|
  314. @property(nonatomic, readwrite, strong, null_resettable) NSMutableArray *valueArray;
  315. @property(nonatomic, readonly) NSUInteger valueArray_Count;
  316. @property(nonatomic, readwrite) BOOL hasOptions;
  317. @property(nonatomic, readwrite, strong, null_resettable) GPBEnumOptions *options;
  318. @end
  319. #pragma mark - GPBEnumValueDescriptorProto
  320. typedef GPB_ENUM(GPBEnumValueDescriptorProto_FieldNumber) {
  321. GPBEnumValueDescriptorProto_FieldNumber_Name = 1,
  322. GPBEnumValueDescriptorProto_FieldNumber_Number = 2,
  323. GPBEnumValueDescriptorProto_FieldNumber_Options = 3,
  324. };
  325. // Describes a value within an enum.
  326. @interface GPBEnumValueDescriptorProto : GPBMessage
  327. @property(nonatomic, readwrite) BOOL hasName;
  328. @property(nonatomic, readwrite, copy, null_resettable) NSString *name;
  329. @property(nonatomic, readwrite) BOOL hasNumber;
  330. @property(nonatomic, readwrite) int32_t number;
  331. @property(nonatomic, readwrite) BOOL hasOptions;
  332. @property(nonatomic, readwrite, strong, null_resettable) GPBEnumValueOptions *options;
  333. @end
  334. #pragma mark - GPBServiceDescriptorProto
  335. typedef GPB_ENUM(GPBServiceDescriptorProto_FieldNumber) {
  336. GPBServiceDescriptorProto_FieldNumber_Name = 1,
  337. GPBServiceDescriptorProto_FieldNumber_MethodArray = 2,
  338. GPBServiceDescriptorProto_FieldNumber_Options = 3,
  339. };
  340. // Describes a service.
  341. @interface GPBServiceDescriptorProto : GPBMessage
  342. @property(nonatomic, readwrite) BOOL hasName;
  343. @property(nonatomic, readwrite, copy, null_resettable) NSString *name;
  344. // |methodArray| contains |GPBMethodDescriptorProto|
  345. @property(nonatomic, readwrite, strong, null_resettable) NSMutableArray *methodArray;
  346. @property(nonatomic, readonly) NSUInteger methodArray_Count;
  347. @property(nonatomic, readwrite) BOOL hasOptions;
  348. @property(nonatomic, readwrite, strong, null_resettable) GPBServiceOptions *options;
  349. @end
  350. #pragma mark - GPBMethodDescriptorProto
  351. typedef GPB_ENUM(GPBMethodDescriptorProto_FieldNumber) {
  352. GPBMethodDescriptorProto_FieldNumber_Name = 1,
  353. GPBMethodDescriptorProto_FieldNumber_InputType = 2,
  354. GPBMethodDescriptorProto_FieldNumber_OutputType = 3,
  355. GPBMethodDescriptorProto_FieldNumber_Options = 4,
  356. GPBMethodDescriptorProto_FieldNumber_ClientStreaming = 5,
  357. GPBMethodDescriptorProto_FieldNumber_ServerStreaming = 6,
  358. };
  359. // Describes a method of a service.
  360. @interface GPBMethodDescriptorProto : GPBMessage
  361. @property(nonatomic, readwrite) BOOL hasName;
  362. @property(nonatomic, readwrite, copy, null_resettable) NSString *name;
  363. // Input and output type names. These are resolved in the same way as
  364. // FieldDescriptorProto.type_name, but must refer to a message type.
  365. @property(nonatomic, readwrite) BOOL hasInputType;
  366. @property(nonatomic, readwrite, copy, null_resettable) NSString *inputType;
  367. @property(nonatomic, readwrite) BOOL hasOutputType;
  368. @property(nonatomic, readwrite, copy, null_resettable) NSString *outputType;
  369. @property(nonatomic, readwrite) BOOL hasOptions;
  370. @property(nonatomic, readwrite, strong, null_resettable) GPBMethodOptions *options;
  371. // Identifies if client streams multiple client messages
  372. @property(nonatomic, readwrite) BOOL hasClientStreaming;
  373. @property(nonatomic, readwrite) BOOL clientStreaming;
  374. // Identifies if server streams multiple server messages
  375. @property(nonatomic, readwrite) BOOL hasServerStreaming;
  376. @property(nonatomic, readwrite) BOOL serverStreaming;
  377. @end
  378. #pragma mark - GPBFileOptions
  379. typedef GPB_ENUM(GPBFileOptions_FieldNumber) {
  380. GPBFileOptions_FieldNumber_JavaPackage = 1,
  381. GPBFileOptions_FieldNumber_JavaOuterClassname = 8,
  382. GPBFileOptions_FieldNumber_OptimizeFor = 9,
  383. GPBFileOptions_FieldNumber_JavaMultipleFiles = 10,
  384. GPBFileOptions_FieldNumber_GoPackage = 11,
  385. GPBFileOptions_FieldNumber_CcGenericServices = 16,
  386. GPBFileOptions_FieldNumber_JavaGenericServices = 17,
  387. GPBFileOptions_FieldNumber_PyGenericServices = 18,
  388. GPBFileOptions_FieldNumber_JavaGenerateEqualsAndHash = 20,
  389. GPBFileOptions_FieldNumber_Deprecated = 23,
  390. GPBFileOptions_FieldNumber_JavaStringCheckUtf8 = 27,
  391. GPBFileOptions_FieldNumber_CcEnableArenas = 31,
  392. GPBFileOptions_FieldNumber_ObjcClassPrefix = 36,
  393. GPBFileOptions_FieldNumber_CsharpNamespace = 37,
  394. GPBFileOptions_FieldNumber_UninterpretedOptionArray = 999,
  395. };
  396. @interface GPBFileOptions : GPBMessage
  397. // Sets the Java package where classes generated from this .proto will be
  398. // placed. By default, the proto package is used, but this is often
  399. // inappropriate because proto packages do not normally start with backwards
  400. // domain names.
  401. @property(nonatomic, readwrite) BOOL hasJavaPackage;
  402. @property(nonatomic, readwrite, copy, null_resettable) NSString *javaPackage;
  403. // If set, all the classes from the .proto file are wrapped in a single
  404. // outer class with the given name. This applies to both Proto1
  405. // (equivalent to the old "--one_java_file" option) and Proto2 (where
  406. // a .proto always translates to a single class, but you may want to
  407. // explicitly choose the class name).
  408. @property(nonatomic, readwrite) BOOL hasJavaOuterClassname;
  409. @property(nonatomic, readwrite, copy, null_resettable) NSString *javaOuterClassname;
  410. // If set true, then the Java code generator will generate a separate .java
  411. // file for each top-level message, enum, and service defined in the .proto
  412. // file. Thus, these types will *not* be nested inside the outer class
  413. // named by java_outer_classname. However, the outer class will still be
  414. // generated to contain the file's getDescriptor() method as well as any
  415. // top-level extensions defined in the file.
  416. @property(nonatomic, readwrite) BOOL hasJavaMultipleFiles;
  417. @property(nonatomic, readwrite) BOOL javaMultipleFiles;
  418. // If set true, then the Java code generator will generate equals() and
  419. // hashCode() methods for all messages defined in the .proto file.
  420. // - In the full runtime, this is purely a speed optimization, as the
  421. // AbstractMessage base class includes reflection-based implementations of
  422. // these methods.
  423. //- In the lite runtime, setting this option changes the semantics of
  424. // equals() and hashCode() to more closely match those of the full runtime;
  425. // the generated methods compute their results based on field values rather
  426. // than object identity. (Implementations should not assume that hashcodes
  427. // will be consistent across runtimes or versions of the protocol compiler.)
  428. @property(nonatomic, readwrite) BOOL hasJavaGenerateEqualsAndHash;
  429. @property(nonatomic, readwrite) BOOL javaGenerateEqualsAndHash;
  430. // If set true, then the Java2 code generator will generate code that
  431. // throws an exception whenever an attempt is made to assign a non-UTF-8
  432. // byte sequence to a string field.
  433. // Message reflection will do the same.
  434. // However, an extension field still accepts non-UTF-8 byte sequences.
  435. // This option has no effect on when used with the lite runtime.
  436. @property(nonatomic, readwrite) BOOL hasJavaStringCheckUtf8;
  437. @property(nonatomic, readwrite) BOOL javaStringCheckUtf8;
  438. @property(nonatomic, readwrite) BOOL hasOptimizeFor;
  439. @property(nonatomic, readwrite) GPBFileOptions_OptimizeMode optimizeFor;
  440. // Sets the Go package where structs generated from this .proto will be
  441. // placed. If omitted, the Go package will be derived from the following:
  442. // - The basename of the package import path, if provided.
  443. // - Otherwise, the package statement in the .proto file, if present.
  444. // - Otherwise, the basename of the .proto file, without extension.
  445. @property(nonatomic, readwrite) BOOL hasGoPackage;
  446. @property(nonatomic, readwrite, copy, null_resettable) NSString *goPackage;
  447. // Should generic services be generated in each language? "Generic" services
  448. // are not specific to any particular RPC system. They are generated by the
  449. // main code generators in each language (without additional plugins).
  450. // Generic services were the only kind of service generation supported by
  451. // early versions of google.protobuf.
  452. //
  453. // Generic services are now considered deprecated in favor of using plugins
  454. // that generate code specific to your particular RPC system. Therefore,
  455. // these default to false. Old code which depends on generic services should
  456. // explicitly set them to true.
  457. @property(nonatomic, readwrite) BOOL hasCcGenericServices;
  458. @property(nonatomic, readwrite) BOOL ccGenericServices;
  459. @property(nonatomic, readwrite) BOOL hasJavaGenericServices;
  460. @property(nonatomic, readwrite) BOOL javaGenericServices;
  461. @property(nonatomic, readwrite) BOOL hasPyGenericServices;
  462. @property(nonatomic, readwrite) BOOL pyGenericServices;
  463. // Is this file deprecated?
  464. // Depending on the target platform, this can emit Deprecated annotations
  465. // for everything in the file, or it will be completely ignored; in the very
  466. // least, this is a formalization for deprecating files.
  467. @property(nonatomic, readwrite) BOOL hasDeprecated;
  468. @property(nonatomic, readwrite) BOOL deprecated;
  469. // Enables the use of arenas for the proto messages in this file. This applies
  470. // only to generated classes for C++.
  471. @property(nonatomic, readwrite) BOOL hasCcEnableArenas;
  472. @property(nonatomic, readwrite) BOOL ccEnableArenas;
  473. // Sets the objective c class prefix which is prepended to all objective c
  474. // generated classes from this .proto. There is no default.
  475. @property(nonatomic, readwrite) BOOL hasObjcClassPrefix;
  476. @property(nonatomic, readwrite, copy, null_resettable) NSString *objcClassPrefix;
  477. // Namespace for generated classes; defaults to the package.
  478. @property(nonatomic, readwrite) BOOL hasCsharpNamespace;
  479. @property(nonatomic, readwrite, copy, null_resettable) NSString *csharpNamespace;
  480. // The parser stores options it doesn't recognize here. See above.
  481. // |uninterpretedOptionArray| contains |GPBUninterpretedOption|
  482. @property(nonatomic, readwrite, strong, null_resettable) NSMutableArray *uninterpretedOptionArray;
  483. @property(nonatomic, readonly) NSUInteger uninterpretedOptionArray_Count;
  484. @end
  485. #pragma mark - GPBMessageOptions
  486. typedef GPB_ENUM(GPBMessageOptions_FieldNumber) {
  487. GPBMessageOptions_FieldNumber_MessageSetWireFormat = 1,
  488. GPBMessageOptions_FieldNumber_NoStandardDescriptorAccessor = 2,
  489. GPBMessageOptions_FieldNumber_Deprecated = 3,
  490. GPBMessageOptions_FieldNumber_MapEntry = 7,
  491. GPBMessageOptions_FieldNumber_UninterpretedOptionArray = 999,
  492. };
  493. @interface GPBMessageOptions : GPBMessage
  494. // Set true to use the old proto1 MessageSet wire format for extensions.
  495. // This is provided for backwards-compatibility with the MessageSet wire
  496. // format. You should not use this for any other reason: It's less
  497. // efficient, has fewer features, and is more complicated.
  498. //
  499. // The message must be defined exactly as follows:
  500. // message Foo {
  501. // option message_set_wire_format = true;
  502. // extensions 4 to max;
  503. // }
  504. // Note that the message cannot have any defined fields; MessageSets only
  505. // have extensions.
  506. //
  507. // All extensions of your type must be singular messages; e.g. they cannot
  508. // be int32s, enums, or repeated messages.
  509. //
  510. // Because this is an option, the above two restrictions are not enforced by
  511. // the protocol compiler.
  512. @property(nonatomic, readwrite) BOOL hasMessageSetWireFormat;
  513. @property(nonatomic, readwrite) BOOL messageSetWireFormat;
  514. // Disables the generation of the standard "descriptor()" accessor, which can
  515. // conflict with a field of the same name. This is meant to make migration
  516. // from proto1 easier; new code should avoid fields named "descriptor".
  517. @property(nonatomic, readwrite) BOOL hasNoStandardDescriptorAccessor;
  518. @property(nonatomic, readwrite) BOOL noStandardDescriptorAccessor;
  519. // Is this message deprecated?
  520. // Depending on the target platform, this can emit Deprecated annotations
  521. // for the message, or it will be completely ignored; in the very least,
  522. // this is a formalization for deprecating messages.
  523. @property(nonatomic, readwrite) BOOL hasDeprecated;
  524. @property(nonatomic, readwrite) BOOL deprecated;
  525. // Whether the message is an automatically generated map entry type for the
  526. // maps field.
  527. //
  528. // For maps fields:
  529. // map<KeyType, ValueType> map_field = 1;
  530. // The parsed descriptor looks like:
  531. // message MapFieldEntry {
  532. // option map_entry = true;
  533. // optional KeyType key = 1;
  534. // optional ValueType value = 2;
  535. // }
  536. // repeated MapFieldEntry map_field = 1;
  537. //
  538. // Implementations may choose not to generate the map_entry=true message, but
  539. // use a native map in the target language to hold the keys and values.
  540. // The reflection APIs in such implementions still need to work as
  541. // if the field is a repeated message field.
  542. //
  543. // NOTE: Do not set the option in .proto files. Always use the maps syntax
  544. // instead. The option should only be implicitly set by the proto compiler
  545. // parser.
  546. @property(nonatomic, readwrite) BOOL hasMapEntry;
  547. @property(nonatomic, readwrite) BOOL mapEntry;
  548. // The parser stores options it doesn't recognize here. See above.
  549. // |uninterpretedOptionArray| contains |GPBUninterpretedOption|
  550. @property(nonatomic, readwrite, strong, null_resettable) NSMutableArray *uninterpretedOptionArray;
  551. @property(nonatomic, readonly) NSUInteger uninterpretedOptionArray_Count;
  552. @end
  553. #pragma mark - GPBFieldOptions
  554. typedef GPB_ENUM(GPBFieldOptions_FieldNumber) {
  555. GPBFieldOptions_FieldNumber_Ctype = 1,
  556. GPBFieldOptions_FieldNumber_Packed = 2,
  557. GPBFieldOptions_FieldNumber_Deprecated = 3,
  558. GPBFieldOptions_FieldNumber_Lazy = 5,
  559. GPBFieldOptions_FieldNumber_Jstype = 6,
  560. GPBFieldOptions_FieldNumber_Weak = 10,
  561. GPBFieldOptions_FieldNumber_UninterpretedOptionArray = 999,
  562. };
  563. @interface GPBFieldOptions : GPBMessage
  564. // The ctype option instructs the C++ code generator to use a different
  565. // representation of the field than it normally would. See the specific
  566. // options below. This option is not yet implemented in the open source
  567. // release -- sorry, we'll try to include it in a future version!
  568. @property(nonatomic, readwrite) BOOL hasCtype;
  569. @property(nonatomic, readwrite) GPBFieldOptions_CType ctype;
  570. // The packed option can be enabled for repeated primitive fields to enable
  571. // a more efficient representation on the wire. Rather than repeatedly
  572. // writing the tag and type for each element, the entire array is encoded as
  573. // a single length-delimited blob. In proto3, only explicit setting it to
  574. // false will avoid using packed encoding.
  575. @property(nonatomic, readwrite) BOOL hasPacked;
  576. @property(nonatomic, readwrite) BOOL packed;
  577. // The jstype option determines the JavaScript type used for values of the
  578. // field. The option is permitted only for 64 bit integral and fixed types
  579. // (int64, uint64, sint64, fixed64, sfixed64). By default these types are
  580. // represented as JavaScript strings. This avoids loss of precision that can
  581. // happen when a large value is converted to a floating point JavaScript
  582. // numbers. Specifying JS_NUMBER for the jstype causes the generated
  583. // JavaScript code to use the JavaScript "number" type instead of strings.
  584. // This option is an enum to permit additional types to be added,
  585. // e.g. goog.math.Integer.
  586. @property(nonatomic, readwrite) BOOL hasJstype;
  587. @property(nonatomic, readwrite) GPBFieldOptions_JSType jstype;
  588. // Should this field be parsed lazily? Lazy applies only to message-type
  589. // fields. It means that when the outer message is initially parsed, the
  590. // inner message's contents will not be parsed but instead stored in encoded
  591. // form. The inner message will actually be parsed when it is first accessed.
  592. //
  593. // This is only a hint. Implementations are free to choose whether to use
  594. // eager or lazy parsing regardless of the value of this option. However,
  595. // setting this option true suggests that the protocol author believes that
  596. // using lazy parsing on this field is worth the additional bookkeeping
  597. // overhead typically needed to implement it.
  598. //
  599. // This option does not affect the public interface of any generated code;
  600. // all method signatures remain the same. Furthermore, thread-safety of the
  601. // interface is not affected by this option; const methods remain safe to
  602. // call from multiple threads concurrently, while non-const methods continue
  603. // to require exclusive access.
  604. //
  605. //
  606. // Note that implementations may choose not to check required fields within
  607. // a lazy sub-message. That is, calling IsInitialized() on the outher message
  608. // may return true even if the inner message has missing required fields.
  609. // This is necessary because otherwise the inner message would have to be
  610. // parsed in order to perform the check, defeating the purpose of lazy
  611. // parsing. An implementation which chooses not to check required fields
  612. // must be consistent about it. That is, for any particular sub-message, the
  613. // implementation must either *always* check its required fields, or *never*
  614. // check its required fields, regardless of whether or not the message has
  615. // been parsed.
  616. @property(nonatomic, readwrite) BOOL hasLazy;
  617. @property(nonatomic, readwrite) BOOL lazy;
  618. // Is this field deprecated?
  619. // Depending on the target platform, this can emit Deprecated annotations
  620. // for accessors, or it will be completely ignored; in the very least, this
  621. // is a formalization for deprecating fields.
  622. @property(nonatomic, readwrite) BOOL hasDeprecated;
  623. @property(nonatomic, readwrite) BOOL deprecated;
  624. // For Google-internal migration only. Do not use.
  625. @property(nonatomic, readwrite) BOOL hasWeak;
  626. @property(nonatomic, readwrite) BOOL weak;
  627. // The parser stores options it doesn't recognize here. See above.
  628. // |uninterpretedOptionArray| contains |GPBUninterpretedOption|
  629. @property(nonatomic, readwrite, strong, null_resettable) NSMutableArray *uninterpretedOptionArray;
  630. @property(nonatomic, readonly) NSUInteger uninterpretedOptionArray_Count;
  631. @end
  632. #pragma mark - GPBEnumOptions
  633. typedef GPB_ENUM(GPBEnumOptions_FieldNumber) {
  634. GPBEnumOptions_FieldNumber_AllowAlias = 2,
  635. GPBEnumOptions_FieldNumber_Deprecated = 3,
  636. GPBEnumOptions_FieldNumber_UninterpretedOptionArray = 999,
  637. };
  638. @interface GPBEnumOptions : GPBMessage
  639. // Set this option to true to allow mapping different tag names to the same
  640. // value.
  641. @property(nonatomic, readwrite) BOOL hasAllowAlias;
  642. @property(nonatomic, readwrite) BOOL allowAlias;
  643. // Is this enum deprecated?
  644. // Depending on the target platform, this can emit Deprecated annotations
  645. // for the enum, or it will be completely ignored; in the very least, this
  646. // is a formalization for deprecating enums.
  647. @property(nonatomic, readwrite) BOOL hasDeprecated;
  648. @property(nonatomic, readwrite) BOOL deprecated;
  649. // The parser stores options it doesn't recognize here. See above.
  650. // |uninterpretedOptionArray| contains |GPBUninterpretedOption|
  651. @property(nonatomic, readwrite, strong, null_resettable) NSMutableArray *uninterpretedOptionArray;
  652. @property(nonatomic, readonly) NSUInteger uninterpretedOptionArray_Count;
  653. @end
  654. #pragma mark - GPBEnumValueOptions
  655. typedef GPB_ENUM(GPBEnumValueOptions_FieldNumber) {
  656. GPBEnumValueOptions_FieldNumber_Deprecated = 1,
  657. GPBEnumValueOptions_FieldNumber_UninterpretedOptionArray = 999,
  658. };
  659. @interface GPBEnumValueOptions : GPBMessage
  660. // Is this enum value deprecated?
  661. // Depending on the target platform, this can emit Deprecated annotations
  662. // for the enum value, or it will be completely ignored; in the very least,
  663. // this is a formalization for deprecating enum values.
  664. @property(nonatomic, readwrite) BOOL hasDeprecated;
  665. @property(nonatomic, readwrite) BOOL deprecated;
  666. // The parser stores options it doesn't recognize here. See above.
  667. // |uninterpretedOptionArray| contains |GPBUninterpretedOption|
  668. @property(nonatomic, readwrite, strong, null_resettable) NSMutableArray *uninterpretedOptionArray;
  669. @property(nonatomic, readonly) NSUInteger uninterpretedOptionArray_Count;
  670. @end
  671. #pragma mark - GPBServiceOptions
  672. typedef GPB_ENUM(GPBServiceOptions_FieldNumber) {
  673. GPBServiceOptions_FieldNumber_Deprecated = 33,
  674. GPBServiceOptions_FieldNumber_UninterpretedOptionArray = 999,
  675. };
  676. @interface GPBServiceOptions : GPBMessage
  677. // Is this service deprecated?
  678. // Depending on the target platform, this can emit Deprecated annotations
  679. // for the service, or it will be completely ignored; in the very least,
  680. // this is a formalization for deprecating services.
  681. @property(nonatomic, readwrite) BOOL hasDeprecated;
  682. @property(nonatomic, readwrite) BOOL deprecated;
  683. // The parser stores options it doesn't recognize here. See above.
  684. // |uninterpretedOptionArray| contains |GPBUninterpretedOption|
  685. @property(nonatomic, readwrite, strong, null_resettable) NSMutableArray *uninterpretedOptionArray;
  686. @property(nonatomic, readonly) NSUInteger uninterpretedOptionArray_Count;
  687. @end
  688. #pragma mark - GPBMethodOptions
  689. typedef GPB_ENUM(GPBMethodOptions_FieldNumber) {
  690. GPBMethodOptions_FieldNumber_Deprecated = 33,
  691. GPBMethodOptions_FieldNumber_UninterpretedOptionArray = 999,
  692. };
  693. @interface GPBMethodOptions : GPBMessage
  694. // Is this method deprecated?
  695. // Depending on the target platform, this can emit Deprecated annotations
  696. // for the method, or it will be completely ignored; in the very least,
  697. // this is a formalization for deprecating methods.
  698. @property(nonatomic, readwrite) BOOL hasDeprecated;
  699. @property(nonatomic, readwrite) BOOL deprecated;
  700. // The parser stores options it doesn't recognize here. See above.
  701. // |uninterpretedOptionArray| contains |GPBUninterpretedOption|
  702. @property(nonatomic, readwrite, strong, null_resettable) NSMutableArray *uninterpretedOptionArray;
  703. @property(nonatomic, readonly) NSUInteger uninterpretedOptionArray_Count;
  704. @end
  705. #pragma mark - GPBUninterpretedOption
  706. typedef GPB_ENUM(GPBUninterpretedOption_FieldNumber) {
  707. GPBUninterpretedOption_FieldNumber_NameArray = 2,
  708. GPBUninterpretedOption_FieldNumber_IdentifierValue = 3,
  709. GPBUninterpretedOption_FieldNumber_PositiveIntValue = 4,
  710. GPBUninterpretedOption_FieldNumber_NegativeIntValue = 5,
  711. GPBUninterpretedOption_FieldNumber_DoubleValue = 6,
  712. GPBUninterpretedOption_FieldNumber_StringValue = 7,
  713. GPBUninterpretedOption_FieldNumber_AggregateValue = 8,
  714. };
  715. // A message representing a option the parser does not recognize. This only
  716. // appears in options protos created by the compiler::Parser class.
  717. // DescriptorPool resolves these when building Descriptor objects. Therefore,
  718. // options protos in descriptor objects (e.g. returned by Descriptor::options(),
  719. // or produced by Descriptor::CopyTo()) will never have UninterpretedOptions
  720. // in them.
  721. @interface GPBUninterpretedOption : GPBMessage
  722. // |nameArray| contains |GPBUninterpretedOption_NamePart|
  723. @property(nonatomic, readwrite, strong, null_resettable) NSMutableArray *nameArray;
  724. @property(nonatomic, readonly) NSUInteger nameArray_Count;
  725. // The value of the uninterpreted option, in whatever type the tokenizer
  726. // identified it as during parsing. Exactly one of these should be set.
  727. @property(nonatomic, readwrite) BOOL hasIdentifierValue;
  728. @property(nonatomic, readwrite, copy, null_resettable) NSString *identifierValue;
  729. @property(nonatomic, readwrite) BOOL hasPositiveIntValue;
  730. @property(nonatomic, readwrite) uint64_t positiveIntValue;
  731. @property(nonatomic, readwrite) BOOL hasNegativeIntValue;
  732. @property(nonatomic, readwrite) int64_t negativeIntValue;
  733. @property(nonatomic, readwrite) BOOL hasDoubleValue;
  734. @property(nonatomic, readwrite) double doubleValue;
  735. @property(nonatomic, readwrite) BOOL hasStringValue;
  736. @property(nonatomic, readwrite, copy, null_resettable) NSData *stringValue;
  737. @property(nonatomic, readwrite) BOOL hasAggregateValue;
  738. @property(nonatomic, readwrite, copy, null_resettable) NSString *aggregateValue;
  739. @end
  740. #pragma mark - GPBUninterpretedOption_NamePart
  741. typedef GPB_ENUM(GPBUninterpretedOption_NamePart_FieldNumber) {
  742. GPBUninterpretedOption_NamePart_FieldNumber_NamePart = 1,
  743. GPBUninterpretedOption_NamePart_FieldNumber_IsExtension = 2,
  744. };
  745. // The name of the uninterpreted option. Each string represents a segment in
  746. // a dot-separated name. is_extension is true iff a segment represents an
  747. // extension (denoted with parentheses in options specs in .proto files).
  748. // E.g.,{ ["foo", false], ["bar.baz", true], ["qux", false] } represents
  749. // "foo.(bar.baz).qux".
  750. @interface GPBUninterpretedOption_NamePart : GPBMessage
  751. @property(nonatomic, readwrite) BOOL hasNamePart;
  752. @property(nonatomic, readwrite, copy, null_resettable) NSString *namePart;
  753. @property(nonatomic, readwrite) BOOL hasIsExtension;
  754. @property(nonatomic, readwrite) BOOL isExtension;
  755. @end
  756. #pragma mark - GPBSourceCodeInfo
  757. typedef GPB_ENUM(GPBSourceCodeInfo_FieldNumber) {
  758. GPBSourceCodeInfo_FieldNumber_LocationArray = 1,
  759. };
  760. // Encapsulates information about the original source file from which a
  761. // FileDescriptorProto was generated.
  762. @interface GPBSourceCodeInfo : GPBMessage
  763. // A Location identifies a piece of source code in a .proto file which
  764. // corresponds to a particular definition. This information is intended
  765. // to be useful to IDEs, code indexers, documentation generators, and similar
  766. // tools.
  767. //
  768. // For example, say we have a file like:
  769. // message Foo {
  770. // optional string foo = 1;
  771. // }
  772. // Let's look at just the field definition:
  773. // optional string foo = 1;
  774. // ^ ^^ ^^ ^ ^^^
  775. // a bc de f ghi
  776. // We have the following locations:
  777. // span path represents
  778. // [a,i) [ 4, 0, 2, 0 ] The whole field definition.
  779. // [a,b) [ 4, 0, 2, 0, 4 ] The label (optional).
  780. // [c,d) [ 4, 0, 2, 0, 5 ] The type (string).
  781. // [e,f) [ 4, 0, 2, 0, 1 ] The name (foo).
  782. // [g,h) [ 4, 0, 2, 0, 3 ] The number (1).
  783. //
  784. // Notes:
  785. // - A location may refer to a repeated field itself (i.e. not to any
  786. // particular index within it). This is used whenever a set of elements are
  787. // logically enclosed in a single code segment. For example, an entire
  788. // extend block (possibly containing multiple extension definitions) will
  789. // have an outer location whose path refers to the "extensions" repeated
  790. // field without an index.
  791. // - Multiple locations may have the same path. This happens when a single
  792. // logical declaration is spread out across multiple places. The most
  793. // obvious example is the "extend" block again -- there may be multiple
  794. // extend blocks in the same scope, each of which will have the same path.
  795. // - A location's span is not always a subset of its parent's span. For
  796. // example, the "extendee" of an extension declaration appears at the
  797. // beginning of the "extend" block and is shared by all extensions within
  798. // the block.
  799. // - Just because a location's span is a subset of some other location's span
  800. // does not mean that it is a descendent. For example, a "group" defines
  801. // both a type and a field in a single declaration. Thus, the locations
  802. // corresponding to the type and field and their components will overlap.
  803. // - Code which tries to interpret locations should probably be designed to
  804. // ignore those that it doesn't understand, as more types of locations could
  805. // be recorded in the future.
  806. // |locationArray| contains |GPBSourceCodeInfo_Location|
  807. @property(nonatomic, readwrite, strong, null_resettable) NSMutableArray *locationArray;
  808. @property(nonatomic, readonly) NSUInteger locationArray_Count;
  809. @end
  810. #pragma mark - GPBSourceCodeInfo_Location
  811. typedef GPB_ENUM(GPBSourceCodeInfo_Location_FieldNumber) {
  812. GPBSourceCodeInfo_Location_FieldNumber_PathArray = 1,
  813. GPBSourceCodeInfo_Location_FieldNumber_SpanArray = 2,
  814. GPBSourceCodeInfo_Location_FieldNumber_LeadingComments = 3,
  815. GPBSourceCodeInfo_Location_FieldNumber_TrailingComments = 4,
  816. GPBSourceCodeInfo_Location_FieldNumber_LeadingDetachedCommentsArray = 6,
  817. };
  818. @interface GPBSourceCodeInfo_Location : GPBMessage
  819. // Identifies which part of the FileDescriptorProto was defined at this
  820. // location.
  821. //
  822. // Each element is a field number or an index. They form a path from
  823. // the root FileDescriptorProto to the place where the definition. For
  824. // example, this path:
  825. // [ 4, 3, 2, 7, 1 ]
  826. // refers to:
  827. // file.message_type(3) // 4, 3
  828. // .field(7) // 2, 7
  829. // .name() // 1
  830. // This is because FileDescriptorProto.message_type has field number 4:
  831. // repeated DescriptorProto message_type = 4;
  832. // and DescriptorProto.field has field number 2:
  833. // repeated FieldDescriptorProto field = 2;
  834. // and FieldDescriptorProto.name has field number 1:
  835. // optional string name = 1;
  836. //
  837. // Thus, the above path gives the location of a field name. If we removed
  838. // the last element:
  839. // [ 4, 3, 2, 7 ]
  840. // this path refers to the whole field declaration (from the beginning
  841. // of the label to the terminating semicolon).
  842. @property(nonatomic, readwrite, strong, null_resettable) GPBInt32Array *pathArray;
  843. @property(nonatomic, readonly) NSUInteger pathArray_Count;
  844. // Always has exactly three or four elements: start line, start column,
  845. // end line (optional, otherwise assumed same as start line), end column.
  846. // These are packed into a single field for efficiency. Note that line
  847. // and column numbers are zero-based -- typically you will want to add
  848. // 1 to each before displaying to a user.
  849. @property(nonatomic, readwrite, strong, null_resettable) GPBInt32Array *spanArray;
  850. @property(nonatomic, readonly) NSUInteger spanArray_Count;
  851. // If this SourceCodeInfo represents a complete declaration, these are any
  852. // comments appearing before and after the declaration which appear to be
  853. // attached to the declaration.
  854. //
  855. // A series of line comments appearing on consecutive lines, with no other
  856. // tokens appearing on those lines, will be treated as a single comment.
  857. //
  858. // leading_detached_comments will keep paragraphs of comments that appear
  859. // before (but not connected to) the current element. Each paragraph,
  860. // separated by empty lines, will be one comment element in the repeated
  861. // field.
  862. //
  863. // Only the comment content is provided; comment markers (e.g. //) are
  864. // stripped out. For block comments, leading whitespace and an asterisk
  865. // will be stripped from the beginning of each line other than the first.
  866. // Newlines are included in the output.
  867. //
  868. // Examples:
  869. //
  870. // optional int32 foo = 1; // Comment attached to foo.
  871. // // Comment attached to bar.
  872. // optional int32 bar = 2;
  873. //
  874. // optional string baz = 3;
  875. // // Comment attached to baz.
  876. // // Another line attached to baz.
  877. //
  878. // // Comment attached to qux.
  879. // //
  880. // // Another line attached to qux.
  881. // optional double qux = 4;
  882. //
  883. // // Detached comment for corge. This is not leading or trailing comments
  884. // // to qux or corge because there are blank lines separating it from
  885. // // both.
  886. //
  887. // // Detached comment for corge paragraph 2.
  888. //
  889. // optional string corge = 5;
  890. // /* Block comment attached
  891. // * to corge. Leading asterisks
  892. // * will be removed. */
  893. // /* Block comment attached to
  894. // * grault. */
  895. // optional int32 grault = 6;
  896. //
  897. // // ignored detached comments.
  898. @property(nonatomic, readwrite) BOOL hasLeadingComments;
  899. @property(nonatomic, readwrite, copy, null_resettable) NSString *leadingComments;
  900. @property(nonatomic, readwrite) BOOL hasTrailingComments;
  901. @property(nonatomic, readwrite, copy, null_resettable) NSString *trailingComments;
  902. // |leadingDetachedCommentsArray| contains |NSString|
  903. @property(nonatomic, readwrite, strong, null_resettable) NSMutableArray *leadingDetachedCommentsArray;
  904. @property(nonatomic, readonly) NSUInteger leadingDetachedCommentsArray_Count;
  905. @end
  906. NS_ASSUME_NONNULL_END
  907. CF_EXTERN_C_END
  908. // @@protoc_insertion_point(global_scope)