DKUtil::Config
An all purpose configuration module for x64 native plugin projects, supports ini
, json
and toml
file types out of box. No more handling these settings on our own, use simplied API from this library!
Workflow
The configuration module in DKUtil works as "proxy per file", each Proxy
represents one specific configuration file and manages the subsequent Bind
, Load
, Write
, and Generate
calls to this file and its bound Data
.
- Declare
Data
with key names. - Initialize a
Proxy
for a config file on system. - Binds the
Data
toProxy
with default values. - Use
Proxy
to load/regenerate/output the boundData
. - Use updated
Data
in code.
Usage
The entire module is behind the namespace DKUtil::Config
or dku::Config
. To use, include the header:
cpp
#include "DKUtil/Config.hpp"
Config Lookup Path
By default the config file lookup directory is the current working path.
The relative path CONFIG_ENTRY
can be defined before including.
cpp
#define CONFIG_ENTRY "configs\\"
// this translates to "process_cwd/configs/"
#include "DKUtil/Config.hpp"