diff options
author | Bo Yang <teboring@google.com> | 2017-03-13 17:49:26 -0700 |
---|---|---|
committer | Bo Yang <teboring@google.com> | 2017-03-14 11:31:30 -0700 |
commit | 969ba5ef86a951cb262929cb8a3fa31df6014517 (patch) | |
tree | 40078b87840fff89e5c9e40d5986a9d1649eaa32 /upb/def.h | |
parent | 5a8467842acfbd117ec9231f8231fc33c3304035 (diff) |
Add new file option php_class_prefix.
This option will be prepended to all php generated classes. The PHP
runtime needs to know this option to figure out the class name for
specific message.
Diffstat (limited to 'upb/def.h')
-rw-r--r-- | upb/def.h | 14 |
1 files changed, 14 insertions, 0 deletions
@@ -1298,6 +1298,11 @@ class upb::FileDef { const char* package() const; 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. */ + const char* phpprefix() const; + bool set_phpprefix(const char* phpprefix, Status* s); + /* Syntax for the file. Defaults to proto2. */ upb_syntax_t syntax() const; void set_syntax(upb_syntax_t syntax); @@ -1351,6 +1356,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); 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); @@ -1360,6 +1366,8 @@ const upb_filedef *upb_filedef_dep(const upb_filedef *f, size_t i); bool upb_filedef_freeze(upb_filedef *f, upb_status *s); 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_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, @@ -2118,6 +2126,12 @@ inline const char* FileDef::package() const { inline bool FileDef::set_package(const char* package, Status* s) { return upb_filedef_setpackage(this, package, s); } +inline const char* FileDef::phpprefix() const { + return upb_filedef_phpprefix(this); +} +inline bool FileDef::set_phpprefix(const char* phpprefix, Status* s) { + return upb_filedef_setphpprefix(this, phpprefix, s); +} inline int FileDef::def_count() const { return upb_filedef_defcount(this); } |