Closed nickhuangxinyu closed 2 years ago
can i readFile for several times like this
readFiles
clears the config (libconfig.c): The values from "a.cfg" will be discarded, when calling readFiles
a second time.
You can use @include:
A configuration file may “include” the contents of other files using an include directive. This directive has the effect of inlining the contents of the named file(s) at the point of inclusion.
See also the option Config::OptionAllowOverrides, which allows you to include configuration files that override already existing settings.
@thomastrapp thanks very much.
@inlcude is cool, can you teach me about, where can i find all @ wildcards setting (for example: @include, @...) for libconfig?
Assume I have a
libconfig::config
object, can ireadFile
for several times like this:and what will happen if a.cfg and b.cfg have same key?
If this doesnt work, is there any methods can let me merge two config files' setting into one object?