~george-edison55/yaml-cpp/trunk

« back to all changes in this revision

Viewing changes to include/yaml-cpp/parser.h

  • Committer: Nathan Osman
  • Date: 2011-12-02 19:42:51 UTC
  • Revision ID: admin@quickmediasolutions.com-20111202194251-88jo18qw8ezm1h6l
Initial commit of revision 2d28ec774955.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#ifndef PARSER_H_62B23520_7C8E_11DE_8A39_0800200C9A66
 
2
#define PARSER_H_62B23520_7C8E_11DE_8A39_0800200C9A66
 
3
 
 
4
#if defined(_MSC_VER) || (defined(__GNUC__) && (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) || (__GNUC__ >= 4)) // GCC supports "pragma once" correctly since 3.4
 
5
#pragma once
 
6
#endif
 
7
 
 
8
 
 
9
#include "yaml-cpp/dll.h"
 
10
#include "yaml-cpp/noncopyable.h"
 
11
#include <ios>
 
12
#include <memory>
 
13
 
 
14
namespace YAML
 
15
{
 
16
        struct Directives;
 
17
        struct Mark;
 
18
        struct Token;
 
19
        class EventHandler;
 
20
        class Node;
 
21
        class Scanner;
 
22
 
 
23
        class YAML_CPP_API Parser: private noncopyable
 
24
        {
 
25
        public:
 
26
                Parser();
 
27
                Parser(std::istream& in);
 
28
                ~Parser();
 
29
 
 
30
                operator bool() const;
 
31
 
 
32
                void Load(std::istream& in);
 
33
                bool HandleNextDocument(EventHandler& eventHandler);
 
34
                
 
35
                bool GetNextDocument(Node& document); // old API only
 
36
                
 
37
                void PrintTokens(std::ostream& out);
 
38
 
 
39
        private:
 
40
                void ParseDirectives();
 
41
                void HandleDirective(const Token& token);
 
42
                void HandleYamlDirective(const Token& token);
 
43
                void HandleTagDirective(const Token& token);
 
44
                
 
45
        private:
 
46
                std::auto_ptr<Scanner> m_pScanner;
 
47
                std::auto_ptr<Directives> m_pDirectives;
 
48
        };
 
49
}
 
50
 
 
51
#endif // PARSER_H_62B23520_7C8E_11DE_8A39_0800200C9A66