libcmutils 0.6.5
Multi-platform C99 utility library
Loading...
Searching...
No Matches
CMUTIL_Config Struct Reference

Configuration management object. More...

Data Fields

void(* Save )(const CMUTIL_Config *conf, const char *path)
 Save the configuration to a file.
 
const char *(* Get )(const CMUTIL_Config *conf, const char *key)
 Get a configuration value as a string.
 
void(* Set )(CMUTIL_Config *conf, const char *key, const char *value)
 Set a configuration value as a string.
 
long(* GetLong )(const CMUTIL_Config *conf, const char *key)
 Get a configuration value as a long integer.
 
void(* SetLong )(CMUTIL_Config *conf, const char *key, long value)
 Set a configuration value as a long integer.
 
double(* GetDouble )(const CMUTIL_Config *conf, const char *key)
 Get a configuration value as a double.
 
void(* SetDouble )(CMUTIL_Config *conf, const char *key, double value)
 Set a configuration value as a double.
 
CMBool(* GetBoolean )(const CMUTIL_Config *conf, const char *key)
 Get a configuration value as a boolean.
 
void(* SetBoolean )(CMUTIL_Config *conf, const char *key, CMBool value)
 Set a configuration value as a boolean.
 
void(* Destroy )(CMUTIL_Config *conf)
 Destroy the configuration object and free its resources.
 

Detailed Description

Configuration management object.

Field Documentation

◆ Save

void(* CMUTIL_Config::Save) (const CMUTIL_Config *conf, const char *path)

Save the configuration to a file.

Parameters
confA pointer to the CMUTIL_Config object.
pathThe file path where the configuration will be saved.

◆ Get

const char *(* CMUTIL_Config::Get) (const CMUTIL_Config *conf, const char *key)

Get a configuration value as a string.

Parameters
confA pointer to the CMUTIL_Config object.
keyThe configuration key.
Returns
The configuration value as a C-style string, or NULL if the key does not exist.

◆ Set

void(* CMUTIL_Config::Set) (CMUTIL_Config *conf, const char *key, const char *value)

Set a configuration value as a string.

Parameters
confA pointer to the CMUTIL_Config object.
keyThe configuration key.
valueThe configuration value to set.

◆ GetLong

long(* CMUTIL_Config::GetLong) (const CMUTIL_Config *conf, const char *key)

Get a configuration value as a long integer.

Parameters
confA pointer to the CMUTIL_Config object.
keyThe configuration key.
Returns
The configuration value as a long integer.

◆ SetLong

void(* CMUTIL_Config::SetLong) (CMUTIL_Config *conf, const char *key, long value)

Set a configuration value as a long integer.

Parameters
confA pointer to the CMUTIL_Config object.
keyThe configuration key.
valueThe configuration value to set.

◆ GetDouble

double(* CMUTIL_Config::GetDouble) (const CMUTIL_Config *conf, const char *key)

Get a configuration value as a double.

Parameters
confA pointer to the CMUTIL_Config object.
keyThe configuration key.
Returns
The configuration value as a double.

◆ SetDouble

void(* CMUTIL_Config::SetDouble) (CMUTIL_Config *conf, const char *key, double value)

Set a configuration value as a double.

Parameters
confA pointer to the CMUTIL_Config object.
keyThe configuration key.
valueThe configuration value to set.

◆ GetBoolean

CMBool(* CMUTIL_Config::GetBoolean) (const CMUTIL_Config *conf, const char *key)

Get a configuration value as a boolean.

Parameters
confA pointer to the CMUTIL_Config object.
keyThe configuration key.
Returns
The configuration value as a boolean.

◆ SetBoolean

void(* CMUTIL_Config::SetBoolean) (CMUTIL_Config *conf, const char *key, CMBool value)

Set a configuration value as a boolean.

Parameters
confA pointer to the CMUTIL_Config object.
keyThe configuration key.
valueThe configuration value to set.

◆ Destroy

void(* CMUTIL_Config::Destroy) (CMUTIL_Config *conf)

Destroy the configuration object and free its resources.

Parameters
confA pointer to the CMUTIL_Config object to be destroyed.

The documentation for this struct was generated from the following file: