diff options
author | Joshua Haberman <jhaberman@gmail.com> | 2019-03-06 12:17:34 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-03-06 12:17:34 -0800 |
commit | ed9faae0993704b033c594b072d65e1bf19207fa (patch) | |
tree | df2777687abddf1335427d06942ba3436edf8c0b /upb/bindings/stdc++/string.h | |
parent | 51f30e064b8e88af8e7d429c5a54c25f28c68b02 (diff) | |
parent | 71ec01e34b03557cfed9df5f417791a189e7fca6 (diff) |
Merge pull request #141 from haberman/defcleanup
Major refactoring/cleanup of upb
Diffstat (limited to 'upb/bindings/stdc++/string.h')
-rw-r--r-- | upb/bindings/stdc++/string.h | 9 |
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_; }; |