-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathParser.h
48 lines (38 loc) · 1.17 KB
/
Parser.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
/*
* File: Parser.h
* Author: Benjamin
*
* Created on 4 février 2017, 17:52
*/
#ifndef PARSER_H
#define PARSER_H
#include <istream>
#include "Config.h"
#include "IElement.h"
namespace Spatch
{
namespace Parsing
{
class Parser
{
public:
Parser(Spatch::Configuration::Config &conf);
~Parser();
void parse(std::istream &is);
private:
inline std::string &trim(std::string &s);
inline std::string &rtrim(std::string &s);
inline std::string <rim(std::string &s);
Spatch::Parsing::IElement *getElement(std::string &line);
Spatch::Parsing::IElement *createElement(std::string &type, std::string &id);
bool setKeyValueToElement(Spatch::Parsing::IElement *elem, std::string &line);
Spatch::Configuration::Config &_conf;
};
}
}
#endif /* PARSER_H */