summaryrefslogtreecommitdiff
path: root/upb/def.h
diff options
context:
space:
mode:
authorJosh Haberman <jhaberman@gmail.com>2016-04-06 14:28:45 -0700
committerJosh Haberman <jhaberman@gmail.com>2016-04-06 14:28:45 -0700
commitf8c26358f0b87a9c90be3f038cdea5bdcae185a0 (patch)
treea51e3b278d368ebd4fc01b0fff68c8f3f0701299 /upb/def.h
parente9d79d2441732264e2b990a5b2dc76d13724db07 (diff)
Changes for PR comments.
Diffstat (limited to 'upb/def.h')
-rw-r--r--upb/def.h11
1 files changed, 9 insertions, 2 deletions
diff --git a/upb/def.h b/upb/def.h
index 487729a..0fc6f41 100644
--- a/upb/def.h
+++ b/upb/def.h
@@ -921,7 +921,6 @@ bool upb_msgdef_addfield(upb_msgdef *m, upb_fielddef *f, const void *ref_donor,
upb_status *s);
bool upb_msgdef_addoneof(upb_msgdef *m, upb_oneofdef *o, const void *ref_donor,
upb_status *s);
-void upb_msgdef_setprimitiveshavepresence(upb_msgdef *m, bool have_presence);
/* Field lookup in a couple of different variations:
* - itof = int to field
@@ -1153,6 +1152,7 @@ class upb::OneofDef {
* by name once added to a message def. */
const char* name() const;
bool set_name(const char* name, Status* s);
+ bool set_name(const std::string& name, Status* s);
/* Returns the number of fields currently defined in the oneof. */
int field_count() const;
@@ -1306,7 +1306,8 @@ class upb::FileDef {
/* Get/set name of the file (eg. "foo/bar.proto"). */
const char* name() const;
- bool set_name(const char* fullname, Status* s);
+ bool set_name(const char* name, Status* s);
+ bool set_name(const std::string& name, Status* s);
/* Package name for definitions inside the file (eg. "foo.bar"). */
const char* package() const;
@@ -1900,6 +1901,9 @@ inline const char* OneofDef::name() const {
inline bool OneofDef::set_name(const char* name, Status* s) {
return upb_oneofdef_setname(this, name, s);
}
+inline bool OneofDef::set_name(const std::string& name, Status* s) {
+ return upb_oneofdef_setname(this, upb_safecstr(name), s);
+}
inline int OneofDef::field_count() const {
return upb_oneofdef_numfields(this);
}
@@ -1979,6 +1983,9 @@ inline const char* FileDef::name() const {
inline bool FileDef::set_name(const char* name, Status* s) {
return upb_filedef_setname(this, name, s);
}
+inline bool FileDef::set_name(const std::string& name, Status* s) {
+ return upb_filedef_setname(this, upb_safecstr(name), s);
+}
inline const char* FileDef::package() const {
return upb_filedef_package(this);
}
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback