2 * Copyright (C) 2015, 2016 ,2017 "IoT.bzh"
3 * Author "Loïc Collignon" <loic.collignon@iot.bzh>
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
9 * http://www.apache.org/licenses/LICENSE-2.0
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
18 #ifndef INI_CONFIG_HPP
19 #define INI_CONFIG_HPP
27 // Représente un fichier de configuration.
31 using map = std::map<std::string, std::string>;
33 void read_file(const std::string& filename);
35 map get_keys(const std::string& section);
36 std::string get_value(const std::string& section, const std::string& key);
38 typename map::size_type size() const { return config_.size(); }
39 typename map::iterator begin() { return config_.begin(); }
40 typename map::iterator end() { return config_.end(); }
41 typename map::const_iterator cbegin() const { return config_.cbegin(); }
42 typename map::const_iterator cend() const { return config_.cend(); }
43 typename map::reverse_iterator rbegin() { return config_.rbegin(); }
44 typename map::reverse_iterator rend() { return config_.rend(); }
45 typename map::const_reverse_iterator crbegin() const { return config_.crbegin(); }
46 typename map::const_reverse_iterator crend() const { return config_.crend(); }
58 line_type qualify(std::string& line);
61 #endif // INI_CONFIG_HPP