31 #ifndef GOOGLE_PROTOBUF_UTIL_CONVERTER_JSON_OBJECTWRITER_H__ 32 #define GOOGLE_PROTOBUF_UTIL_CONVERTER_JSON_OBJECTWRITER_H__ 95 indent_string_(indent_string.
ToString()),
96 use_websafe_base64_for_bytes_(
false) {}
116 use_websafe_base64_for_bytes_ =
value;
147 virtual ~ByteSinkWrapper() {}
150 virtual void Append(
const char*
bytes,
size_t n) {
151 stream_->WriteRaw(bytes, n);
165 stream_->WriteString(value);
170 void Push() { element_.reset(
new Element(element_.release())); }
174 bool needs_newline = !element_->is_first();
175 element_.reset(element_->pop<
Element>());
176 if (needs_newline) NewLine();
182 if (!indent_string_.empty()) {
184 for (
int i = 0;
i <
element()->level();
i++) {
185 stream_->WriteString(indent_string_);
196 void WriteChar(
const char c) { stream_->WriteRaw(&c,
sizeof(c)); }
200 ByteSinkWrapper sink_;
201 const string indent_string_;
205 bool use_websafe_base64_for_bytes_;
215 #endif // GOOGLE_PROTOBUF_UTIL_CONVERTER_JSON_OBJECTWRITER_H__ Definition: json_objectwriter.h:120
int Pop(int s)
Definition: towers.c:169
EGLStreamKHR stream
Definition: eglext.h:340
int c
Definition: cpp_unittests.cpp:275
Element(Element *parent)
Definition: json_objectwriter.h:122
#define GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(TypeName)
Definition: macros.h:40
OPENSSL_EXPORT const ASN1_OBJECT int const unsigned char * bytes
Definition: x509.h:1053
Definition: structured_objectwriter.h:69
Definition: float-mm.c:54
EGLStreamKHR EGLint n
Definition: eglext.h:984
void set_use_websafe_base64_for_bytes(bool value)
Definition: json_objectwriter.h:115
const FieldDescriptor const OneofDescriptor value
Definition: descriptor.h:1717
int32_t int32
Definition: port.h:130
Definition: stringpiece.h:178
#define GOOGLE_DISALLOW_IMPLICIT_CONSTRUCTORS(TypeName)
Definition: macros.h:45
bool is_first()
Definition: json_objectwriter.h:126
int int * out
Definition: gcc-loops.cpp:206
EGLAttrib * value
Definition: eglext.h:120
virtual Element * element()
Definition: json_objectwriter.h:140
uint32_t uint32
Definition: port.h:135
EGLImageKHR EGLint * name
Definition: eglext.h:851
Definition: __init__.py:1
uint64_t uint64
Definition: port.h:136
std::string ToString(const T &value)
Definition: angleutils.h:163
#define true
Definition: float-mm.c:6
Definition: json_objectwriter.h:88
Definition: structured_objectwriter.h:59
Definition: scoped_ptr.h:48
for i
Definition: complexityMeasures.m:24
int64_t int64
Definition: port.h:131
#define false
Definition: float-mm.c:5
#define NULL
Definition: common_types.h:41
#define LIBPROTOBUF_EXPORT
Definition: port.h:97
Definition: gflags_completions.h:115
Definition: coded_stream.h:665
JsonObjectWriter(StringPiece indent_string, google::protobuf::io::CodedOutputStream *out)
Definition: json_objectwriter.h:90
void Push(int i, int s)
Definition: towers.c:146