0

Assume I have a libconfig::config object, can i readFile for several times like this:

libconfig::Config cfg;
cfg.readFiles("./a.cfg");
cfg.readFiles("./b.cfg");

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?

nick
  • 832
  • 3
  • 12

1 Answers1

0

At first, it seems that method is readFile() not readFiles() unless I'm checking incorrect library.

Second, everytime readFile() is called, values in config will be reset. So after cfg.readFiles("./b.cfg"); you will not have a.cfg configuration anymore.

Afshin
  • 8,839
  • 1
  • 18
  • 53