From ce9bba3cb5409844f8f3d7dcc235a9ea30cad090 Mon Sep 17 00:00:00 2001 From: Josh Haberman Date: Fri, 20 Dec 2013 17:40:40 -0800 Subject: Sync from Google-internal development. --- upb/bytestream.h | 50 -------------------------------------------------- 1 file changed, 50 deletions(-) delete mode 100644 upb/bytestream.h (limited to 'upb/bytestream.h') diff --git a/upb/bytestream.h b/upb/bytestream.h deleted file mode 100644 index a0c4110..0000000 --- a/upb/bytestream.h +++ /dev/null @@ -1,50 +0,0 @@ -/* - * upb - a minimalist implementation of protocol buffers. - * - * Copyright (c) 2013 Google Inc. See LICENSE for details. - * Author: Josh Haberman - * - * This file contains the standard ByteStream msgdef and some useful routines - * surrounding it. - * - * This is a mixed C/C++ interface that offers a full API to both languages. - * See the top-level README for more information. - */ - -#ifndef UPB_BYTESTREAM_H_ -#define UPB_BYTESTREAM_H_ - -#include "upb/sink.h" -#include "upb/bytestream.upb.h" - -#define UPB_BYTESTREAM_BYTES &upb_bytestream_fields[0] - -// A convenience method that handles the start/end calls and tracks overall -// success. -UPB_INLINE bool upb_bytestream_putstr(upb_sink *s, const char *buf, size_t n) { - bool ret = - upb_sink_startmsg(s) && - upb_sink_startstr(s, UPB_BYTESTREAM_BYTES_STARTSTR, n) && - upb_sink_putstring(s, UPB_BYTESTREAM_BYTES_STRING, buf, n) == n && - upb_sink_endstr(s, UPB_BYTESTREAM_BYTES_ENDSTR); - if (ret) upb_sink_endmsg(s); - return ret; -} - -#ifdef __cplusplus - -namespace upb { - -inline bool PutStringToBytestream(Sink* s, const char* buf, size_t n) { - return upb_bytestream_putstr(s, buf, n); -} - -template bool PutStringToBytestream(Sink* s, T str) { - return upb_bytestream_putstr(s, str.c_str(), str.size()); -} - -} // namespace upb - -#endif - -#endif // UPB_BYTESTREAM_H_ -- cgit v1.2.3