1<?php
2# Generated by the protocol buffer compiler.  DO NOT EDIT!
3# source: google/protobuf/descriptor.proto
4
5namespace Google\Protobuf\Internal\SourceCodeInfo;
6
7use Google\Protobuf\Internal\GPBType;
8use Google\Protobuf\Internal\GPBWire;
9use Google\Protobuf\Internal\RepeatedField;
10use Google\Protobuf\Internal\InputStream;
11use Google\Protobuf\Internal\GPBUtil;
12
13/**
14 * Generated from protobuf message <code>google.protobuf.SourceCodeInfo.Location</code>
15 */
16class Location extends \Google\Protobuf\Internal\Message
17{
18    /**
19     * Identifies which part of the FileDescriptorProto was defined at this
20     * location.
21     * Each element is a field number or an index.  They form a path from
22     * the root FileDescriptorProto to the place where the definition.  For
23     * example, this path:
24     *   [ 4, 3, 2, 7, 1 ]
25     * refers to:
26     *   file.message_type(3)  // 4, 3
27     *       .field(7)         // 2, 7
28     *       .name()           // 1
29     * This is because FileDescriptorProto.message_type has field number 4:
30     *   repeated DescriptorProto message_type = 4;
31     * and DescriptorProto.field has field number 2:
32     *   repeated FieldDescriptorProto field = 2;
33     * and FieldDescriptorProto.name has field number 1:
34     *   optional string name = 1;
35     * Thus, the above path gives the location of a field name.  If we removed
36     * the last element:
37     *   [ 4, 3, 2, 7 ]
38     * this path refers to the whole field declaration (from the beginning
39     * of the label to the terminating semicolon).
40     *
41     * Generated from protobuf field <code>repeated int32 path = 1 [packed = true];</code>
42     */
43    private $path;
44    private $has_path = false;
45    /**
46     * Always has exactly three or four elements: start line, start column,
47     * end line (optional, otherwise assumed same as start line), end column.
48     * These are packed into a single field for efficiency.  Note that line
49     * and column numbers are zero-based -- typically you will want to add
50     * 1 to each before displaying to a user.
51     *
52     * Generated from protobuf field <code>repeated int32 span = 2 [packed = true];</code>
53     */
54    private $span;
55    private $has_span = false;
56    /**
57     * If this SourceCodeInfo represents a complete declaration, these are any
58     * comments appearing before and after the declaration which appear to be
59     * attached to the declaration.
60     * A series of line comments appearing on consecutive lines, with no other
61     * tokens appearing on those lines, will be treated as a single comment.
62     * leading_detached_comments will keep paragraphs of comments that appear
63     * before (but not connected to) the current element. Each paragraph,
64     * separated by empty lines, will be one comment element in the repeated
65     * field.
66     * Only the comment content is provided; comment markers (e.g. //) are
67     * stripped out.  For block comments, leading whitespace and an asterisk
68     * will be stripped from the beginning of each line other than the first.
69     * Newlines are included in the output.
70     * Examples:
71     *   optional int32 foo = 1;  // Comment attached to foo.
72     *   // Comment attached to bar.
73     *   optional int32 bar = 2;
74     *   optional string baz = 3;
75     *   // Comment attached to baz.
76     *   // Another line attached to baz.
77     *   // Comment attached to qux.
78     *   //
79     *   // Another line attached to qux.
80     *   optional double qux = 4;
81     *   // Detached comment for corge. This is not leading or trailing comments
82     *   // to qux or corge because there are blank lines separating it from
83     *   // both.
84     *   // Detached comment for corge paragraph 2.
85     *   optional string corge = 5;
86     *   /&#42; Block comment attached
87     *    * to corge.  Leading asterisks
88     *    * will be removed. *&#47;
89     *   /&#42; Block comment attached to
90     *    * grault. *&#47;
91     *   optional int32 grault = 6;
92     *   // ignored detached comments.
93     *
94     * Generated from protobuf field <code>optional string leading_comments = 3;</code>
95     */
96    private $leading_comments = '';
97    private $has_leading_comments = false;
98    /**
99     * Generated from protobuf field <code>optional string trailing_comments = 4;</code>
100     */
101    private $trailing_comments = '';
102    private $has_trailing_comments = false;
103    /**
104     * Generated from protobuf field <code>repeated string leading_detached_comments = 6;</code>
105     */
106    private $leading_detached_comments;
107    private $has_leading_detached_comments = false;
108
109    /**
110     * Constructor.
111     *
112     * @param array $data {
113     *     Optional. Data for populating the Message object.
114     *
115     *     @type int[]|\Google\Protobuf\Internal\RepeatedField $path
116     *           Identifies which part of the FileDescriptorProto was defined at this
117     *           location.
118     *           Each element is a field number or an index.  They form a path from
119     *           the root FileDescriptorProto to the place where the definition.  For
120     *           example, this path:
121     *             [ 4, 3, 2, 7, 1 ]
122     *           refers to:
123     *             file.message_type(3)  // 4, 3
124     *                 .field(7)         // 2, 7
125     *                 .name()           // 1
126     *           This is because FileDescriptorProto.message_type has field number 4:
127     *             repeated DescriptorProto message_type = 4;
128     *           and DescriptorProto.field has field number 2:
129     *             repeated FieldDescriptorProto field = 2;
130     *           and FieldDescriptorProto.name has field number 1:
131     *             optional string name = 1;
132     *           Thus, the above path gives the location of a field name.  If we removed
133     *           the last element:
134     *             [ 4, 3, 2, 7 ]
135     *           this path refers to the whole field declaration (from the beginning
136     *           of the label to the terminating semicolon).
137     *     @type int[]|\Google\Protobuf\Internal\RepeatedField $span
138     *           Always has exactly three or four elements: start line, start column,
139     *           end line (optional, otherwise assumed same as start line), end column.
140     *           These are packed into a single field for efficiency.  Note that line
141     *           and column numbers are zero-based -- typically you will want to add
142     *           1 to each before displaying to a user.
143     *     @type string $leading_comments
144     *           If this SourceCodeInfo represents a complete declaration, these are any
145     *           comments appearing before and after the declaration which appear to be
146     *           attached to the declaration.
147     *           A series of line comments appearing on consecutive lines, with no other
148     *           tokens appearing on those lines, will be treated as a single comment.
149     *           leading_detached_comments will keep paragraphs of comments that appear
150     *           before (but not connected to) the current element. Each paragraph,
151     *           separated by empty lines, will be one comment element in the repeated
152     *           field.
153     *           Only the comment content is provided; comment markers (e.g. //) are
154     *           stripped out.  For block comments, leading whitespace and an asterisk
155     *           will be stripped from the beginning of each line other than the first.
156     *           Newlines are included in the output.
157     *           Examples:
158     *             optional int32 foo = 1;  // Comment attached to foo.
159     *             // Comment attached to bar.
160     *             optional int32 bar = 2;
161     *             optional string baz = 3;
162     *             // Comment attached to baz.
163     *             // Another line attached to baz.
164     *             // Comment attached to qux.
165     *             //
166     *             // Another line attached to qux.
167     *             optional double qux = 4;
168     *             // Detached comment for corge. This is not leading or trailing comments
169     *             // to qux or corge because there are blank lines separating it from
170     *             // both.
171     *             // Detached comment for corge paragraph 2.
172     *             optional string corge = 5;
173     *             /&#42; Block comment attached
174     *              * to corge.  Leading asterisks
175     *              * will be removed. *&#47;
176     *             /&#42; Block comment attached to
177     *              * grault. *&#47;
178     *             optional int32 grault = 6;
179     *             // ignored detached comments.
180     *     @type string $trailing_comments
181     *     @type string[]|\Google\Protobuf\Internal\RepeatedField $leading_detached_comments
182     * }
183     */
184    public function __construct($data = NULL) {
185        \GPBMetadata\Google\Protobuf\Internal\Descriptor::initOnce();
186        parent::__construct($data);
187    }
188
189    /**
190     * Identifies which part of the FileDescriptorProto was defined at this
191     * location.
192     * Each element is a field number or an index.  They form a path from
193     * the root FileDescriptorProto to the place where the definition.  For
194     * example, this path:
195     *   [ 4, 3, 2, 7, 1 ]
196     * refers to:
197     *   file.message_type(3)  // 4, 3
198     *       .field(7)         // 2, 7
199     *       .name()           // 1
200     * This is because FileDescriptorProto.message_type has field number 4:
201     *   repeated DescriptorProto message_type = 4;
202     * and DescriptorProto.field has field number 2:
203     *   repeated FieldDescriptorProto field = 2;
204     * and FieldDescriptorProto.name has field number 1:
205     *   optional string name = 1;
206     * Thus, the above path gives the location of a field name.  If we removed
207     * the last element:
208     *   [ 4, 3, 2, 7 ]
209     * this path refers to the whole field declaration (from the beginning
210     * of the label to the terminating semicolon).
211     *
212     * Generated from protobuf field <code>repeated int32 path = 1 [packed = true];</code>
213     * @return \Google\Protobuf\Internal\RepeatedField
214     */
215    public function getPath()
216    {
217        return $this->path;
218    }
219
220    /**
221     * Identifies which part of the FileDescriptorProto was defined at this
222     * location.
223     * Each element is a field number or an index.  They form a path from
224     * the root FileDescriptorProto to the place where the definition.  For
225     * example, this path:
226     *   [ 4, 3, 2, 7, 1 ]
227     * refers to:
228     *   file.message_type(3)  // 4, 3
229     *       .field(7)         // 2, 7
230     *       .name()           // 1
231     * This is because FileDescriptorProto.message_type has field number 4:
232     *   repeated DescriptorProto message_type = 4;
233     * and DescriptorProto.field has field number 2:
234     *   repeated FieldDescriptorProto field = 2;
235     * and FieldDescriptorProto.name has field number 1:
236     *   optional string name = 1;
237     * Thus, the above path gives the location of a field name.  If we removed
238     * the last element:
239     *   [ 4, 3, 2, 7 ]
240     * this path refers to the whole field declaration (from the beginning
241     * of the label to the terminating semicolon).
242     *
243     * Generated from protobuf field <code>repeated int32 path = 1 [packed = true];</code>
244     * @param int[]|\Google\Protobuf\Internal\RepeatedField $var
245     * @return $this
246     */
247    public function setPath($var)
248    {
249        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::INT32);
250        $this->path = $arr;
251        $this->has_path = true;
252
253        return $this;
254    }
255
256    public function hasPath()
257    {
258        return $this->has_path;
259    }
260
261    /**
262     * Always has exactly three or four elements: start line, start column,
263     * end line (optional, otherwise assumed same as start line), end column.
264     * These are packed into a single field for efficiency.  Note that line
265     * and column numbers are zero-based -- typically you will want to add
266     * 1 to each before displaying to a user.
267     *
268     * Generated from protobuf field <code>repeated int32 span = 2 [packed = true];</code>
269     * @return \Google\Protobuf\Internal\RepeatedField
270     */
271    public function getSpan()
272    {
273        return $this->span;
274    }
275
276    /**
277     * Always has exactly three or four elements: start line, start column,
278     * end line (optional, otherwise assumed same as start line), end column.
279     * These are packed into a single field for efficiency.  Note that line
280     * and column numbers are zero-based -- typically you will want to add
281     * 1 to each before displaying to a user.
282     *
283     * Generated from protobuf field <code>repeated int32 span = 2 [packed = true];</code>
284     * @param int[]|\Google\Protobuf\Internal\RepeatedField $var
285     * @return $this
286     */
287    public function setSpan($var)
288    {
289        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::INT32);
290        $this->span = $arr;
291        $this->has_span = true;
292
293        return $this;
294    }
295
296    public function hasSpan()
297    {
298        return $this->has_span;
299    }
300
301    /**
302     * If this SourceCodeInfo represents a complete declaration, these are any
303     * comments appearing before and after the declaration which appear to be
304     * attached to the declaration.
305     * A series of line comments appearing on consecutive lines, with no other
306     * tokens appearing on those lines, will be treated as a single comment.
307     * leading_detached_comments will keep paragraphs of comments that appear
308     * before (but not connected to) the current element. Each paragraph,
309     * separated by empty lines, will be one comment element in the repeated
310     * field.
311     * Only the comment content is provided; comment markers (e.g. //) are
312     * stripped out.  For block comments, leading whitespace and an asterisk
313     * will be stripped from the beginning of each line other than the first.
314     * Newlines are included in the output.
315     * Examples:
316     *   optional int32 foo = 1;  // Comment attached to foo.
317     *   // Comment attached to bar.
318     *   optional int32 bar = 2;
319     *   optional string baz = 3;
320     *   // Comment attached to baz.
321     *   // Another line attached to baz.
322     *   // Comment attached to qux.
323     *   //
324     *   // Another line attached to qux.
325     *   optional double qux = 4;
326     *   // Detached comment for corge. This is not leading or trailing comments
327     *   // to qux or corge because there are blank lines separating it from
328     *   // both.
329     *   // Detached comment for corge paragraph 2.
330     *   optional string corge = 5;
331     *   /&#42; Block comment attached
332     *    * to corge.  Leading asterisks
333     *    * will be removed. *&#47;
334     *   /&#42; Block comment attached to
335     *    * grault. *&#47;
336     *   optional int32 grault = 6;
337     *   // ignored detached comments.
338     *
339     * Generated from protobuf field <code>optional string leading_comments = 3;</code>
340     * @return string
341     */
342    public function getLeadingComments()
343    {
344        return $this->leading_comments;
345    }
346
347    /**
348     * If this SourceCodeInfo represents a complete declaration, these are any
349     * comments appearing before and after the declaration which appear to be
350     * attached to the declaration.
351     * A series of line comments appearing on consecutive lines, with no other
352     * tokens appearing on those lines, will be treated as a single comment.
353     * leading_detached_comments will keep paragraphs of comments that appear
354     * before (but not connected to) the current element. Each paragraph,
355     * separated by empty lines, will be one comment element in the repeated
356     * field.
357     * Only the comment content is provided; comment markers (e.g. //) are
358     * stripped out.  For block comments, leading whitespace and an asterisk
359     * will be stripped from the beginning of each line other than the first.
360     * Newlines are included in the output.
361     * Examples:
362     *   optional int32 foo = 1;  // Comment attached to foo.
363     *   // Comment attached to bar.
364     *   optional int32 bar = 2;
365     *   optional string baz = 3;
366     *   // Comment attached to baz.
367     *   // Another line attached to baz.
368     *   // Comment attached to qux.
369     *   //
370     *   // Another line attached to qux.
371     *   optional double qux = 4;
372     *   // Detached comment for corge. This is not leading or trailing comments
373     *   // to qux or corge because there are blank lines separating it from
374     *   // both.
375     *   // Detached comment for corge paragraph 2.
376     *   optional string corge = 5;
377     *   /&#42; Block comment attached
378     *    * to corge.  Leading asterisks
379     *    * will be removed. *&#47;
380     *   /&#42; Block comment attached to
381     *    * grault. *&#47;
382     *   optional int32 grault = 6;
383     *   // ignored detached comments.
384     *
385     * Generated from protobuf field <code>optional string leading_comments = 3;</code>
386     * @param string $var
387     * @return $this
388     */
389    public function setLeadingComments($var)
390    {
391        GPBUtil::checkString($var, True);
392        $this->leading_comments = $var;
393        $this->has_leading_comments = true;
394
395        return $this;
396    }
397
398    public function hasLeadingComments()
399    {
400        return $this->has_leading_comments;
401    }
402
403    /**
404     * Generated from protobuf field <code>optional string trailing_comments = 4;</code>
405     * @return string
406     */
407    public function getTrailingComments()
408    {
409        return $this->trailing_comments;
410    }
411
412    /**
413     * Generated from protobuf field <code>optional string trailing_comments = 4;</code>
414     * @param string $var
415     * @return $this
416     */
417    public function setTrailingComments($var)
418    {
419        GPBUtil::checkString($var, True);
420        $this->trailing_comments = $var;
421        $this->has_trailing_comments = true;
422
423        return $this;
424    }
425
426    public function hasTrailingComments()
427    {
428        return $this->has_trailing_comments;
429    }
430
431    /**
432     * Generated from protobuf field <code>repeated string leading_detached_comments = 6;</code>
433     * @return \Google\Protobuf\Internal\RepeatedField
434     */
435    public function getLeadingDetachedComments()
436    {
437        return $this->leading_detached_comments;
438    }
439
440    /**
441     * Generated from protobuf field <code>repeated string leading_detached_comments = 6;</code>
442     * @param string[]|\Google\Protobuf\Internal\RepeatedField $var
443     * @return $this
444     */
445    public function setLeadingDetachedComments($var)
446    {
447        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING);
448        $this->leading_detached_comments = $arr;
449        $this->has_leading_detached_comments = true;
450
451        return $this;
452    }
453
454    public function hasLeadingDetachedComments()
455    {
456        return $this->has_leading_detached_comments;
457    }
458
459}
460
461// Adding a class alias for backwards compatibility with the previous class name.
462class_alias(Location::class, \Google\Protobuf\Internal\SourceCodeInfo_Location::class);
463
464