yaml-cpp/include/yaml-cpp/parser.h

49 lines
1.1 KiB
C
Raw Normal View History

2009-07-30 02:27:20 +04:00
#ifndef PARSER_H_62B23520_7C8E_11DE_8A39_0800200C9A66
#define PARSER_H_62B23520_7C8E_11DE_8A39_0800200C9A66
2014-03-22 22:05:03 +04:00
#if defined(_MSC_VER) || \
(defined(__GNUC__) && (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) || \
(__GNUC__ >= 4)) // GCC supports "pragma once" correctly since 3.4
#pragma once
#endif
#include <ios>
#include <memory>
2014-03-23 07:46:04 +04:00
#include "yaml-cpp/dll.h"
#include "yaml-cpp/noncopyable.h"
2014-03-22 22:05:03 +04:00
namespace YAML {
class EventHandler;
2014-03-22 21:49:16 +04:00
class Node;
2014-03-22 22:05:03 +04:00
class Scanner;
2014-03-23 07:46:04 +04:00
struct Directives;
struct Token;
2014-03-22 22:05:03 +04:00
class YAML_CPP_API Parser : private noncopyable {
public:
Parser();
Parser(std::istream& in);
~Parser();
operator bool() const;
void Load(std::istream& in);
bool HandleNextDocument(EventHandler& eventHandler);
void PrintTokens(std::ostream& out);
private:
void ParseDirectives();
void HandleDirective(const Token& token);
void HandleYamlDirective(const Token& token);
void HandleTagDirective(const Token& token);
private:
std::auto_ptr<Scanner> m_pScanner;
std::auto_ptr<Directives> m_pDirectives;
};
}
2009-07-30 02:27:20 +04:00
2014-03-22 22:05:03 +04:00
#endif // PARSER_H_62B23520_7C8E_11DE_8A39_0800200C9A66