forked from jbeder/yaml-cpp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathread.cpp
33 lines (28 loc) · 1.02 KB
/
read.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#include <iostream>
#include "yaml-cpp/emitterstyle.h"
#include "yaml-cpp/eventhandler.h"
#include "yaml-cpp/yaml.h" // IWYU pragma: keep
class NullEventHandler : public YAML::EventHandler {
public:
typedef YAML::Mark Mark;
typedef YAML::anchor_t anchor_t;
NullEventHandler() {}
virtual void OnDocumentStart(const Mark&) {}
virtual void OnDocumentEnd() {}
virtual void OnNull(const Mark&, anchor_t) {}
virtual void OnAlias(const Mark&, anchor_t) {}
virtual void OnScalar(const Mark&, const std::string&, anchor_t,
const std::string&) {}
virtual void OnSequenceStart(const Mark&, const std::string&, anchor_t,
YAML::EmitterStyle::value style) {}
virtual void OnSequenceEnd() {}
virtual void OnMapStart(const Mark&, const std::string&, anchor_t,
YAML::EmitterStyle::value style) {}
virtual void OnMapEnd() {}
};
int main() {
YAML::Parser parser(std::cin);
NullEventHandler handler;
parser.HandleNextDocument(handler);
return 0;
}