diff options
author | snermolaev <snermolaev@yandex-team.ru> | 2022-02-10 16:45:53 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:45:53 +0300 |
commit | 2015790ac9fcc04caab83fccc23ab2460310a797 (patch) | |
tree | e644e9bc3f6f688561a871793b59bf8a637e0f72 /contrib/libs/protobuf | |
parent | c768a99151e47c3a4bb7b92c514d256abd301c4d (diff) | |
download | ydb-2015790ac9fcc04caab83fccc23ab2460310a797.tar.gz |
Restoring authorship annotation for <snermolaev@yandex-team.ru>. Commit 1 of 2.
Diffstat (limited to 'contrib/libs/protobuf')
-rw-r--r-- | contrib/libs/protobuf/src/google/protobuf/util/internal/json_objectwriter.cc | 6 | ||||
-rw-r--r-- | contrib/libs/protobuf/src/google/protobuf/util/internal/json_objectwriter.h | 36 |
2 files changed, 21 insertions, 21 deletions
diff --git a/contrib/libs/protobuf/src/google/protobuf/util/internal/json_objectwriter.cc b/contrib/libs/protobuf/src/google/protobuf/util/internal/json_objectwriter.cc index 3a9b11ceca..640b645e44 100644 --- a/contrib/libs/protobuf/src/google/protobuf/util/internal/json_objectwriter.cc +++ b/contrib/libs/protobuf/src/google/protobuf/util/internal/json_objectwriter.cc @@ -56,7 +56,7 @@ JsonObjectWriter::~JsonObjectWriter() { JsonObjectWriter* JsonObjectWriter::StartObject(StringPiece name) { WritePrefix(name); WriteChar('{'); - PushObject(); + PushObject(); return this; } @@ -70,7 +70,7 @@ JsonObjectWriter* JsonObjectWriter::EndObject() { JsonObjectWriter* JsonObjectWriter::StartList(StringPiece name) { WritePrefix(name); WriteChar('['); - PushArray(); + PushArray(); return this; } @@ -174,7 +174,7 @@ void JsonObjectWriter::WritePrefix(StringPiece name) { bool not_first = !element()->is_first(); if (not_first) WriteChar(','); if (not_first || !element()->is_root()) NewLine(); - if (!name.empty() || element()->is_json_object()) { + if (!name.empty() || element()->is_json_object()) { WriteChar('"'); if (!name.empty()) { JsonEscaping::Escape(name, &sink_); diff --git a/contrib/libs/protobuf/src/google/protobuf/util/internal/json_objectwriter.h b/contrib/libs/protobuf/src/google/protobuf/util/internal/json_objectwriter.h index 9088659be7..15fdd6c9a1 100644 --- a/contrib/libs/protobuf/src/google/protobuf/util/internal/json_objectwriter.h +++ b/contrib/libs/protobuf/src/google/protobuf/util/internal/json_objectwriter.h @@ -91,7 +91,7 @@ namespace converter { class PROTOBUF_EXPORT JsonObjectWriter : public StructuredObjectWriter { public: JsonObjectWriter(StringPiece indent_string, io::CodedOutputStream* out) - : element_(new Element(/*parent=*/nullptr, /*is_json_object=*/false)), + : element_(new Element(/*parent=*/nullptr, /*is_json_object=*/false)), stream_(out), sink_(out), indent_string_(indent_string), @@ -140,10 +140,10 @@ class PROTOBUF_EXPORT JsonObjectWriter : public StructuredObjectWriter { protected: class PROTOBUF_EXPORT Element : public BaseElement { public: - Element(Element* parent, bool is_json_object) - : BaseElement(parent), - is_first_(true), - is_json_object_(is_json_object) {} + Element(Element* parent, bool is_json_object) + : BaseElement(parent), + is_first_(true), + is_json_object_(is_json_object) {} // Called before each field of the Element is to be processed. // Returns true if this is the first call (processing the first field). @@ -156,12 +156,12 @@ class PROTOBUF_EXPORT JsonObjectWriter : public StructuredObjectWriter { } // Whether we are currently rendering inside a JSON object (i.e., between - // StartObject() and EndObject()). - bool is_json_object() const { return is_json_object_; } - + // StartObject() and EndObject()). + bool is_json_object() const { return is_json_object_; } + private: bool is_first_; - bool is_json_object_; + bool is_json_object_; GOOGLE_DISALLOW_IMPLICIT_CONSTRUCTORS(Element); }; @@ -195,16 +195,16 @@ class PROTOBUF_EXPORT JsonObjectWriter : public StructuredObjectWriter { return this; } - // Pushes a new JSON array element to the stack. - void PushArray() { - element_.reset(new Element(element_.release(), /*is_json_object=*/false)); - } - - // Pushes a new JSON object element to the stack. - void PushObject() { - element_.reset(new Element(element_.release(), /*is_json_object=*/true)); - } + // Pushes a new JSON array element to the stack. + void PushArray() { + element_.reset(new Element(element_.release(), /*is_json_object=*/false)); + } + // Pushes a new JSON object element to the stack. + void PushObject() { + element_.reset(new Element(element_.release(), /*is_json_object=*/true)); + } + // Pops an element off of the stack and deletes the popped element. void Pop() { bool needs_newline = !element_->is_first(); |