aboutsummaryrefslogtreecommitdiffstats
path: root/library/cpp/protobuf/json/field_option.h
diff options
context:
space:
mode:
authorVasily Gerasimov <UgnineSirdis@gmail.com>2022-02-10 16:49:09 +0300
committerDaniil Cherednik <dcherednik@yandex-team.ru>2022-02-10 16:49:09 +0300
commit6cdc8f140213c595e4ad38bc3d97fcef1146b8c3 (patch)
treef69637041e6fed76ebae0c74ae1fa0c4be6ab5b4 /library/cpp/protobuf/json/field_option.h
parente5d4696304c6689379ac7ce334512404d4b7836c (diff)
downloadydb-6cdc8f140213c595e4ad38bc3d97fcef1146b8c3.tar.gz
Restoring authorship annotation for Vasily Gerasimov <UgnineSirdis@gmail.com>. Commit 1 of 2.
Diffstat (limited to 'library/cpp/protobuf/json/field_option.h')
-rw-r--r--library/cpp/protobuf/json/field_option.h18
1 files changed, 9 insertions, 9 deletions
diff --git a/library/cpp/protobuf/json/field_option.h b/library/cpp/protobuf/json/field_option.h
index c8a8bfbff5..3a2db53a92 100644
--- a/library/cpp/protobuf/json/field_option.h
+++ b/library/cpp/protobuf/json/field_option.h
@@ -1,10 +1,10 @@
-#pragma once
-
+#pragma once
+
#include <google/protobuf/descriptor.h>
#include <google/protobuf/descriptor.pb.h>
#include <google/protobuf/message.h>
-
-namespace NProtobufJson {
+
+namespace NProtobufJson {
// Functor that defines whether given field has some option set to true
//
// Example:
@@ -20,13 +20,13 @@ namespace NProtobufJson {
, Positive(positive)
{
}
-
+
bool operator()(const NProtoBuf::Message&, const NProtoBuf::FieldDescriptor* field) const {
const NProtoBuf::FieldOptions& opt = field->options();
const bool val = opt.GetExtension(Option);
return Positive ? val : !val;
}
-
+
private:
const TFieldOptionExtensionId& Option;
bool Positive;
@@ -35,6 +35,6 @@ namespace NProtobufJson {
template <typename TFieldOptionExtensionId>
TFieldOptionFunctor<TFieldOptionExtensionId> MakeFieldOptionFunctor(const TFieldOptionExtensionId& option, bool positive = true) {
return TFieldOptionFunctor<TFieldOptionExtensionId>(option, positive);
- }
-
-}
+ }
+
+}