summaryrefslogtreecommitdiff
path: root/upb/bindings/stdc++/string.h
diff options
context:
space:
mode:
Diffstat (limited to 'upb/bindings/stdc++/string.h')
-rw-r--r--upb/bindings/stdc++/string.h9
1 files changed, 5 insertions, 4 deletions
diff --git a/upb/bindings/stdc++/string.h b/upb/bindings/stdc++/string.h
index 99efd4f..55b44cf 100644
--- a/upb/bindings/stdc++/string.h
+++ b/upb/bindings/stdc++/string.h
@@ -9,7 +9,7 @@ namespace upb {
template <class T>
class FillStringHandler {
public:
- static void SetHandler(BytesHandler* handler) {
+ static void SetHandler(upb_byteshandler* handler) {
upb_byteshandler_setstartstr(handler, &FillStringHandler::StartString,
NULL);
upb_byteshandler_setstring(handler, &FillStringHandler::StringBuf, NULL);
@@ -28,7 +28,7 @@ class FillStringHandler {
}
static size_t StringBuf(void* c, const void* hd, const char* buf, size_t n,
- const BufferHandle* h) {
+ const upb_bufhandle* h) {
UPB_UNUSED(hd);
UPB_UNUSED(h);
@@ -48,14 +48,15 @@ class StringSink {
explicit StringSink(T* target) {
// TODO(haberman): we need to avoid rebuilding a new handler every time,
// but with class globals disallowed for google3 C++ this is tricky.
+ upb_byteshandler_init(&handler_);
FillStringHandler<T>::SetHandler(&handler_);
input_.Reset(&handler_, target);
}
- BytesSink* input() { return &input_; }
+ BytesSink input() { return input_; }
private:
- BytesHandler handler_;
+ upb_byteshandler handler_;
BytesSink input_;
};
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback