Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
P
protobuf
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
protobuf
Commits
f654d49d
Commit
f654d49d
authored
Feb 18, 2016
by
Josh Haberman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Updated upb from latest changes.
parent
78da6669
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
31 additions
and
9 deletions
+31
-9
upb.c
ruby/ext/google/protobuf_c/upb.c
+0
-0
upb.h
ruby/ext/google/protobuf_c/upb.h
+31
-9
No files found.
ruby/ext/google/protobuf_c/upb.c
View file @
f654d49d
This diff is collapsed.
Click to expand it.
ruby/ext/google/protobuf_c/upb.h
View file @
f654d49d
...
...
@@ -193,13 +193,15 @@
template <> \
class Pointer<cppname> : public PointerBase<cppname, cppbase> { \
public: \
explicit Pointer(cppname* ptr) : PointerBase(ptr) {} \
explicit Pointer(cppname* ptr) \
: PointerBase<cppname, cppbase>(ptr) {} \
}; \
template <> \
class Pointer<const cppname> \
: public PointerBase<const cppname, const cppbase> { \
public: \
explicit Pointer(const cppname* ptr) : PointerBase(ptr) {} \
explicit Pointer(const cppname* ptr) \
: PointerBase<const cppname, const cppbase>(ptr) {} \
}; \
}
...
...
@@ -211,13 +213,15 @@
template <> \
class Pointer<cppname> : public PointerBase2<cppname, cppbase, cppbase2> { \
public: \
explicit Pointer(cppname* ptr) : PointerBase2(ptr) {} \
explicit Pointer(cppname* ptr) \
: PointerBase2<cppname, cppbase, cppbase2>(ptr) {} \
}; \
template <> \
class Pointer<const cppname> \
: public PointerBase2<const cppname, const cppbase, const cppbase2> { \
public: \
explicit Pointer(const cppname* ptr) : PointerBase2(ptr) {} \
explicit Pointer(const cppname* ptr) \
: PointerBase2<const cppname, const cppbase, const cppbase2>(ptr) {} \
}; \
}
...
...
@@ -1537,11 +1541,26 @@ class upb::FieldDef {
uint32_t
number
()
const
;
/* Returns 0 if uninitialized. */
bool
is_extension
()
const
;
/* Get the JSON name for this field. This will copy the JSON name into the
* given buffer, which must have size of at least "strlen(name()) + 1".
* The string will be NULL-terminated. Returns false if uninitialized.
/* Copies the JSON name for this field into the given buffer. Returns the
* actual size of the JSON name, including the NULL terminator. If the
* return value is 0, the JSON name is unset. If the return value is
* greater than len, the JSON name was truncated. The buffer is always
* NULL-terminated if len > 0.
*
* The JSON name always defaults to a camelCased version of the regular
* name. However if the regular name is unset, the JSON name will be unset
* also.
*/
bool
GetJsonName
(
char
*
buf
)
const
;
size_t
GetJsonName
(
char
*
buf
,
size_t
len
)
const
;
/* Convenience version of the above function which copies the JSON name
* into the given string, returning false if the name is not set. */
template
<
class
T
>
bool
GetJsonName
(
T
*
str
)
{
str
->
resize
(
GetJsonName
(
NULL
,
0
));
GetJsonName
(
&
(
*
str
)[
0
],
str
->
size
());
return
str
->
size
()
>
0
;
}
/* For UPB_TYPE_MESSAGE fields only where is_tag_delimited() == false,
* indicates whether this field should have lazy parsing handlers that yield
...
...
@@ -1782,7 +1801,7 @@ const char *upb_fielddef_name(const upb_fielddef *f);
bool
upb_fielddef_isextension
(
const
upb_fielddef
*
f
);
bool
upb_fielddef_lazy
(
const
upb_fielddef
*
f
);
bool
upb_fielddef_packed
(
const
upb_fielddef
*
f
);
bool
upb_fielddef_getjsonname
(
const
upb_fielddef
*
f
,
char
*
buf
);
size_t
upb_fielddef_getjsonname
(
const
upb_fielddef
*
f
,
char
*
buf
,
size_t
len
);
const
upb_msgdef
*
upb_fielddef_containingtype
(
const
upb_fielddef
*
f
);
const
upb_oneofdef
*
upb_fielddef_containingoneof
(
const
upb_fielddef
*
f
);
upb_msgdef
*
upb_fielddef_containingtype_mutable
(
upb_fielddef
*
f
);
...
...
@@ -2565,6 +2584,9 @@ inline const char* FieldDef::name() const { return upb_fielddef_name(this); }
inline
bool
FieldDef
::
is_extension
()
const
{
return
upb_fielddef_isextension
(
this
);
}
inline
size_t
FieldDef
::
GetJsonName
(
char
*
buf
,
size_t
len
)
const
{
return
upb_fielddef_getjsonname
(
this
,
buf
,
len
);
}
inline
bool
FieldDef
::
lazy
()
const
{
return
upb_fielddef_lazy
(
this
);
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment