SettingManager
Functions
-
int setting_log_verbosity(const char *name)
Get the log verbosity by name.
The log verbosity is defined in sc.h and are of the form SC_LP_NAME.
- Parameters:
name – [in] The input name
- Returns:
The ID of the requested log level for libsc.
-
class SettingManager
- #include “SettingManager.h”
Setting manager to handle input setting file.
The setting file can contain variables that define a configuration option. For example, if we set up the Lua file to contain:
settings = { name = “Leroy Jenkins”, age = 66 }
we can then read those values by calling: name = stg_mgr->read_string(“settings.name”) or stg_mgr->read_int(“settings.age”, &age) or stg_mgr->readv_int(“settings.age”, &age) for a verbose mode to terminal
read methods
Read from the setting input file. readv/read -> verbose=T/F
- param key:
[in] The name of the field.
- param preset:
[in] The default to use in case the key does not exist.
- return:
Return the read value or the preset value if not read.
-
int read_int(const char *key, int preset)
-
int readv_int(const char *key, int preset)
-
double read_double(const char *key, double preset)
-
double readv_double(const char *key, double preset)
-
std::string read_string(const char *key, const char *preset)
-
std::string readv_string(const char *key, const char *preset)
-
const char *read_char(const char *key, const char *preset)
-
const char *readv_char(const char *key, const char *preset)