13#include <unordered_map>
37 std::unordered_map<std::string, std::unordered_map<std::string, VK_ConfigItem>> values;
38 std::string file_name;
48 explicit VK_Config(
const std::string &filePath);
65 VK_ConfigItem itemAtKey(
const std::string §ion,
const std::string &key,
const std::string &default_value =
"")
const;
73 void setItem(
const std::string §ion,
const std::string &key,
const std::string &value);
87 void saveFile(
const std::string &f2);
94 std::vector<std::string>
splitByComma(
const std::string &str)
const;
A single key/value pair read from a configuration file.
std::string value
Value associated with the key.
std::string key
Configuration key name.
Parses and manages an INI-style configuration file.
std::vector< std::string > splitByComma(const std::string &str) const
Split a string on comma delimiters.
void saveFile(const std::string &f2)
Save the current configuration to a file.
VK_Config(const VK_Config &)=delete
void loadFile(const std::string &f)
Load (or reload) a configuration file from disk.
VK_Config & operator=(VK_Config &&)=delete
VK_ConfigItem itemAtKey(const std::string §ion, const std::string &key, const std::string &default_value="") const
Retrieve a configuration item by section and key.
~VK_Config()
Destructor — closes any open file resources.
VK_Config(VK_Config &&)=delete
VK_Config & operator=(const VK_Config &)=delete
VK_Config()=default
Default constructor — no file loaded.
void setItem(const std::string §ion, const std::string &key, const std::string &value)
Insert or update a configuration item.
Utilities for loading and saving PNG images.