aboutsummaryrefslogtreecommitdiff
path: root/src/google/protobuf/compiler/php/php_generator.h
diff options
context:
space:
mode:
authorPaul Yang <TeBoring@users.noreply.github.com>2017-11-08 15:39:47 -0800
committerGitHub <noreply@github.com>2017-11-08 15:39:47 -0800
commit662e8b20bcc67ff11bd8a8a514484481b7e68839 (patch)
treefbe34c372101d63555089b837eada17fb29a9b42 /src/google/protobuf/compiler/php/php_generator.h
parent1144768dd63effc560a3d64996398d149620b575 (diff)
downloadprotobuf-662e8b20bcc67ff11bd8a8a514484481b7e68839.tar.gz
protobuf-662e8b20bcc67ff11bd8a8a514484481b7e68839.tar.bz2
protobuf-662e8b20bcc67ff11bd8a8a514484481b7e68839.zip
Provide util funtions to figure out correct php class names. (#3850)
Diffstat (limited to 'src/google/protobuf/compiler/php/php_generator.h')
-rw-r--r--src/google/protobuf/compiler/php/php_generator.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/google/protobuf/compiler/php/php_generator.h b/src/google/protobuf/compiler/php/php_generator.h
index ce2b000a..67e70bc7 100644
--- a/src/google/protobuf/compiler/php/php_generator.h
+++ b/src/google/protobuf/compiler/php/php_generator.h
@@ -32,6 +32,7 @@
#define GOOGLE_PROTOBUF_COMPILER_PHP_GENERATOR_H__
#include <google/protobuf/compiler/code_generator.h>
+#include <google/protobuf/descriptor.h>
#include <string>
@@ -47,8 +48,16 @@ class LIBPROTOC_EXPORT Generator
const string& parameter,
GeneratorContext* generator_context,
string* error) const;
+
};
+// To skip reserved keywords in php, some generated classname are prefixed.
+// Other code generators may need following API to figure out the actual
+// classname.
+std::string GeneratedClassName(const google::protobuf::Descriptor* desc);
+std::string GeneratedClassName(const google::protobuf::EnumDescriptor* desc);
+std::string GeneratedClassName(const google::protobuf::ServiceDescriptor* desc);
+
} // namespace php
} // namespace compiler
} // namespace protobuf