Commit ad712c4f authored by Jesse Beder's avatar Jesse Beder
Browse files

Add EmitterStyle, which will allow sequence or map style (i.e., flow or block)...

Add EmitterStyle, which will allow sequence or map style (i.e., flow or block) to be preserved between parsing and emitting
parent a397ad29
#include <iostream> #include <iostream>
#include "yaml-cpp/emitterstyle.h"
#include "yaml-cpp/eventhandler.h" #include "yaml-cpp/eventhandler.h"
#include "yaml-cpp/yaml.h" // IWYU pragma: keep #include "yaml-cpp/yaml.h" // IWYU pragma: keep
...@@ -16,9 +17,11 @@ class NullEventHandler : public YAML::EventHandler { ...@@ -16,9 +17,11 @@ class NullEventHandler : public YAML::EventHandler {
virtual void OnAlias(const Mark&, anchor_t) {} virtual void OnAlias(const Mark&, anchor_t) {}
virtual void OnScalar(const Mark&, const std::string&, anchor_t, virtual void OnScalar(const Mark&, const std::string&, anchor_t,
const std::string&) {} const std::string&) {}
virtual void OnSequenceStart(const Mark&, const std::string&, anchor_t) {} virtual void OnSequenceStart(const Mark&, const std::string&, anchor_t,
YAML::EmitterStyle::value style) {}
virtual void OnSequenceEnd() {} virtual void OnSequenceEnd() {}
virtual void OnMapStart(const Mark&, const std::string&, anchor_t) {} virtual void OnMapStart(const Mark&, const std::string&, anchor_t,
YAML::EmitterStyle::value style) {}
virtual void OnMapEnd() {} virtual void OnMapEnd() {}
}; };
......
#include <iostream> #include <iostream>
#include "yaml-cpp/emitterstyle.h"
#include "yaml-cpp/eventhandler.h" #include "yaml-cpp/eventhandler.h"
#include "yaml-cpp/yaml.h" // IWYU pragma: keep #include "yaml-cpp/yaml.h" // IWYU pragma: keep
...@@ -16,9 +17,11 @@ class NullEventHandler : public YAML::EventHandler { ...@@ -16,9 +17,11 @@ class NullEventHandler : public YAML::EventHandler {
virtual void OnAlias(const Mark&, anchor_t) {} virtual void OnAlias(const Mark&, anchor_t) {}
virtual void OnScalar(const Mark&, const std::string&, anchor_t, virtual void OnScalar(const Mark&, const std::string&, anchor_t,
const std::string&) {} const std::string&) {}
virtual void OnSequenceStart(const Mark&, const std::string&, anchor_t) {} virtual void OnSequenceStart(const Mark&, const std::string&, anchor_t,
YAML::EmitterStyle::value style) {}
virtual void OnSequenceEnd() {} virtual void OnSequenceEnd() {}
virtual void OnMapStart(const Mark&, const std::string&, anchor_t) {} virtual void OnMapStart(const Mark&, const std::string&, anchor_t,
YAML::EmitterStyle::value style) {}
virtual void OnMapEnd() {} virtual void OnMapEnd() {}
}; };
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment