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
39 bool enable
40 );
41
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 */
56 const char* config_string
57 );
59 const std::string& config_string
60 );
62 const char* config_fn
63 );
65 const std::string& config_fn
66 );
67};
68
69#endif
void set_default_index(std::string &default_index)
Choose what index is passed to set_key_value() when no index is found in the file....
Definition parameter_parser.cxx:136
virtual Plm_return_code begin_section(const std::string &section)=0
Plm_return_code parse_config_file(const char *config_fn)
Definition parameter_parser.cxx:158
void enable_key_regularization(bool enable)
Key regularization convert the key field to lowercase and changes hyphens to underscores....
Definition parameter_parser.cxx:120
void allow_empty_values(bool enable)
If a key does not have an equal sign, it will be considered a syntax error unless empty values are al...
Definition parameter_parser.cxx:128
virtual Plm_return_code end_section(const std::string &section)=0
std::string default_index
Definition parameter_parser.h:21
Parameter_parser()
Definition parameter_parser.cxx:19
bool key_regularization
Definition parameter_parser.h:19
Plm_return_code parse_config_string(const char *config_string)
Definition parameter_parser.cxx:26
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