Raspberry Pi Weighting Control System
This project serves as a simple weighting control system, that was realized as a Bachelor Thesis
|
Functions | |
int | parse_int (const char *str, int *res) |
int | parse_and_init_int (const char *str, int *dest, int default_val, int max_val=INT_MAX) |
int | parse_and_init_str (std::string &dest, char *str, IniFormat format, const char *default_val) |
int | load_main_config_ini (const char *cfg_path) |
This funciton loads main configuration. _ini symobolizes that the expected format is .ini. More... | |
int | exist_opt_config (const char *cfg_path) |
Checks if optional config exists. More... | |
int | load_opt_config (const char *cfg_path) |
Loads the optional config. More... | |
int | replace_opt_in_opt_config (const char *cfg_path, std::string key, std::string value) |
This is used to replace a values in optional config. More... | |
int config_loader::exist_opt_config | ( | const char * | cfg_path | ) |
Checks if optional config exists.
cfg_path | config file path |
Definition at line 286 of file config_loader.cpp.
int config_loader::load_main_config_ini | ( | const char * | cfg_path | ) |
This funciton loads main configuration. _ini symobolizes that the expected format is .ini.
cfg_path | config file path |
Definition at line 268 of file config_loader.cpp.
int config_loader::load_opt_config | ( | const char * | cfg_path | ) |
Loads the optional config.
cfg_path | config file path |
Definition at line 295 of file config_loader.cpp.
int config_loader::parse_and_init_int | ( | const char * | str, |
int * | dest, | ||
int | default_val, | ||
int | max_val = INT_MAX |
||
) |
calls parse_int. On success dest contains parsing result on failure @default_val is put to dest ** added @max_val to prevent overflows return 0 on success
Definition at line 83 of file config_loader.cpp.
int config_loader::parse_and_init_str | ( | std::string & | dest, |
char * | str, | ||
IniFormat | format, | ||
const char * | default_val | ||
) |
Parses string and if parset string isn't valid (size <= 0) then inits defalt value. @dest is result of parsing. @str is parsed string, @format is library data format, @default_val...
Definition at line 103 of file config_loader.cpp.
int config_loader::parse_int | ( | const char * | str, |
int * | res | ||
) |
parses @str to @res and returns 0 on success, other values on error
Definition at line 51 of file config_loader.cpp.
int config_loader::replace_opt_in_opt_config | ( | const char * | cfg_path, |
std::string | key, | ||
std::string | value | ||
) |
This is used to replace a values in optional config.
cfg_path | config file path |
key | which value is changed |
value | to be set |
Definition at line 352 of file config_loader.cpp.