diff options
author | Mikhail Borisov <borisov.mikhail@gmail.com> | 2022-02-10 16:45:39 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:45:39 +0300 |
commit | a6a92afe03e02795227d2641b49819b687f088f8 (patch) | |
tree | f6984a1d27d5a7ec88a6fdd6e20cd5b7693b6ece /contrib/tools/protoc/plugins/cpp_styleguide/cpp_styleguide.cpp | |
parent | c6dc8b8bd530985bc4cce0137e9a5de32f1087cb (diff) | |
download | ydb-a6a92afe03e02795227d2641b49819b687f088f8.tar.gz |
Restoring authorship annotation for Mikhail Borisov <borisov.mikhail@gmail.com>. Commit 1 of 2.
Diffstat (limited to 'contrib/tools/protoc/plugins/cpp_styleguide/cpp_styleguide.cpp')
-rw-r--r-- | contrib/tools/protoc/plugins/cpp_styleguide/cpp_styleguide.cpp | 48 |
1 files changed, 24 insertions, 24 deletions
diff --git a/contrib/tools/protoc/plugins/cpp_styleguide/cpp_styleguide.cpp b/contrib/tools/protoc/plugins/cpp_styleguide/cpp_styleguide.cpp index cd96aa0565..5a15ea3d21 100644 --- a/contrib/tools/protoc/plugins/cpp_styleguide/cpp_styleguide.cpp +++ b/contrib/tools/protoc/plugins/cpp_styleguide/cpp_styleguide.cpp @@ -683,7 +683,7 @@ namespace NPlugins { } void GenerateClassDefinitionExtension() { - GenerateSaveLoadImplementation(); + GenerateSaveLoadImplementation(); GenerateJSONImplementation(); for (auto& nestedGenerator: NestedGenerators_) { @@ -785,33 +785,33 @@ namespace NPlugins { printer.Print(vars, " return ::google::protobuf::io::TAsJSON<$class$>(*this);\n"); printer.Print("}\n"); - printer.Print("void Save(IOutputStream* output) const;\n"); - printer.Print("void Load(IInputStream* input);\n"); - } + printer.Print("void Save(IOutputStream* output) const;\n"); + printer.Print("void Load(IInputStream* input);\n"); + } printer.Print("// End of Yandex-specific extension\n"); } - void GenerateSaveLoadImplementation() { - TProtoStringType fileName = SourceFileName(Descriptor_->file()); - TProtoStringType scope = "namespace_scope"; + void GenerateSaveLoadImplementation() { + TProtoStringType fileName = SourceFileName(Descriptor_->file()); + TProtoStringType scope = "namespace_scope"; std::unique_ptr<io::ZeroCopyOutputStream> output( - OutputDirectory_->OpenForInsert(fileName, scope)); - io::Printer printer(output.get(), '$'); - - TVariables vars; - vars["class"] = Classname_; - if (!IsLiteRuntimeMessage(Descriptor_)) { - printer.Print("// Yandex-specific extension\n"); - printer.Print(vars, "void $class$::Save(IOutputStream* output) const {\n"); - printer.Print(" ::Save(output, static_cast<const ::google::protobuf::Message&>(*this));\n"); - printer.Print("}\n"); - printer.Print(vars, "void $class$::Load(IInputStream* input) {\n"); - printer.Print(" ::Load(input, static_cast<::google::protobuf::Message&>(*this));\n"); - printer.Print("}\n"); - printer.Print("// End of Yandex-specific extension\n"); - } - } - + OutputDirectory_->OpenForInsert(fileName, scope)); + io::Printer printer(output.get(), '$'); + + TVariables vars; + vars["class"] = Classname_; + if (!IsLiteRuntimeMessage(Descriptor_)) { + printer.Print("// Yandex-specific extension\n"); + printer.Print(vars, "void $class$::Save(IOutputStream* output) const {\n"); + printer.Print(" ::Save(output, static_cast<const ::google::protobuf::Message&>(*this));\n"); + printer.Print("}\n"); + printer.Print(vars, "void $class$::Load(IInputStream* input) {\n"); + printer.Print(" ::Load(input, static_cast<::google::protobuf::Message&>(*this));\n"); + printer.Print("}\n"); + printer.Print("// End of Yandex-specific extension\n"); + } + } + void GenerateDebugStringImplementation() { TProtoStringType fileName = SourceFileName(Descriptor_->file()); TProtoStringType scope = "namespace_scope"; |