aboutsummaryrefslogtreecommitdiffstats
path: root/library/cpp/protobuf/json/unknown_fields_collector.h
diff options
context:
space:
mode:
authorDaniil Cherednik <dcherednik@ydb.tech>2023-10-23 20:34:16 +0000
committerDaniil Cherednik <dcherednik@ydb.tech>2023-10-23 20:34:16 +0000
commite84c813452e9ed62415b2d17a117008fce909a3d (patch)
tree998632d6f08419de5b644940799f3be9408ab46b /library/cpp/protobuf/json/unknown_fields_collector.h
parentdf6e99640a1489cde9b7cc5b58a3747c6ec28921 (diff)
downloadydb-stable-23-3.tar.gz
Intermediate changesstable-23-3
x-stable-origin-commit: 8b96eef194d7fb3b315816b97322e8dd90bf3d94
Diffstat (limited to 'library/cpp/protobuf/json/unknown_fields_collector.h')
-rw-r--r--library/cpp/protobuf/json/unknown_fields_collector.h29
1 files changed, 29 insertions, 0 deletions
diff --git a/library/cpp/protobuf/json/unknown_fields_collector.h b/library/cpp/protobuf/json/unknown_fields_collector.h
new file mode 100644
index 00000000000..1e71f2164cc
--- /dev/null
+++ b/library/cpp/protobuf/json/unknown_fields_collector.h
@@ -0,0 +1,29 @@
+#pragma once
+
+#include <util/generic/string.h>
+
+namespace google {
+ namespace protobuf {
+ class FieldDescriptor;
+ class Descriptor;
+ }
+}
+
+namespace NProtobufJson {
+ /* Methods OnEnter.../OnLeave... are called on every field of structure
+ * during traverse and should be used to build context
+ * Method OnUnknownField are called every time when field which can't
+ * be mapped
+ */
+ struct IUnknownFieldsCollector {
+ virtual ~IUnknownFieldsCollector() = default;
+
+ virtual void OnEnterMapItem(const TString& key) = 0;
+ virtual void OnLeaveMapItem() = 0;
+
+ virtual void OnEnterArrayItem(ui64 id) = 0;
+ virtual void OnLeaveArrayItem() = 0;
+
+ virtual void OnUnknownField(const TString& key, const google::protobuf::Descriptor& value) = 0;
+ };
+}