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
8 #include "yaml-cpp/eventhandler.h"
15 class EmitFromEvents
: public EventHandler
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();
35 void EmitProps(const std::string
& tag
, anchor_t anchor
);
40 struct State
{ enum value
{ WaitingForSequenceEntry
, WaitingForKey
, WaitingForValue
}; };
41 std::stack
<State::value
> m_stateStack
;
45 #endif // EMITFROMEVENTS_H_62B23520_7C8E_11DE_8A39_0800200C9A66