summaryrefslogtreecommitdiff
path: root/upb/def.h
diff options
context:
space:
mode:
authorBo Yang <teboring@google.com>2017-05-30 15:34:33 -0700
committerBo Yang <teboring@google.com>2017-05-31 14:21:07 -0700
commitf15e6764bd1d27d33b5bbf0f5bc7c23bcc837128 (patch)
treeb9dc70a8db0163dfbaa5a8c53a012fe8810188da /upb/def.h
parent3f3ee548f16a2c6d94c2c9cbe161e5b306269e79 (diff)
Add new file option php_namespace.
Use this option to change the namespace of php generated classes. Default is empty. When this option is empty, the package name will be used for determining the namespace.
Diffstat (limited to 'upb/def.h')
-rw-r--r--upb/def.h17
1 files changed, 16 insertions, 1 deletions
diff --git a/upb/def.h b/upb/def.h
index 29bb3ea..81c553b 100644
--- a/upb/def.h
+++ b/upb/def.h
@@ -1299,10 +1299,16 @@ class upb::FileDef {
bool set_package(const char* package, Status* s);
/* Sets the php class prefix which is prepended to all php generated classes
- / from this .proto. Default is empty. */
+ * from this .proto. Default is empty. */
const char* phpprefix() const;
bool set_phpprefix(const char* phpprefix, Status* s);
+ /* Use this option to change the namespace of php generated classes. Default
+ * is empty. When this option is empty, the package name will be used for
+ * determining the namespace. */
+ const char* phpnamespace() const;
+ bool set_phpnamespace(const char* phpnamespace, Status* s);
+
/* Syntax for the file. Defaults to proto2. */
upb_syntax_t syntax() const;
void set_syntax(upb_syntax_t syntax);
@@ -1357,6 +1363,7 @@ UPB_REFCOUNTED_CMETHODS(upb_filedef, upb_filedef_upcast)
const char *upb_filedef_name(const upb_filedef *f);
const char *upb_filedef_package(const upb_filedef *f);
const char *upb_filedef_phpprefix(const upb_filedef *f);
+const char *upb_filedef_phpnamespace(const upb_filedef *f);
upb_syntax_t upb_filedef_syntax(const upb_filedef *f);
size_t upb_filedef_defcount(const upb_filedef *f);
size_t upb_filedef_depcount(const upb_filedef *f);
@@ -1368,6 +1375,8 @@ bool upb_filedef_setname(upb_filedef *f, const char *name, upb_status *s);
bool upb_filedef_setpackage(upb_filedef *f, const char *package, upb_status *s);
bool upb_filedef_setphpprefix(upb_filedef *f, const char *phpprefix,
upb_status *s);
+bool upb_filedef_setphpnamespace(upb_filedef *f, const char *phpnamespace,
+ upb_status *s);
bool upb_filedef_setsyntax(upb_filedef *f, upb_syntax_t syntax, upb_status *s);
bool upb_filedef_adddef(upb_filedef *f, upb_def *def, const void *ref_donor,
@@ -2132,6 +2141,12 @@ inline const char* FileDef::phpprefix() const {
inline bool FileDef::set_phpprefix(const char* phpprefix, Status* s) {
return upb_filedef_setphpprefix(this, phpprefix, s);
}
+inline const char* FileDef::phpnamespace() const {
+ return upb_filedef_phpnamespace(this);
+}
+inline bool FileDef::set_phpnamespace(const char* phpnamespace, Status* s) {
+ return upb_filedef_setphpnamespace(this, phpnamespace, s);
+}
inline int FileDef::def_count() const {
return upb_filedef_defcount(this);
}
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback