eventhandler.h 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. #ifndef EVENTHANDLER_H_62B23520_7C8E_11DE_8A39_0800200C9A66
  2. #define EVENTHANDLER_H_62B23520_7C8E_11DE_8A39_0800200C9A66
  3. #if defined(_MSC_VER) || \
  4. (defined(__GNUC__) && (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) || \
  5. (__GNUC__ >= 4)) // GCC supports "pragma once" correctly since 3.4
  6. #pragma once
  7. #endif
  8. #include <string>
  9. #include "yaml-cpp/anchor.h"
  10. #include "yaml-cpp/emitterstyle.h"
  11. namespace YAML {
  12. struct Mark;
  13. class EventHandler {
  14. public:
  15. virtual ~EventHandler() {}
  16. virtual void OnDocumentStart(const Mark& mark) = 0;
  17. virtual void OnDocumentEnd() = 0;
  18. virtual void OnNull(const Mark& mark, anchor_t anchor) = 0;
  19. virtual void OnAlias(const Mark& mark, anchor_t anchor) = 0;
  20. virtual void OnScalar(const Mark& mark, const std::string& tag,
  21. anchor_t anchor, const std::string& value) = 0;
  22. virtual void OnSequenceStart(const Mark& mark, const std::string& tag,
  23. anchor_t anchor, EmitterStyle::value style) = 0;
  24. virtual void OnSequenceEnd() = 0;
  25. virtual void OnMapStart(const Mark& mark, const std::string& tag,
  26. anchor_t anchor, EmitterStyle::value style) = 0;
  27. virtual void OnMapEnd() = 0;
  28. };
  29. }
  30. #endif // EVENTHANDLER_H_62B23520_7C8E_11DE_8A39_0800200C9A66