external libraries: yaml-cpp version bump
[supercollider.git] / external_libraries / yaml-cpp-0.3.0 / include / yaml-cpp / emitfromevents.h
blobe11ae640effea7e336ebd1e6c6c49293014fbdd0
1 #ifndef EMITFROMEVENTS_H_62B23520_7C8E_11DE_8A39_0800200C9A66
2 #define EMITFROMEVENTS_H_62B23520_7C8E_11DE_8A39_0800200C9A66
4 #if defined(_MSC_VER) || (defined(__GNUC__) && (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) || (__GNUC__ >= 4)) // GCC supports "pragma once" correctly since 3.4
5 #pragma once
6 #endif
8 #include "yaml-cpp/eventhandler.h"
9 #include <stack>
11 namespace YAML
13 class Emitter;
15 class EmitFromEvents: public EventHandler
17 public:
18 EmitFromEvents(Emitter& emitter);
20 virtual void OnDocumentStart(const Mark& mark);
21 virtual void OnDocumentEnd();
23 virtual void OnNull(const Mark& mark, anchor_t anchor);
24 virtual void OnAlias(const Mark& mark, anchor_t anchor);
25 virtual void OnScalar(const Mark& mark, const std::string& tag, anchor_t anchor, const std::string& value);
27 virtual void OnSequenceStart(const Mark& mark, const std::string& tag, anchor_t anchor);
28 virtual void OnSequenceEnd();
30 virtual void OnMapStart(const Mark& mark, const std::string& tag, anchor_t anchor);
31 virtual void OnMapEnd();
33 private:
34 void BeginNode();
35 void EmitProps(const std::string& tag, anchor_t anchor);
37 private:
38 Emitter& m_emitter;
40 struct State { enum value { WaitingForSequenceEntry, WaitingForKey, WaitingForValue }; };
41 std::stack<State::value> m_stateStack;
45 #endif // EMITFROMEVENTS_H_62B23520_7C8E_11DE_8A39_0800200C9A66