19#define USING_CONFIG_FILE(fileName) \
20 if (ksf::misc::ksConfig config_file{ksf::misc::ksConfig(fileName)})
42 ksConfig(
const std::string& fileName);
55 void setParam(
const std::string& paramName,
const std::string paramValue);
63 const std::string&
getParam(
const std::string& paramName,
const std::string& defaultValue = std::string())
const;
69 operator bool()
const;
Implements low-level configuration file handling.
Definition ksConfig.h:31
virtual ~ksConfig()
Saves config content on the device filesystem. In case there is no modification, nothing should actua...
Definition ksConfig.cpp:80
const std::string & getParam(const std::string ¶mName, const std::string &defaultValue=std::string()) const
Retrieves parameter value.
Definition ksConfig.cpp:104
std::string configPath
Config filename.
Definition ksConfig.h:35
std::map< std::string, std::string > configParams
Config parameters.
Definition ksConfig.h:34
void setParam(const std::string ¶mName, const std::string paramValue)
Sets parameter value (creates new parameter if it does not exist).
Definition ksConfig.cpp:98
ksConfig(const std::string &fileName)
Constructor tha opens or creates configuration file.
Definition ksConfig.cpp:19
bool isDirty
True if config contents has been modified (and should be saved).
Definition ksConfig.h:33