mirror of
https://github.com/jbeder/yaml-cpp.git
synced 2025-09-09 12:41:17 +00:00
Reintegrated the event-api branch (second iteration) into the rtweeks21-staging branch.
This commit is contained in:
@@ -4,19 +4,20 @@
|
||||
#define PARSER_H_62B23520_7C8E_11DE_8A39_0800200C9A66
|
||||
|
||||
|
||||
#include "node.h"
|
||||
#include "graphbuilder.h"
|
||||
#include "noncopyable.h"
|
||||
#include <ios>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <map>
|
||||
#include <memory>
|
||||
|
||||
namespace YAML
|
||||
{
|
||||
class Scanner;
|
||||
struct ParserState;
|
||||
struct Directives;
|
||||
struct Mark;
|
||||
struct Token;
|
||||
class EventHandler;
|
||||
class GraphBuilderInterface;
|
||||
class Node;
|
||||
class Scanner;
|
||||
|
||||
class Parser: private noncopyable
|
||||
{
|
||||
@@ -28,6 +29,18 @@ namespace YAML
|
||||
operator bool() const;
|
||||
|
||||
void Load(std::istream& in);
|
||||
bool HandleNextDocument(EventHandler& eventHandler);
|
||||
|
||||
void *BuildNextDocumentGraph(GraphBuilderInterface& graphBuilder);
|
||||
template <class Builder>
|
||||
typename Builder::Node *BuildNextDocumentGraph(Builder& graphBuilder)
|
||||
{
|
||||
GraphBuilder<Builder> wrapper(graphBuilder); // Must be lvalue to make C++ happy
|
||||
return static_cast<typename Builder::Node *>(
|
||||
BuildNextDocumentGraph(wrapper.AsBuilderInterface())
|
||||
);
|
||||
}
|
||||
|
||||
bool GetNextDocument(Node& document);
|
||||
void PrintTokens(std::ostream& out);
|
||||
|
||||
@@ -36,10 +49,10 @@ namespace YAML
|
||||
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<ParserState> m_pState;
|
||||
std::auto_ptr<Directives> m_pDirectives;
|
||||
};
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user