diff options
author | Josh Haberman <haberman@google.com> | 2013-02-15 16:27:18 -0800 |
---|---|---|
committer | Josh Haberman <haberman@google.com> | 2013-02-15 16:27:18 -0800 |
commit | 7d3e2bd2c4cfd1296d1d6f996d7548de26540d41 (patch) | |
tree | b4b35967b3322c65cfb1a32220e8718de09d85fc /bindings/cpp/upb/bytestream.cc | |
parent | ea198bdcf947ba4bd51474bdd4f7b82b5e4cf41d (diff) |
Sync with 8 months of Google-internal development.
Many things have changed and been simplified.
The memory-management story for upb_def and upb_handlers
is much more robust; upb_def and upb_handlers should be
fairly stable interfaces now. There is still much work
to do for the runtime component (upb_sink).
Diffstat (limited to 'bindings/cpp/upb/bytestream.cc')
-rw-r--r-- | bindings/cpp/upb/bytestream.cc | 39 |
1 files changed, 0 insertions, 39 deletions
diff --git a/bindings/cpp/upb/bytestream.cc b/bindings/cpp/upb/bytestream.cc deleted file mode 100644 index df0797e..0000000 --- a/bindings/cpp/upb/bytestream.cc +++ /dev/null @@ -1,39 +0,0 @@ -// -// upb - a minimalist implementation of protocol buffers. -// -// Copyright (c) 2011 Google Inc. See LICENSE for details. -// Author: Josh Haberman <jhaberman@gmail.com> - -#include "bytestream.hpp" - -namespace upb { - -upb_bytesrc_vtbl* ByteSourceBase::vtable() { - static upb_bytesrc_vtbl vtbl = { - &ByteSourceBase::VFetch, - &ByteSourceBase::VDiscard, - &ByteSourceBase::VCopy, - &ByteSourceBase::VGetPtr, - }; - return &vtbl; -} - -upb_bytesuccess_t ByteSourceBase::VFetch(void *src, uint64_t ofs, size_t *len) { - return static_cast<ByteSourceBase*>(src)->Fetch(ofs, len); -} - -void ByteSourceBase::VCopy( - const void *src, uint64_t ofs, size_t len, char* dest) { - static_cast<const ByteSourceBase*>(src)->Copy(ofs, len, dest); -} - -void ByteSourceBase::VDiscard(void *src, uint64_t ofs) { - static_cast<ByteSourceBase*>(src)->Discard(ofs); -} - -const char * ByteSourceBase::VGetPtr( - const void *src, uint64_t ofs, size_t* len) { - return static_cast<const ByteSourceBase*>(src)->GetPtr(ofs, len); -} - -} // namespace upb |