unknown_fields_collector.h 830 B

1234567891011121314151617181920212223242526272829
  1. #pragma once
  2. #include <util/generic/string.h>
  3. namespace google {
  4. namespace protobuf {
  5. class FieldDescriptor;
  6. class Descriptor;
  7. }
  8. }
  9. namespace NProtobufJson {
  10. /* Methods OnEnter.../OnLeave... are called on every field of structure
  11. * during traverse and should be used to build context
  12. * Method OnUnknownField are called every time when field which can't
  13. * be mapped
  14. */
  15. struct IUnknownFieldsCollector {
  16. virtual ~IUnknownFieldsCollector() = default;
  17. virtual void OnEnterMapItem(const TString& key) = 0;
  18. virtual void OnLeaveMapItem() = 0;
  19. virtual void OnEnterArrayItem(ui64 id) = 0;
  20. virtual void OnLeaveArrayItem() = 0;
  21. virtual void OnUnknownField(const TString& key, const google::protobuf::Descriptor& value) = 0;
  22. };
  23. }