~ubuntu-branches/ubuntu/saucy/sflphone/saucy

« back to all changes in this revision

Viewing changes to sflphone-common/src/config/yamlparser.h

  • Committer: Bazaar Package Importer
  • Author(s): Francois Marier
  • Date: 2011-04-05 14:14:13 UTC
  • mfrom: (4.1.4 sid)
  • Revision ID: james.westby@ubuntu.com-20110405141413-hbwbunfsxpn2rtre
Tags: 0.9.13-1
* New upstream release
  - remove Debian patch (applied upstream)
* Fix watch file
* Remove unnecessary versioned dependency

Show diffs side-by-side

added added

removed removed

Lines of Context:
36
36
#include <stdio.h>
37
37
#include <exception>
38
38
#include <string>
 
39
#include <vector>
39
40
 
40
41
namespace Conf
41
42
{
42
43
 
43
44
#define PARSER_BUFFERSIZE 65536
44
 
#define PARSER_MAXEVENT 1024
 
45
 
 
46
typedef std::vector<yaml_event_t> YamlEventVector;
45
47
 
46
48
class YamlParserException : public std::exception
47
49
{
70
72
 
71
73
        ~YamlParser();
72
74
 
73
 
        void open();
74
 
 
75
 
        void close();
76
 
 
77
 
        void serializeEvents();
78
 
 
79
 
        YamlDocument *composeEvents();
80
 
 
81
 
        void constructNativeData();
 
75
        void open() throw(YamlParserException);
 
76
 
 
77
        void close() throw(YamlParserException);
 
78
 
 
79
        void serializeEvents() throw(YamlParserException);
 
80
 
 
81
        YamlDocument *composeEvents() throw(YamlParserException);
 
82
 
 
83
        void constructNativeData() throw(YamlParserException);
82
84
 
83
85
        SequenceNode *getAccountSequence (void) {
84
86
            return accountSequence;
113
115
        /**
114
116
         * Copy yaml parser event in event_to according to their type.
115
117
         */
116
 
        int copyEvent (yaml_event_t *event_to, yaml_event_t *event_from);
117
 
 
118
 
        void processStream (void);
119
 
 
120
 
        void processDocument (void);
121
 
 
122
 
        void processScalar (YamlNode *topNode);
123
 
 
124
 
        void processSequence (YamlNode *topNode);
125
 
 
126
 
        void processMapping (YamlNode *topNode);
127
 
 
128
 
        void mainNativeDataMapping (MappingNode *map);
129
 
 
130
 
        //   void buildAccounts(SequenceNode *map);
131
 
 
 
118
        void copyEvent (yaml_event_t *event_to, yaml_event_t *event_from) throw(YamlParserException);
 
119
 
 
120
        void processStream (void) throw(YamlParserException);
 
121
 
 
122
        void processDocument (void) throw(YamlParserException);
 
123
 
 
124
        void processScalar (YamlNode *topNode) throw(YamlParserException);
 
125
 
 
126
        void processSequence (YamlNode *topNode) throw(YamlParserException);
 
127
 
 
128
        void processMapping (YamlNode *topNode) throw(YamlParserException);
 
129
 
 
130
        void mainNativeDataMapping (MappingNode *map) throw(YamlParserException);
 
131
 
 
132
        /**
 
133
         * Configuration file name
 
134
         */
132
135
        std::string filename;
133
136
 
 
137
        /**
 
138
         * Configuration file descriptor
 
139
         */
134
140
        FILE *fd;
135
141
 
136
142
        /**
141
147
        /**
142
148
         * The event structure array.
143
149
         */
144
 
        yaml_event_t events[PARSER_MAXEVENT];
 
150
        YamlEventVector events;
145
151
 
146
152
        /**
147
153
         *