|
Video Processing Framework
|
00001 #ifndef PARSER_H_62B23520_7C8E_11DE_8A39_0800200C9A66 00002 #define PARSER_H_62B23520_7C8E_11DE_8A39_0800200C9A66 00003 00004 #if !defined(__GNUC__) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) || (__GNUC__ >= 4) // GCC supports "pragma once" correctly since 3.4 00005 #pragma once 00006 #endif 00007 00008 00009 #include "yaml-cpp/dll.h" 00010 #include "yaml-cpp/noncopyable.h" 00011 #include <ios> 00012 #include <memory> 00013 00014 namespace YAML 00015 { 00016 struct Directives; 00017 struct Mark; 00018 struct Token; 00019 class EventHandler; 00020 class Node; 00021 class Scanner; 00022 00023 class YAML_CPP_API Parser: private noncopyable 00024 { 00025 public: 00026 Parser(); 00027 Parser(std::istream& in); 00028 ~Parser(); 00029 00030 operator bool() const; 00031 00032 void Load(std::istream& in); 00033 bool HandleNextDocument(EventHandler& eventHandler); 00034 00035 bool GetNextDocument(Node& document); 00036 void PrintTokens(std::ostream& out); 00037 00038 private: 00039 void ParseDirectives(); 00040 void HandleDirective(const Token& token); 00041 void HandleYamlDirective(const Token& token); 00042 void HandleTagDirective(const Token& token); 00043 00044 private: 00045 std::auto_ptr<Scanner> m_pScanner; 00046 std::auto_ptr<Directives> m_pDirectives; 00047 }; 00048 } 00049 00050 #endif // PARSER_H_62B23520_7C8E_11DE_8A39_0800200C9A66