Debian Codegraph @

php/src/Google/Protobuf/Internal/SourceCodeInfo.php

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