Back to home page

EIC code displayed by LXR

 
 

    


Warning, file /include/yaml-cpp/emitfromevents.h was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).

0001 #ifndef EMITFROMEVENTS_H_62B23520_7C8E_11DE_8A39_0800200C9A66
0002 #define EMITFROMEVENTS_H_62B23520_7C8E_11DE_8A39_0800200C9A66
0003 
0004 #if defined(_MSC_VER) ||                                            \
0005     (defined(__GNUC__) && (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) || \
0006      (__GNUC__ >= 4))  // GCC supports "pragma once" correctly since 3.4
0007 #pragma once
0008 #endif
0009 
0010 #include <stack>
0011 
0012 #include "yaml-cpp/anchor.h"
0013 #include "yaml-cpp/emitterstyle.h"
0014 #include "yaml-cpp/eventhandler.h"
0015 
0016 namespace YAML {
0017 struct Mark;
0018 }  // namespace YAML
0019 
0020 namespace YAML {
0021 class Emitter;
0022 
0023 class EmitFromEvents : public EventHandler {
0024  public:
0025   EmitFromEvents(Emitter& emitter);
0026 
0027   void OnDocumentStart(const Mark& mark) override;
0028   void OnDocumentEnd() override;
0029 
0030   void OnNull(const Mark& mark, anchor_t anchor) override;
0031   void OnAlias(const Mark& mark, anchor_t anchor) override;
0032   void OnScalar(const Mark& mark, const std::string& tag,
0033                         anchor_t anchor, const std::string& value) override;
0034 
0035   void OnSequenceStart(const Mark& mark, const std::string& tag,
0036                                anchor_t anchor, EmitterStyle::value style) override;
0037   void OnSequenceEnd() override;
0038 
0039   void OnMapStart(const Mark& mark, const std::string& tag,
0040                           anchor_t anchor, EmitterStyle::value style) override;
0041   void OnMapEnd() override;
0042 
0043  private:
0044   void BeginNode();
0045   void EmitProps(const std::string& tag, anchor_t anchor);
0046 
0047  private:
0048   Emitter& m_emitter;
0049 
0050   struct State {
0051     enum value { WaitingForSequenceEntry, WaitingForKey, WaitingForValue };
0052   };
0053   std::stack<State::value> m_stateStack;
0054 };
0055 }
0056 
0057 #endif  // EMITFROMEVENTS_H_62B23520_7C8E_11DE_8A39_0800200C9A66