SourceCodeInfo.php 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237
  1. <?php
  2. # Generated by the protocol buffer compiler. DO NOT EDIT!
  3. # source: google/protobuf/descriptor.proto
  4. namespace Google\Protobuf\Internal;
  5. use Google\Protobuf\Internal\GPBType;
  6. use Google\Protobuf\Internal\GPBWire;
  7. use Google\Protobuf\Internal\RepeatedField;
  8. use Google\Protobuf\Internal\InputStream;
  9. use Google\Protobuf\Internal\GPBUtil;
  10. /**
  11. * Encapsulates information about the original source file from which a
  12. * FileDescriptorProto was generated.
  13. *
  14. * Generated from protobuf message <code>google.protobuf.SourceCodeInfo</code>
  15. */
  16. class SourceCodeInfo extends \Google\Protobuf\Internal\Message
  17. {
  18. /**
  19. * A Location identifies a piece of source code in a .proto file which
  20. * corresponds to a particular definition. This information is intended
  21. * to be useful to IDEs, code indexers, documentation generators, and similar
  22. * tools.
  23. * For example, say we have a file like:
  24. * message Foo {
  25. * optional string foo = 1;
  26. * }
  27. * Let's look at just the field definition:
  28. * optional string foo = 1;
  29. * ^ ^^ ^^ ^ ^^^
  30. * a bc de f ghi
  31. * We have the following locations:
  32. * span path represents
  33. * [a,i) [ 4, 0, 2, 0 ] The whole field definition.
  34. * [a,b) [ 4, 0, 2, 0, 4 ] The label (optional).
  35. * [c,d) [ 4, 0, 2, 0, 5 ] The type (string).
  36. * [e,f) [ 4, 0, 2, 0, 1 ] The name (foo).
  37. * [g,h) [ 4, 0, 2, 0, 3 ] The number (1).
  38. * Notes:
  39. * - A location may refer to a repeated field itself (i.e. not to any
  40. * particular index within it). This is used whenever a set of elements are
  41. * logically enclosed in a single code segment. For example, an entire
  42. * extend block (possibly containing multiple extension definitions) will
  43. * have an outer location whose path refers to the "extensions" repeated
  44. * field without an index.
  45. * - Multiple locations may have the same path. This happens when a single
  46. * logical declaration is spread out across multiple places. The most
  47. * obvious example is the "extend" block again -- there may be multiple
  48. * extend blocks in the same scope, each of which will have the same path.
  49. * - A location's span is not always a subset of its parent's span. For
  50. * example, the "extendee" of an extension declaration appears at the
  51. * beginning of the "extend" block and is shared by all extensions within
  52. * the block.
  53. * - Just because a location's span is a subset of some other location's span
  54. * does not mean that it is a descendant. For example, a "group" defines
  55. * both a type and a field in a single declaration. Thus, the locations
  56. * corresponding to the type and field and their components will overlap.
  57. * - Code which tries to interpret locations should probably be designed to
  58. * ignore those that it doesn't understand, as more types of locations could
  59. * be recorded in the future.
  60. *
  61. * Generated from protobuf field <code>repeated .google.protobuf.SourceCodeInfo.Location location = 1;</code>
  62. */
  63. private $location;
  64. private $has_location = false;
  65. /**
  66. * Constructor.
  67. *
  68. * @param array $data {
  69. * Optional. Data for populating the Message object.
  70. *
  71. * @type \Google\Protobuf\Internal\SourceCodeInfo\Location[]|\Google\Protobuf\Internal\RepeatedField $location
  72. * A Location identifies a piece of source code in a .proto file which
  73. * corresponds to a particular definition. This information is intended
  74. * to be useful to IDEs, code indexers, documentation generators, and similar
  75. * tools.
  76. * For example, say we have a file like:
  77. * message Foo {
  78. * optional string foo = 1;
  79. * }
  80. * Let's look at just the field definition:
  81. * optional string foo = 1;
  82. * ^ ^^ ^^ ^ ^^^
  83. * a bc de f ghi
  84. * We have the following locations:
  85. * span path represents
  86. * [a,i) [ 4, 0, 2, 0 ] The whole field definition.
  87. * [a,b) [ 4, 0, 2, 0, 4 ] The label (optional).
  88. * [c,d) [ 4, 0, 2, 0, 5 ] The type (string).
  89. * [e,f) [ 4, 0, 2, 0, 1 ] The name (foo).
  90. * [g,h) [ 4, 0, 2, 0, 3 ] The number (1).
  91. * Notes:
  92. * - A location may refer to a repeated field itself (i.e. not to any
  93. * particular index within it). This is used whenever a set of elements are
  94. * logically enclosed in a single code segment. For example, an entire
  95. * extend block (possibly containing multiple extension definitions) will
  96. * have an outer location whose path refers to the "extensions" repeated
  97. * field without an index.
  98. * - Multiple locations may have the same path. This happens when a single
  99. * logical declaration is spread out across multiple places. The most
  100. * obvious example is the "extend" block again -- there may be multiple
  101. * extend blocks in the same scope, each of which will have the same path.
  102. * - A location's span is not always a subset of its parent's span. For
  103. * example, the "extendee" of an extension declaration appears at the
  104. * beginning of the "extend" block and is shared by all extensions within
  105. * the block.
  106. * - Just because a location's span is a subset of some other location's span
  107. * does not mean that it is a descendant. For example, a "group" defines
  108. * both a type and a field in a single declaration. Thus, the locations
  109. * corresponding to the type and field and their components will overlap.
  110. * - Code which tries to interpret locations should probably be designed to
  111. * ignore those that it doesn't understand, as more types of locations could
  112. * be recorded in the future.
  113. * }
  114. */
  115. public function __construct($data = NULL) {
  116. \GPBMetadata\Google\Protobuf\Internal\Descriptor::initOnce();
  117. parent::__construct($data);
  118. }
  119. /**
  120. * A Location identifies a piece of source code in a .proto file which
  121. * corresponds to a particular definition. This information is intended
  122. * to be useful to IDEs, code indexers, documentation generators, and similar
  123. * tools.
  124. * For example, say we have a file like:
  125. * message Foo {
  126. * optional string foo = 1;
  127. * }
  128. * Let's look at just the field definition:
  129. * optional string foo = 1;
  130. * ^ ^^ ^^ ^ ^^^
  131. * a bc de f ghi
  132. * We have the following locations:
  133. * span path represents
  134. * [a,i) [ 4, 0, 2, 0 ] The whole field definition.
  135. * [a,b) [ 4, 0, 2, 0, 4 ] The label (optional).
  136. * [c,d) [ 4, 0, 2, 0, 5 ] The type (string).
  137. * [e,f) [ 4, 0, 2, 0, 1 ] The name (foo).
  138. * [g,h) [ 4, 0, 2, 0, 3 ] The number (1).
  139. * Notes:
  140. * - A location may refer to a repeated field itself (i.e. not to any
  141. * particular index within it). This is used whenever a set of elements are
  142. * logically enclosed in a single code segment. For example, an entire
  143. * extend block (possibly containing multiple extension definitions) will
  144. * have an outer location whose path refers to the "extensions" repeated
  145. * field without an index.
  146. * - Multiple locations may have the same path. This happens when a single
  147. * logical declaration is spread out across multiple places. The most
  148. * obvious example is the "extend" block again -- there may be multiple
  149. * extend blocks in the same scope, each of which will have the same path.
  150. * - A location's span is not always a subset of its parent's span. For
  151. * example, the "extendee" of an extension declaration appears at the
  152. * beginning of the "extend" block and is shared by all extensions within
  153. * the block.
  154. * - Just because a location's span is a subset of some other location's span
  155. * does not mean that it is a descendant. For example, a "group" defines
  156. * both a type and a field in a single declaration. Thus, the locations
  157. * corresponding to the type and field and their components will overlap.
  158. * - Code which tries to interpret locations should probably be designed to
  159. * ignore those that it doesn't understand, as more types of locations could
  160. * be recorded in the future.
  161. *
  162. * Generated from protobuf field <code>repeated .google.protobuf.SourceCodeInfo.Location location = 1;</code>
  163. * @return \Google\Protobuf\Internal\RepeatedField
  164. */
  165. public function getLocation()
  166. {
  167. return $this->location;
  168. }
  169. /**
  170. * A Location identifies a piece of source code in a .proto file which
  171. * corresponds to a particular definition. This information is intended
  172. * to be useful to IDEs, code indexers, documentation generators, and similar
  173. * tools.
  174. * For example, say we have a file like:
  175. * message Foo {
  176. * optional string foo = 1;
  177. * }
  178. * Let's look at just the field definition:
  179. * optional string foo = 1;
  180. * ^ ^^ ^^ ^ ^^^
  181. * a bc de f ghi
  182. * We have the following locations:
  183. * span path represents
  184. * [a,i) [ 4, 0, 2, 0 ] The whole field definition.
  185. * [a,b) [ 4, 0, 2, 0, 4 ] The label (optional).
  186. * [c,d) [ 4, 0, 2, 0, 5 ] The type (string).
  187. * [e,f) [ 4, 0, 2, 0, 1 ] The name (foo).
  188. * [g,h) [ 4, 0, 2, 0, 3 ] The number (1).
  189. * Notes:
  190. * - A location may refer to a repeated field itself (i.e. not to any
  191. * particular index within it). This is used whenever a set of elements are
  192. * logically enclosed in a single code segment. For example, an entire
  193. * extend block (possibly containing multiple extension definitions) will
  194. * have an outer location whose path refers to the "extensions" repeated
  195. * field without an index.
  196. * - Multiple locations may have the same path. This happens when a single
  197. * logical declaration is spread out across multiple places. The most
  198. * obvious example is the "extend" block again -- there may be multiple
  199. * extend blocks in the same scope, each of which will have the same path.
  200. * - A location's span is not always a subset of its parent's span. For
  201. * example, the "extendee" of an extension declaration appears at the
  202. * beginning of the "extend" block and is shared by all extensions within
  203. * the block.
  204. * - Just because a location's span is a subset of some other location's span
  205. * does not mean that it is a descendant. For example, a "group" defines
  206. * both a type and a field in a single declaration. Thus, the locations
  207. * corresponding to the type and field and their components will overlap.
  208. * - Code which tries to interpret locations should probably be designed to
  209. * ignore those that it doesn't understand, as more types of locations could
  210. * be recorded in the future.
  211. *
  212. * Generated from protobuf field <code>repeated .google.protobuf.SourceCodeInfo.Location location = 1;</code>
  213. * @param \Google\Protobuf\Internal\SourceCodeInfo\Location[]|\Google\Protobuf\Internal\RepeatedField $var
  214. * @return $this
  215. */
  216. public function setLocation($var)
  217. {
  218. $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Protobuf\Internal\SourceCodeInfo\Location::class);
  219. $this->location = $arr;
  220. $this->has_location = true;
  221. return $this;
  222. }
  223. public function hasLocation()
  224. {
  225. return $this->has_location;
  226. }
  227. }