aboutsummaryrefslogtreecommitdiffstats
path: root/library/cpp/protobuf/util/path.h
diff options
context:
space:
mode:
authorVasily Gerasimov <UgnineSirdis@gmail.com>2022-02-10 16:49:10 +0300
committerDaniil Cherednik <dcherednik@yandex-team.ru>2022-02-10 16:49:10 +0300
commit1eb755fbca92172a6aec2f57371b2b3a19dfab43 (patch)
tree5d5cb817648f650d76cf1076100726fd9b8448e8 /library/cpp/protobuf/util/path.h
parent6cdc8f140213c595e4ad38bc3d97fcef1146b8c3 (diff)
downloadydb-1eb755fbca92172a6aec2f57371b2b3a19dfab43.tar.gz
Restoring authorship annotation for Vasily Gerasimov <UgnineSirdis@gmail.com>. Commit 2 of 2.
Diffstat (limited to 'library/cpp/protobuf/util/path.h')
-rw-r--r--library/cpp/protobuf/util/path.h32
1 files changed, 16 insertions, 16 deletions
diff --git a/library/cpp/protobuf/util/path.h b/library/cpp/protobuf/util/path.h
index 4fbee86f26..487f643a2d 100644
--- a/library/cpp/protobuf/util/path.h
+++ b/library/cpp/protobuf/util/path.h
@@ -1,11 +1,11 @@
-#pragma once
-
+#pragma once
+
#include <google/protobuf/descriptor.h>
#include <google/protobuf/message.h>
-
-#include <util/generic/vector.h>
-
-namespace NProtoBuf {
+
+#include <util/generic/vector.h>
+
+namespace NProtoBuf {
class TFieldPath {
public:
TFieldPath();
@@ -13,40 +13,40 @@ namespace NProtoBuf {
TFieldPath(const TVector<const FieldDescriptor*>& path);
TFieldPath(const TFieldPath&) = default;
TFieldPath& operator=(const TFieldPath&) = default;
-
+
bool InitUnsafe(const Descriptor* msgType, const TStringBuf path); // noexcept
void Init(const Descriptor* msgType, const TStringBuf& path); // throws
-
+
const TVector<const FieldDescriptor*>& Fields() const {
return Path;
}
-
+
void AddField(const FieldDescriptor* field) {
Path.push_back(field);
}
-
+
const Descriptor* ParentType() const {
return Empty() ? nullptr : Path.front()->containing_type();
}
-
+
const FieldDescriptor* FieldDescr() const {
return Empty() ? nullptr : Path.back();
}
-
+
bool Empty() const {
return Path.empty();
}
-
+
explicit operator bool() const {
return !Empty();
}
-
+
bool operator!() const {
return Empty();
}
-
+
private:
TVector<const FieldDescriptor*> Path;
};
-
+
}