Berserk
|
Key-values based config file in plist
style.
More...
#include <Config.hpp>
Public Member Functions | |
BRK_API | Config () |
BRK_API | ~Config () |
BRK_API bool | Open (const String &filepath) |
Open config file path with specified path. More... | |
BRK_API int32 | GetProperty (const StringName §ion, const StringName &key, int32 defaultValue) const |
Read property int32 from the config. More... | |
BRK_API uint32 | GetProperty (const StringName §ion, const StringName &key, uint32 defaultValue) const |
Read property uint32 from the config. More... | |
BRK_API float | GetProperty (const StringName §ion, const StringName &key, float defaultValue) const |
Read property float from the config. More... | |
BRK_API String | GetProperty (const StringName §ion, const StringName &key, const String &defaultValue) const |
Read property string from the config. More... | |
BRK_API const String & | GetFilepath () const |
BRK_API bool | IsOpen () const |
Key-values based config file in plist
style.
|
default |
|
default |
const String & Config::GetFilepath | ( | ) | const |
String Config::GetProperty | ( | const StringName & | section, |
const StringName & | key, | ||
const String & | defaultValue | ||
) | const |
Read property string from the config.
section | Section name where to look for value |
key | Key of the value |
defaultValue | Default value returned if failed to get value from config |
defaultValue
float Config::GetProperty | ( | const StringName & | section, |
const StringName & | key, | ||
float | defaultValue | ||
) | const |
Read property float from the config.
section | Section name where to look for value |
key | Key of the value |
defaultValue | Default value returned if failed to get value from config |
defaultValue
int32 Config::GetProperty | ( | const StringName & | section, |
const StringName & | key, | ||
int32 | defaultValue | ||
) | const |
Read property int32 from the config.
section | Section name where to look for value |
key | Key of the value |
defaultValue | Default value returned if failed to get value from config |
defaultValue
uint32 Config::GetProperty | ( | const StringName & | section, |
const StringName & | key, | ||
uint32 | defaultValue | ||
) | const |
Read property uint32 from the config.
section | Section name where to look for value |
key | Key of the value |
defaultValue | Default value returned if failed to get value from config |
defaultValue
|
inline |
bool Config::Open | ( | const String & | filepath | ) |
Open config file path with specified path.
Attempts to open config file specified in the filepath variable. Path can be absolute or relative, config will use default file system search paths to find config file on the disk.
Accepts config files in .config.xml
format.
filepath | Path to the config file |