From cfdb9907cb87d15eaab72ceefbfa42fd7a4c3127 Mon Sep 17 00:00:00 2001 From: Josh Haberman Date: Sat, 11 May 2013 16:45:38 -0700 Subject: Synced with 3 months of Google-internal development. Major changes: - Got rid of all bytestream interfaces in favor of using regular handlers. - new Pipeline object represents a upb pipeline, does bump allocation internally to manage memory. - proto2 support now can handle extensions. --- upb/google/cord.h | 48 ------------------------------------------------ 1 file changed, 48 deletions(-) delete mode 100644 upb/google/cord.h (limited to 'upb/google/cord.h') diff --git a/upb/google/cord.h b/upb/google/cord.h deleted file mode 100644 index c579c0c..0000000 --- a/upb/google/cord.h +++ /dev/null @@ -1,48 +0,0 @@ -// -// upb - a minimalist implementation of protocol buffers. -// -// Copyright (c) 2011-2012 Google Inc. See LICENSE for details. -// Author: Josh Haberman -// -// Functionality for interoperating with Cord. Only needed inside Google. - -#ifndef UPB_GOOGLE_CORD_H -#define UPB_GOOGLE_CORD_H - -#include "strings/cord.h" -#include "upb/bytestream.h" - -namespace upb { - -namespace proto2_bridge_google3 { class FieldAccessor; } -namespace proto2_bridge_opensource { class FieldAccessor; } - -namespace google { - -class P2R_Handlers; - -class CordSupport { - private: - UPB_DISALLOW_POD_OPS(CordSupport); - - inline static void AssignToCord(const upb::ByteRegion* r, Cord* cord) { - // TODO(haberman): ref source data if source is a cord. - cord->Clear(); - uint64_t ofs = r->start_ofs(); - while (ofs < r->end_ofs()) { - size_t len; - const char *buf = r->GetPtr(ofs, &len); - cord->Append(StringPiece(buf, len)); - ofs += len; - } - } - - friend class ::upb::proto2_bridge_google3::FieldAccessor; - friend class ::upb::proto2_bridge_opensource::FieldAccessor; - friend class P2R_Handlers; -}; - -} // namespace google -} // namespace upb - -#endif // UPB_GOOGLE_CORD_H -- cgit v1.2.3