AnCH Framework 0.1
Another C++ Hack Framework
 
Loading...
Searching...
No Matches
configurationFileParser.hpp
1/*
2 ANCH Framework: ANother C++ Hack is a C++ framework based on C++11 standard
3 Copyright (C) 2012 Vincent Lachenal
4
5 This file is part of ANCH Framework.
6
7 ANCH Framework is free software: you can redistribute it and/or modify
8 it under the terms of the GNU Lesser General Public License as published by
9 the Free Software Foundation, either version 3 of the License, or
10 (at your option) any later version.
11
12 ANCH Framework is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU Lesser General Public License for more details.
16
17 You should have received a copy of the GNU Lesser General Public License
18 along with ANCH Framework. If not, see <http://www.gnu.org/licenses/>.
19*/
20#pragma once
21
22#include <map>
23#include <regex>
24
25#include "resourceFileException.hpp"
26#include "resource/section.hpp"
27
29
44 private:
45 // Attributes +
47 static const std::regex _sectionPattern;
48
50 static const std::regex _optionPattern;
51
53 static const std::regex _commentPattern;
54
56 std::string _filePath;
57 // Attributes -
58
59 public:
60 // Constructors +
66 ConfigurationFileParser(const std::string& filePath);
67 // Constructors -
68
69 // Destructor +
74 // Destructor -
75
76 public:
82 void getConfiguration(std::map<std::string,anch::resource::Section>& config) const;
83
84 private:
92 void parseLine(const std::string& line,
93 std::string& currentSection,
94 std::map<std::string,anch::resource::Section>& config) const;
95
96 };
97
98}
ConfigurationFileParser(const std::string &filePath)
void getConfiguration(std::map< std::string, anch::resource::Section > &config) const
File resources namespace.
Definition configurationFileParser.hpp:28