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