plastimatch
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | List of all members
Parameter_parser Class Referenceabstract

The Parameter_parser class is an abstract base class which is used to parse ini-style file formats that control the registration, mabs, and dose calculation codes. More...

#include <parameter_parser.h>

Public Member Functions

 Parameter_parser ()
 
virtual Plm_return_code begin_section (const std::string &section)=0
 
virtual Plm_return_code end_section (const std::string &section)=0
 
virtual Plm_return_code set_key_value (const std::string &section, const std::string &key, const std::string &index, const std::string &val)=0
 
void enable_key_regularization (bool enable)
 Key regularization convert the key field to lowercase and changes hyphens to underscores. Only the key is modified. Pass in "true" to enable key regularization, or "false" to disable it. Default is "true".
 
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 allowed.
 
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. Default is "".
 
void set_default_index (const char *default_index)
 
Plm_return_code parse_config_string (const char *config_string)
 
Plm_return_code parse_config_string (const std::string &config_string)
 
Plm_return_code parse_config_file (const char *config_fn)
 
Plm_return_code parse_config_file (const std::string &config_fn)
 

Public Attributes

bool key_regularization
 
bool empty_values_allowed
 
std::string default_index
 

Detailed Description

The Parameter_parser class is an abstract base class which is used to parse ini-style file formats that control the registration, mabs, and dose calculation codes.

Constructor & Destructor Documentation

◆ Parameter_parser()

Parameter_parser::Parameter_parser ( )

Member Function Documentation

◆ allow_empty_values()

void Parameter_parser::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 allowed.

◆ begin_section()

virtual Plm_return_code Parameter_parser::begin_section ( const std::string &  section)
pure virtual

◆ enable_key_regularization()

void Parameter_parser::enable_key_regularization ( bool  enable)

Key regularization convert the key field to lowercase and changes hyphens to underscores. Only the key is modified. Pass in "true" to enable key regularization, or "false" to disable it. Default is "true".

◆ end_section()

virtual Plm_return_code Parameter_parser::end_section ( const std::string &  section)
pure virtual

◆ parse_config_file() [1/2]

Plm_return_code Parameter_parser::parse_config_file ( const char config_fn)

◆ parse_config_file() [2/2]

Plm_return_code Parameter_parser::parse_config_file ( const std::string &  config_fn)

◆ parse_config_string() [1/2]

Plm_return_code Parameter_parser::parse_config_string ( const char config_string)

◆ parse_config_string() [2/2]

Plm_return_code Parameter_parser::parse_config_string ( const std::string &  config_string)

◆ set_default_index() [1/2]

void Parameter_parser::set_default_index ( const char default_index)

◆ set_default_index() [2/2]

void Parameter_parser::set_default_index ( std::string &  default_index)

Choose what index is passed to set_key_value() when no index is found in the file. Default is "".

◆ set_key_value()

virtual Plm_return_code Parameter_parser::set_key_value ( const std::string &  section,
const std::string &  key,
const std::string &  index,
const std::string &  val 
)
pure virtual

Member Data Documentation

◆ default_index

std::string Parameter_parser::default_index

◆ empty_values_allowed

bool Parameter_parser::empty_values_allowed

◆ key_regularization

bool Parameter_parser::key_regularization

The documentation for this class was generated from the following files: