plastimatch
Loading...
Searching...
No Matches
parameter_parser.h
Go to the documentation of this file.
1/* -----------------------------------------------------------------------
2 See COPYRIGHT.TXT and LICENSE.TXT for copyright and license information
3 ----------------------------------------------------------------------- */
4#ifndef _parameter_parser_h_
5#define _parameter_parser_h_
6
7#include "plmbase_config.h"
8#include "plm_return_code.h"
9
16public:
18public:
21 std::string default_index;
22public:
23 /* Callbacks */
25 const std::string& section) = 0;
27 const std::string& section) = 0;
29 const std::string& section,
30 const std::string& key,
31 const std::string& index,
32 const std::string& val) = 0;
33
38 void enable_key_regularization (
39 bool enable
40 );
41
45 void allow_empty_values (
46 bool enable
47 );
48
51 void set_default_index (std::string& default_index);
52 void set_default_index (const char *default_index);
53
54 /* Return zero if config string is correctly parsed */
55 Plm_return_code parse_config_string (
56 const char* config_string
57 );
58 Plm_return_code parse_config_string (
59 const std::string& config_string
60 );
61 Plm_return_code parse_config_file (
62 const char* config_fn
63 );
64 Plm_return_code parse_config_file (
65 const std::string& config_fn
66 );
67};
68
69#endif
The Parameter_parser class is an abstract base class which is used to parse ini-style file formats th...
Definition parameter_parser.h:15
virtual Plm_return_code begin_section(const std::string &section)=0
virtual Plm_return_code end_section(const std::string &section)=0
std::string default_index
Definition parameter_parser.h:21
bool key_regularization
Definition parameter_parser.h:19
virtual Plm_return_code set_key_value(const std::string &section, const std::string &key, const std::string &index, const std::string &val)=0
bool empty_values_allowed
Definition parameter_parser.h:20
Plm_return_code
Definition plm_return_code.h:10
#define PLMBASE_API
Definition plmbase_config.h:19