Go to the documentation of this file.
31 #ifndef GOOGLE_PROTOBUF_UTIL_CONVERTER_JSON_OBJECTWRITER_H__
32 #define GOOGLE_PROTOBUF_UTIL_CONVERTER_JSON_OBJECTWRITER_H__
41 #include <google/protobuf/port_def.inc>
94 indent_string_(indent_string),
95 use_websafe_base64_for_bytes_(
false) {}
117 use_websafe_base64_for_bytes_ =
value;
126 is_json_object_(is_json_object) {}
159 stream_->WriteRaw(
bytes,
n);
174 stream_->WriteString(
value);
180 element_.reset(
new Element(element_.release(),
false));
185 element_.reset(
new Element(element_.release(),
true));
190 bool needs_newline = !element_->is_first();
191 element_.reset(element_->pop<
Element>());
198 if (!indent_string_.empty()) {
200 for (
int i = 0;
i < element()->level();
i++) {
201 stream_->WriteString(indent_string_);
212 void WriteChar(
const char c) { stream_->WriteRaw(&c,
sizeof(c)); }
231 #include <google/protobuf/port_undef.inc>
233 #endif // GOOGLE_PROTOBUF_UTIL_CONVERTER_JSON_OBJECTWRITER_H__
void Append(const char *bytes, size_t n) override
GLuint const GLchar * name
const Descriptor::ReservedRange value
#define GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(TypeName)
JsonObjectWriter * RenderSimple(StringPiece name, const std::string &value)
GLsizei const GLchar *const * string
std::unique_ptr< Element > element_
ByteSinkWrapper(io::CodedOutputStream *stream)
#define GOOGLE_DISALLOW_IMPLICIT_CONSTRUCTORS(TypeName)
bool is_json_object() const
JsonObjectWriter(StringPiece indent_string, io::CodedOutputStream *out)
Element(Element *parent, bool is_json_object)
io::CodedOutputStream * stream_
~ByteSinkWrapper() override
void set_use_websafe_base64_for_bytes(bool value)
io::CodedOutputStream * stream_
const std::string indent_string_
GLsizei const GLfloat * value
bool use_websafe_base64_for_bytes_
void WriteChar(const char c)
Element * element() override
libaditof
Author(s):
autogenerated on Wed May 21 2025 02:06:55