Go to the documentation of this file.
47 "GPBMetadata/Google/Protobuf/Internal/Descriptor.php";
51 "abstract",
"and",
"array",
"as",
"break",
52 "callable",
"case",
"catch",
"class",
"clone",
53 "const",
"continue",
"declare",
"default",
"die",
54 "do",
"echo",
"else",
"elseif",
"empty",
55 "enddeclare",
"endfor",
"endforeach",
"endif",
"endswitch",
56 "endwhile",
"eval",
"exit",
"extends",
"final",
57 "for",
"foreach",
"function",
"global",
"goto",
58 "if",
"implements",
"include",
"include_once",
"instanceof",
59 "insteadof",
"interface",
"isset",
"list",
"namespace",
60 "new",
"or",
"print",
"private",
"protected",
61 "public",
"require",
"require_once",
"return",
"static",
62 "switch",
"throw",
"trait",
"try",
"unset",
63 "use",
"var",
"while",
"xor",
"int",
64 "float",
"bool",
"string",
"true",
"false",
65 "null",
"void",
"iterable"};
67 "int",
"float",
"bool",
"string",
"true",
68 "false",
"null",
"void",
"iterable",
101 int is_descriptor,
int function_type);
120 string lower = classname;
121 transform(lower.begin(), lower.end(), lower.begin(), ::tolower);
131 if (file->
package() ==
"google.protobuf") {
141 template <
typename DescriptorType>
146 "google.protobuf.internal",
false);
148 return desc->full_name();
152 template <
typename DescriptorType>
154 const DescriptorType*
desc) {
155 const string&
prefix = (
desc->file()->options()).php_class_prefix();
163 template <
typename DescriptorType>
167 while (containing !=
NULL) {
192 template <
typename DescriptorType>
196 while (containing !=
NULL) {
197 classname = containing->
name() +
'_' + classname;
204 string lower = classname;
205 transform(lower.begin(), lower.end(), lower.begin(), ::tolower);
219 string lower = classname;
220 transform(lower.begin(), lower.end(), lower.begin(), ::tolower);
243 template <
typename DescriptorType>
245 if (
desc->file()->options().has_php_namespace()) {
246 const string& php_namespace =
desc->file()->options().php_namespace();
247 if (php_namespace !=
"") {
248 return php_namespace;
253 if (
desc->file()->package() !=
"") {
254 return PhpName(
desc->file()->package(), is_descriptor);
259 template <
typename DescriptorType>
263 if (php_namespace !=
"") {
264 return php_namespace +
"\\" + classname;
269 template <
typename DescriptorType>
273 if (php_namespace !=
"") {
274 return php_namespace +
"\\" + classname;
286 bool cap_next_letter =
true;
287 for (
int i = 0;
i < full_name.size();
i++) {
288 if (
'a' <= full_name[
i] && full_name[
i] <=
'z' && cap_next_letter) {
289 segment += full_name[
i] + (
'A' -
'a');
290 cap_next_letter =
false;
291 }
else if (full_name[
i] ==
'.') {
294 cap_next_letter =
true;
296 segment += full_name[
i];
297 cap_next_letter =
false;
305 switch (
field->type()) {
324 default: assert(
false);
return "";
329 bool is_descriptor) {
330 const string& proto_file = file->
name();
332 int first_index = proto_file.find_first_of(
"/", start_index);
345 int lastindex = proto_file.find_last_of(
".");
349 file_no_suffix = proto_file.substr(0, lastindex);
352 if (file->
options().has_php_metadata_namespace()) {
353 const string& php_metadata_namespace =
355 if (php_metadata_namespace !=
"" && php_metadata_namespace !=
"\\") {
356 result += php_metadata_namespace;
357 std::replace(result.begin(), result.end(),
'\\',
'/');
358 if (result.at(result.size() - 1) !=
'/') {
363 result +=
"GPBMetadata/";
364 while (first_index != string::npos) {
366 file_no_suffix.substr(start_index, first_index - start_index),
true);
368 start_index = first_index + 1;
369 first_index = file_no_suffix.find_first_of(
"/", start_index);
374 int file_name_start = file_no_suffix.find_last_of(
"/");
375 if (file_name_start == string::npos) {
378 file_name_start += 1;
381 file_no_suffix.substr(file_name_start, first_index - file_name_start),
true);
386 template <
typename DescriptorType>
388 bool is_descriptor) {
390 for (
int i = 0;
i < result.size();
i++) {
391 if (result[
i] ==
'\\') {
395 return result +
".php";
398 template <
typename DescriptorType>
400 bool is_descriptor) {
403 for (
int i = 0;
i < result.size();
i++) {
404 if (result[
i] ==
'\\') {
408 return result +
".php";
412 bool is_descriptor) {
414 for (
int i = 0;
i < result.size();
i++) {
415 if (result[
i] ==
'\\') {
419 return result +
".php";
423 std::ostringstream os;
429 switch (
field->label()) {
433 default: assert(
false);
return "";
438 switch (
field->type()) {
457 default: assert(
false);
return "";
462 if (
field->is_map()) {
463 return "array|\\Google\\Protobuf\\Internal\\MapField";
466 switch (
field->type()) {
498 default: assert(
false);
return "";
500 if (
field->is_repeated()) {
502 size_t start_pos =
type.find(
"|");
503 if (start_pos != std::string::npos) {
504 type.replace(start_pos, 1,
"[]|");
506 type +=
"[]|\\Google\\Protobuf\\Internal\\RepeatedField";
512 if (
field->is_map()) {
513 return "\\Google\\Protobuf\\Internal\\MapField";
515 if (
field->is_repeated()) {
516 return "\\Google\\Protobuf\\Internal\\RepeatedField";
518 switch (
field->type()) {
538 default: assert(
false);
return "";
557 for (
int i = 0;
i <
input.size();
i++) {
559 if (cap_first_letter) {
560 result +=
input[
i] + (
'A' -
'a');
564 cap_first_letter =
false;
566 if (
i == 0 && !cap_first_letter) {
569 result +=
input[
i] + (
'a' -
'A');
574 cap_first_letter =
false;
577 cap_first_letter =
true;
579 cap_first_letter =
true;
596 unsigned char symbol[16] = {
604 char* append_ptr = &
dest[0];
606 for (
i = 0;
i <
src.size();
i++) {
607 *append_ptr++ = symbol[(
src[
i] & 0xf0) >> 4];
608 *append_ptr++ = symbol[
src[
i] & 0x0f];
624 bool is_descriptor) {
625 if (
field->is_repeated()) {
628 "private $^name^;\n",
629 "name",
field->name());
630 }
else if (
field->containing_oneof()) {
636 "private $^name^ = ^default^;\n",
637 "name",
field->name(),
643 "private $has_^name^ = false;\n",
644 "name",
field->name());
652 "protected $^name^;\n",
653 "name", oneof->
name());
664 "public function get^camel_name^()\n"
666 " return $this->readOneof(^number^);\n"
673 "public function get^camel_name^()\n"
675 " return $this->^name^;\n"
682 if (!
field->is_map() &&
683 !
field->is_repeated() &&
688 "public function get^camel_name^Unwrapped()\n"
690 " $wrapper = $this->get^camel_name^();\n"
691 " return is_null($wrapper) ? null : $wrapper->getValue();\n"
699 "public function set^camel_name^($var)\n"
706 if (
field->is_map()) {
711 "$arr = GPBUtil::checkMapField($var, "
712 "\\Google\\Protobuf\\Internal\\GPBType::^key_type^, "
713 "\\Google\\Protobuf\\Internal\\GPBType::^value_type^",
718 ", \\^class_name^);\n",
723 ", \\^class_name^);\n",
727 printer->
Print(
");\n");
729 }
else if (
field->is_repeated()) {
731 "$arr = GPBUtil::checkRepeatedField($var, "
732 "\\Google\\Protobuf\\Internal\\GPBType::^type^",
736 ", \\^class_name^);\n",
741 ", \\^class_name^);\n",
745 printer->
Print(
");\n");
749 "GPBUtil::checkMessage($var, \\^class_name^::class);\n",
753 "GPBUtil::checkEnum($var, \\^class_name^::class);\n",
757 "GPBUtil::checkString($var, ^utf8^);\n",
762 "GPBUtil::check^type^($var);\n",
768 "$this->writeOneof(^number^, $var);\n",
770 }
else if (
field->is_repeated()) {
772 "$this->^name^ = $arr;\n",
773 "name",
field->name());
776 "$this->^name^ = $var;\n",
777 "name",
field->name());
783 "$this->has_^field_name^ = true;\n",
784 "field_name",
field->name());
787 printer->
Print(
"\nreturn $this;\n");
795 if (!
field->is_map() &&
796 !
field->is_repeated() &&
801 "public function set^camel_name^Unwrapped($var)\n"
803 " $wrappedVar = is_null($var) ? null : new \\^wrapper_type^(['value' => $var]);\n"
804 " return $this->set^camel_name^($wrappedVar);\n"
813 "public function has^camel_name^()\n"
815 " return $this->has_^field_name^;\n"
818 "field_name",
field->name());
824 "$pool->addEnum('^name^', "
825 "\\Google\\Protobuf\\Internal\\^class_name^::class)\n",
827 "class_name", en->
name());
833 "->value(\"^name^\", ^number^)\n",
837 printer->
Print(
"->finalizeToPool();\n\n");
844 "public function ^camel_name^(\\^request_name^ $request);\n\n",
847 method->input_type(),
false)
855 if (
message->options().map_entry()) {
858 string class_name = (name_prefix.empty() ?
"" : name_prefix +
"\\") +
862 "$pool->addMessage('^message^', "
863 "\\Google\\Protobuf\\Internal\\^class_name^::class)\n",
865 "class_name", class_name);
869 for (
int i = 0;
i <
message->field_count();
i++) {
871 if (
field->is_map()) {
873 field->message_type()->FindFieldByName(
"key");
875 field->message_type()->FindFieldByName(
"value");
877 "->map('^field^', \\Google\\Protobuf\\Internal\\GPBType::^key^, "
878 "\\Google\\Protobuf\\Internal\\GPBType::^value^, ^number^^other^)\n",
879 "field",
field->name(),
884 }
else if (!
field->containing_oneof()) {
886 "->^label^('^field^', "
887 "\\Google\\Protobuf\\Internal\\GPBType::^type^, ^number^^other^)\n",
888 "field",
field->name(),
897 for (
int i = 0;
i <
message->oneof_decl_count();
i++) {
899 printer->
Print(
"->oneof(^name^)\n",
900 "name", oneof->
name());
905 "->value('^field^', "
906 "\\Google\\Protobuf\\Internal\\GPBType::^type^, ^number^^other^)\n",
907 "field",
field->name(),
912 printer->
Print(
"->finish()\n");
917 "->finalizeToPool();\n");
924 for (
int i = 0;
i <
message->nested_type_count();
i++) {
927 for (
int i = 0;
i <
message->enum_type_count();
i++) {
935 "public static $is_initialized = false;\n\n"
936 "public static function initOnce() {\n");
940 "$pool = \\Google\\Protobuf\\Internal\\"
941 "DescriptorPool::getGeneratedPool();\n\n"
942 "if (static::$is_initialized == true) {\n"
955 "$pool->finish();\n");
968 "\\^name^::initOnce();\n",
980 it != dependency->
end(); ++
it) {
993 it->clear_extension();
997 files.SerializeToString(&files_data);
999 printer->
Print(
"$pool->internalAddGeneratedFile(hex2bin(\n");
1003 static const int kBytesPerLine = 30;
1004 for (
int i = 0;
i < files_data.size();
i += kBytesPerLine) {
1006 "\"^data^\"^dot^\n",
1007 "data",
BinaryToHex(files_data.substr(
i, kBytesPerLine)),
1008 "dot",
i + kBytesPerLine < files_data.size() ?
" ." :
"");
1016 "static::$is_initialized = true;\n");
1018 printer->
Print(
"}\n");
1022 if (!is_descriptor) {
1024 "use Google\\Protobuf\\Internal\\GPBType;\n"
1025 "use Google\\Protobuf\\Internal\\RepeatedField;\n"
1026 "use Google\\Protobuf\\Internal\\GPBUtil;\n\n");
1029 "use Google\\Protobuf\\Internal\\GPBType;\n"
1030 "use Google\\Protobuf\\Internal\\GPBWire;\n"
1031 "use Google\\Protobuf\\Internal\\RepeatedField;\n"
1032 "use Google\\Protobuf\\Internal\\InputStream;\n"
1033 "use Google\\Protobuf\\Internal\\GPBUtil;\n\n");
1040 "# Generated by the protocol buffer compiler. DO NOT EDIT!\n"
1041 "# source: ^filename^\n"
1043 "filename", file->
name());
1047 int lastindex = filename.find_last_of(
".");
1048 std::string result = filename.substr(0, lastindex);
1049 for (
int i = 0;
i < result.size();
i++) {
1050 if (result[
i] ==
'/') {
1061 std::unique_ptr<io::ZeroCopyOutputStream>
output(
1062 generator_context->
Open(filename));
1068 int lastindex = fullname.find_last_of(
"\\");
1070 if (lastindex != string::npos) {
1072 "namespace ^name^;\n\n",
1073 "name", fullname.substr(0, lastindex));
1078 "name", fullname.substr(lastindex + 1));
1090 printer.
Print(
"}\n\n");
1093 template <
typename DescriptorType>
1099 std::unique_ptr<io::ZeroCopyOutputStream>
output(
1100 generator_context->
Open(filename));
1106 if (php_namespace !=
"") {
1108 "namespace ^name^;\n\n",
1109 "name", php_namespace);
1112 printer.
Print(
"if (false) {\n");
1114 printer.
Print(
"/**\n");
1115 printer.
Print(
" * This class is deprecated. Use ^new^ instead.\n",
1117 printer.
Print(
" * @deprecated\n");
1118 printer.
Print(
" */\n");
1119 printer.
Print(
"class ^old^ {}\n",
1122 printer.
Print(
"}\n");
1123 printer.
Print(
"class_exists(^new^::class);\n",
1125 printer.
Print(
"@trigger_error('^old^ is deprecated and will be removed in "
1126 "the next major release. Use ^fullname^ instead', E_USER_DEPRECATED);\n\n",
1128 "fullname", newname);
1134 std::unique_ptr<io::ZeroCopyOutputStream>
output(
1135 generator_context->
Open(filename));
1141 int lastindex = fullname.find_last_of(
"\\");
1143 if (lastindex != string::npos) {
1145 "namespace ^name^;\n\n",
1146 "name", fullname.substr(0, lastindex));
1150 printer.
Print(
"use UnexpectedValueException;\n\n");
1155 if (lastindex != string::npos) {
1156 fullname = fullname.substr(lastindex + 1);
1168 printer.
Print(
"const ^name^ = ^number^;\n",
1173 printer.
Print(
"\nprivate static $valueToName = [\n");
1177 printer.
Print(
"self::^name^ => '^name^',\n",
1181 printer.
Print(
"];\n");
1184 "\npublic static function name($value)\n"
1187 printer.
Print(
"if (!isset(self::$valueToName[$value])) {\n");
1189 printer.
Print(
"throw new UnexpectedValueException(sprintf(\n");
1192 printer.
Print(
"'Enum %s has no name defined for value %s', __CLASS__, $value));\n");
1197 "return self::$valueToName[$value];\n");
1199 printer.
Print(
"}\n\n");
1202 "\npublic static function value($name)\n"
1205 printer.
Print(
"$const = __CLASS__ . '::' . strtoupper($name);\n"
1206 "if (!defined($const)) {\n");
1208 printer.
Print(
"throw new UnexpectedValueException(sprintf(\n");
1211 printer.
Print(
"'Enum %s has no value defined for name %s', __CLASS__, $name));\n");
1216 "return constant($const);\n");
1218 printer.
Print(
"}\n");
1221 printer.
Print(
"}\n\n");
1226 "// Adding a class alias for backwards compatibility with the previous class name.\n");
1228 "class_alias(^new^::class, \\^old^::class);\n\n",
1240 if (
message->options().map_entry()) {
1245 std::unique_ptr<io::ZeroCopyOutputStream>
output(
1246 generator_context->
Open(filename));
1252 int lastindex = fullname.find_last_of(
"\\");
1254 if (lastindex != string::npos) {
1256 "namespace ^name^;\n\n",
1257 "name", fullname.substr(0, lastindex));
1263 if (lastindex != string::npos) {
1264 fullname = fullname.substr(lastindex + 1);
1268 "class ^name^ extends \\Google\\Protobuf\\Internal\\Message\n"
1274 for (
int i = 0;
i <
message->field_count();
i++) {
1278 for (
int i = 0;
i <
message->oneof_decl_count();
i++) {
1282 printer.
Print(
"\n");
1286 "public function __construct($data = NULL) {\n");
1293 "\\^fullname^::initOnce();\n"
1294 "parent::__construct($data);\n",
1295 "fullname", metadata_fullname);
1298 printer.
Print(
"}\n\n");
1301 for (
int i = 0;
i <
message->field_count();
i++) {
1305 for (
int i = 0;
i <
message->oneof_decl_count();
i++) {
1309 " * @return string\n"
1311 "public function get^camel_name^()\n"
1313 " return $this->whichOneof(\"^name^\");\n"
1320 printer.
Print(
"}\n\n");
1325 "// Adding a class alias for backwards compatibility with the previous class name.\n");
1327 "class_alias(^new^::class, \\^old^::class);\n\n",
1334 for (
int i = 0;
i <
message->nested_type_count();
i++) {
1338 for (
int i = 0;
i <
message->enum_type_count();
i++) {
1348 std::unique_ptr<io::ZeroCopyOutputStream>
output(
1349 generator_context->
Open(filename));
1355 int lastindex = fullname.find_last_of(
"\\");
1358 (!file->
options().has_php_namespace() && !file->
package().empty()) ||
1359 lastindex != string::npos) {
1361 "namespace ^name^;\n\n",
1362 "name", fullname.substr(0, lastindex));
1367 if (lastindex != string::npos) {
1369 "interface ^name^\n"
1371 "name", fullname.substr(lastindex + 1));
1374 "interface ^name^\n"
1388 printer.
Print(
"}\n\n");
1412 result.reserve(
input.size() * 2);
1416 for (string::size_type
i = 0;
i <
input.size();
i++) {
1422 result.append(
"*");
1424 result.push_back(c);
1430 result.append(
"/");
1432 result.push_back(c);
1439 result.append(
"@");
1442 result.push_back(c);
1455 string comments =
location.leading_comments.empty() ?
1457 if (!comments.empty()) {
1466 std::vector<string> lines =
Split(comments,
"\n");
1467 while (!lines.empty() && lines.back().empty()) {
1471 for (
int i = 0;
i < lines.size();
i++) {
1475 if (indentCount == 0 && !lines[
i].empty() && lines[
i][0] ==
'/') {
1476 printer->
Print(
" * ^line^\n",
"line", lines[
i]);
1479 printer->
Print(
" *^ind^^line^\n",
"ind",
indent,
"line", lines[
i]);
1482 if (trailingNewline) {
1483 printer->
Print(
" *\n");
1488 template <
typename DescriptorType>
1498 string result =
value;
1500 string::size_type pos = result.find_first_of(
'\n');
1501 if (pos != string::npos) {
1510 printer->
Print(
"/**\n");
1513 " * Generated from protobuf message <code>^messagename^</code>\n"
1521 int is_descriptor) {
1530 printer->
Print(
"/**\n");
1531 printer->
Print(
" * Constructor.\n");
1532 printer->
Print(
" *\n");
1533 printer->
Print(
" * @param array $data {\n");
1534 printer->
Print(
" * Optional. Data for populating the Message object.\n");
1535 printer->
Print(
" *\n");
1536 for (
int i = 0;
i <
message->field_count();
i++) {
1538 printer->
Print(
" * @type ^php_type^ $^var^\n",
1540 "var",
field->name());
1546 printer->
Print(
" * }\n");
1547 printer->
Print(
" */\n");
1552 printer->
Print(
"/**\n");
1555 " * Protobuf type <code>^fullname^</code>\n"
1561 int is_descriptor,
int function_type) {
1570 printer->
Print(
"/**\n");
1573 " * Generated from protobuf field <code>^def^</code>\n",
1576 printer->
Print(
" * @param ^php_type^ $var\n",
1578 printer->
Print(
" * @return $this\n");
1580 printer->
Print(
" * @return ^php_type^\n",
1583 printer->
Print(
" */\n");
1590 printer->
Print(
"/**\n");
1592 " * Returns the unboxed value from <code>get^camel_name^()</code>\n\n",
1596 " * Generated from protobuf field <code>^def^</code>\n",
1598 printer->
Print(
" * @return ^php_type^|null\n",
1600 printer->
Print(
" */\n");
1607 printer->
Print(
"/**\n");
1609 " * Sets the field by wrapping a primitive type in a ^message_name^ object.\n\n",
1613 " * Generated from protobuf field <code>^def^</code>\n",
1615 printer->
Print(
" * @param ^php_type^|null $var\n",
1617 printer->
Print(
" * @return $this\n");
1618 printer->
Print(
" */\n");
1622 int is_descriptor) {
1623 printer->
Print(
"/**\n");
1626 " * Protobuf type <code>^fullname^</code>\n"
1633 printer->
Print(
"/**\n");
1636 " * Generated from protobuf enum <code>^def^</code>\n"
1643 printer->
Print(
"/**\n");
1646 " * Method <code>^method_name^</code>\n"
1650 " * @param \\^input_type^ $request\n",
1653 " * @return \\^return_type^\n"
1660 string*
error)
const {
1661 bool is_descriptor = parameter ==
"internal";
1665 "Can only generate PHP code for google/protobuf/descriptor.proto.\n";
1671 "Can only generate PHP code for proto3 .proto files.\n"
1672 "Please add 'syntax = \"proto3\";' to the top of your .proto file.\n";
std::string GeneratedClassNameImpl(const DescriptorType *desc)
std::string PhpGetterTypeName(const FieldDescriptor *field, bool is_descriptor)
void Print(const std::map< std::string, std::string > &variables, const char *text)
bool php_generic_services() const
PROTOBUF_NAMESPACE_ID::FileDescriptorProto * add_file()
std::string PhpName(const std::string &full_name, bool is_descriptor)
std::string FilenameToClassname(const string &filename)
GLuint const GLchar * name
void GenerateEnumFile(const FileDescriptor *file, const EnumDescriptor *en, bool is_descriptor, GeneratorContext *generator_context)
std::string GeneratedClassName(const Descriptor *desc)
const Descriptor::ReservedRange value
const EnumDescriptor * enum_type(int index) const
std::string ConstantNamePrefix(const string &classname)
std::string DescriptorFullName(const DescriptorType *desc, bool is_descriptor)
std::string DefaultForField(FieldDescriptor *field)
void GenerateServiceMethodDocComment(io::Printer *printer, const MethodDescriptor *method)
void GenerateFile(const FileDescriptor *file, bool is_descriptor, GeneratorContext *generator_context)
std::string EscapeDollor(const string &to_escape)
string StrCat(const AlphaNum &a, const AlphaNum &b)
static int indent(upb_textprinter *p)
std::string PhpSetterTypeName(const FieldDescriptor *field, bool is_descriptor)
void GenerateFieldDocComment(io::Printer *printer, const FieldDescriptor *field, int is_descriptor, int function_type)
void LegacyGenerateClassFile(const FileDescriptor *file, const DescriptorType *desc, bool is_descriptor, GeneratorContext *generator_context)
void GenerateMessageConstructorDocComment(io::Printer *printer, const Descriptor *message, int is_descriptor)
std::string LegacyFullClassName(const DescriptorType *desc, bool is_descriptor)
const std::string & full_name() const
std::string BinaryToHex(const string &binary)
const std::string kDescriptorDirName
virtual io::ZeroCopyOutputStream * Open(const std::string &filename)=0
void GenerateMetadataFile(const FileDescriptor *file, bool is_descriptor, GeneratorContext *generator_context)
const Descriptor * containing_type() const
const char *const kReservedNames[]
std::string * mutable_dependency(int index)
iterator erase(const_iterator position)
GLsizei const GLchar *const * string
const int kValidConstantNamesSize
const std::string & name() const
void GenerateWrapperFieldSetterDocComment(io::Printer *printer, const FieldDescriptor *field)
void GenerateMessageToPool(const string &name_prefix, const Descriptor *message, io::Printer *printer)
const FieldDescriptor * field(int index) const
int enum_type_count() const
const std::string & name() const
zend_class_entry * message_type
const std::string & package() const
std::string IntToString(int32 value)
std::string LabelForField(FieldDescriptor *field)
std::string GeneratedServiceFileName(const ServiceDescriptor *service, bool is_descriptor)
const std::string kEmptyMetadataFile
void GenerateServiceDocComment(io::Printer *printer, const ServiceDescriptor *service)
void GenerateEnumDocComment(io::Printer *printer, const EnumDescriptor *enum_, int is_descriptor)
void GenerateHead(const FileDescriptor *file, io::Printer *printer)
const std::string & name() const
const ServiceDescriptor * service(int index) const
static const char prefix[]
const EnumValueDescriptor * value(int index) const
void Outdent(io::Printer *printer)
const std::string kEmptyFile
std::string RootPhpNamespace(const DescriptorType *desc, bool is_descriptor)
const FileOptions & options() const
const std::string kDescriptorFile
void Indent(io::Printer *printer)
const FieldDescriptor * field
void GenerateMessageDocComment(io::Printer *printer, const Descriptor *message, int is_descriptor)
void GenerateUseDeclaration(bool is_descriptor, io::Printer *printer)
const SETUP_TEARDOWN_TESTCONTEXT char * key
void CopyTo(FileDescriptorProto *proto) const
static string EscapePhpdoc(const string &input)
std::string EnumOrMessageSuffix(const FieldDescriptor *field, bool is_descriptor)
std::string ClassNamePrefix(const string &classname, const DescriptorType *desc)
PROTOBUF_NAMESPACE_ID::DescriptorProto * mutable_message_type(int index)
void GenerateServiceMethod(const MethodDescriptor *method, io::Printer *printer)
const std::string & name() const
void GenerateMessageFile(const FileDescriptor *file, const Descriptor *message, bool is_descriptor, GeneratorContext *generator_context)
const std::string kDescriptorMetadataFile
void StringReplace(const string &s, const string &oldsub, const string &newsub, bool replace_all, string *res)
const char *const kValidConstantNames[]
const Descriptor * containing_type() const
const Descriptor * message_type(int index) const
virtual bool Generate(const FileDescriptor *file, const string ¶meter, GeneratorContext *generator_context, string *error) const
const std::string & full_name() const
const FieldDescriptor * FindFieldByName(const std::string &name) const
const FileDescriptor * dependency(int index) const
int service_count() const
std::string GeneratedClassFileName(const DescriptorType *desc, bool is_descriptor)
const std::string & name() const
std::vector< string > Split(const string &full, const char *delim, bool skip_empty=true)
static string FirstLineOf(const string &value)
static void GenerateDocCommentBodyForLocation(io::Printer *printer, const SourceLocation &location, bool trailingNewline, int indentCount)
string ToUpper(const string &s)
void GenerateEnumToPool(const EnumDescriptor *en, io::Printer *printer)
const std::string kDescriptorPackageName
void GenerateEnumValueDocComment(io::Printer *printer, const EnumValueDescriptor *value)
std::string TypeName(FieldDescriptor *field)
std::string FullClassName(const DescriptorType *desc, bool is_descriptor)
const std::string & php_metadata_namespace() const
bool IsWrapperType(const FieldDescriptor *descriptor)
const std::string & php_namespace() const
const MethodDescriptor * method(int index) const
void GenerateFieldAccessor(const FieldDescriptor *field, bool is_descriptor, io::Printer *printer)
GLsizei const GLfloat * value
static void GenerateDocCommentBody(io::Printer *printer, const DescriptorType *descriptor)
const GLuint GLenum const GLvoid * binary
const upb_json_parsermethod const upb_symtab upb_sink * output
void GenerateOneofField(const OneofDescriptor *oneof, io::Printer *printer)
const int kReservedNamesSize
std::string GeneratedMetadataFileName(const FileDescriptor *file, bool is_descriptor)
int message_type_count() const
void GenerateField(const FieldDescriptor *field, io::Printer *printer, bool is_descriptor)
GLenum GLuint GLenum GLsizei const GLchar * message
std::string LegacyGeneratedClassFileName(const DescriptorType *desc, bool is_descriptor)
std::string LegacyGeneratedClassName(const DescriptorType *desc)
const Descriptor::ReservedRange const EnumValueDescriptor method
int dependency_count() const
std::string ReservedNamePrefix(const string &classname, const FileDescriptor *file)
void GenerateWrapperFieldGetterDocComment(io::Printer *printer, const FieldDescriptor *field)
void GenerateAddFileToPool(const FileDescriptor *file, bool is_descriptor, io::Printer *printer)
std::string UnderscoresToCamelCase(const string &name, bool cap_first_letter)
static bool is_reserved(const char *segment, int length)
void GenerateServiceFile(const FileDescriptor *file, const ServiceDescriptor *service, bool is_descriptor, GeneratorContext *generator_context)
libaditof
Author(s):
autogenerated on Wed May 21 2025 02:06:57