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