summaryrefslogtreecommitdiff
path: root/core/upb_string.h
diff options
context:
space:
mode:
Diffstat (limited to 'core/upb_string.h')
-rw-r--r--core/upb_string.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/core/upb_string.h b/core/upb_string.h
index 04c0ae9..1a7e06b 100644
--- a/core/upb_string.h
+++ b/core/upb_string.h
@@ -134,6 +134,12 @@ INLINE upb_strlen_t upb_string_len(upb_string *str) { return str->len; }
INLINE const char *upb_string_getrobuf(upb_string *str) { return str->ptr; }
INLINE void upb_string_endread(upb_string *str) { (void)str; }
+// Convenience method for getting the end of the string. Calls
+// upb_string_getrobuf() so inherits the caveats of calling that function.
+INLINE const char *upb_string_getbufend(upb_string *str) {
+ return upb_string_getrobuf(str) + upb_string_len(str);
+}
+
// Attempts to recycle the string "str" so it may be reused and have different
// data written to it. After the function returns, "str" points to a writable
// string, which is either the original string if it had no other references
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback