e4dbb6125ef1cfbe9bd78fe40f3d440de6345f11
[libi2ncommon] / src / i2n_configfile.hpp
1 /** @file
2  *
3  * contains stuff for simple config files.
4  *
5  * @author Reinhard Pfau \<Reinhard.Pfau@intra2net.com\>
6  * 
7  * @copyright &copy; Copyright 2007-2008 by Intra2net AG
8  * @license commercial
9  *
10  * info@intra2net.com
11  */
12
13 #ifndef __I2N_CONFIGFILE_HPP__
14 #define __I2N_CONFIGFILE_HPP__
15
16 #include <string>
17 #include <istream>
18 #include <boost/function.hpp>
19
20 #include "i2n_configdata.hpp"
21
22 namespace I2n
23 {
24
25
26 /*
27 **
28 */
29
30 typedef boost::function< std::string(const std::string&) > ValueDecoder;
31
32
33 bool load_ini_config_file(
34     const std::string& filename,
35     ConfigData& result,
36     const ValueDecoder& decoder = ValueDecoder()
37 );
38
39
40 bool load_ini_config(
41     std::istream& f,
42     ConfigData& result,
43     const ValueDecoder& decoder = ValueDecoder()
44 );
45
46
47
48 } // eo namespace I2n
49
50 #endif