SourceCodeInfo.php 8.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188
  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 descendent. 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. public function __construct() {
  66. \GPBMetadata\Google\Protobuf\Internal\Descriptor::initOnce();
  67. parent::__construct();
  68. }
  69. /**
  70. * A Location identifies a piece of source code in a .proto file which
  71. * corresponds to a particular definition. This information is intended
  72. * to be useful to IDEs, code indexers, documentation generators, and similar
  73. * tools.
  74. * For example, say we have a file like:
  75. * message Foo {
  76. * optional string foo = 1;
  77. * }
  78. * Let's look at just the field definition:
  79. * optional string foo = 1;
  80. * ^ ^^ ^^ ^ ^^^
  81. * a bc de f ghi
  82. * We have the following locations:
  83. * span path represents
  84. * [a,i) [ 4, 0, 2, 0 ] The whole field definition.
  85. * [a,b) [ 4, 0, 2, 0, 4 ] The label (optional).
  86. * [c,d) [ 4, 0, 2, 0, 5 ] The type (string).
  87. * [e,f) [ 4, 0, 2, 0, 1 ] The name (foo).
  88. * [g,h) [ 4, 0, 2, 0, 3 ] The number (1).
  89. * Notes:
  90. * - A location may refer to a repeated field itself (i.e. not to any
  91. * particular index within it). This is used whenever a set of elements are
  92. * logically enclosed in a single code segment. For example, an entire
  93. * extend block (possibly containing multiple extension definitions) will
  94. * have an outer location whose path refers to the "extensions" repeated
  95. * field without an index.
  96. * - Multiple locations may have the same path. This happens when a single
  97. * logical declaration is spread out across multiple places. The most
  98. * obvious example is the "extend" block again -- there may be multiple
  99. * extend blocks in the same scope, each of which will have the same path.
  100. * - A location's span is not always a subset of its parent's span. For
  101. * example, the "extendee" of an extension declaration appears at the
  102. * beginning of the "extend" block and is shared by all extensions within
  103. * the block.
  104. * - Just because a location's span is a subset of some other location's span
  105. * does not mean that it is a descendent. For example, a "group" defines
  106. * both a type and a field in a single declaration. Thus, the locations
  107. * corresponding to the type and field and their components will overlap.
  108. * - Code which tries to interpret locations should probably be designed to
  109. * ignore those that it doesn't understand, as more types of locations could
  110. * be recorded in the future.
  111. *
  112. * Generated from protobuf field <code>repeated .google.protobuf.SourceCodeInfo.Location location = 1;</code>
  113. * @return \Google\Protobuf\Internal\RepeatedField
  114. */
  115. public function getLocation()
  116. {
  117. return $this->location;
  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 descendent. 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. * @param \Google\Protobuf\Internal\SourceCodeInfo_Location[]|\Google\Protobuf\Internal\RepeatedField $var
  164. * @return $this
  165. */
  166. public function setLocation($var)
  167. {
  168. $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Protobuf\Internal\SourceCodeInfo_Location::class);
  169. $this->location = $arr;
  170. $this->has_location = true;
  171. return $this;
  172. }
  173. public function hasLocation()
  174. {
  175. return $this->has_location;
  176. }
  177. }