xdgcfg  0.2.2
example.cpp
#include <iostream>
#include <libconfig.h++>
#include "xdgcfg.hpp"
int main(int argc, char *argv[])
{
xdgcfg config("test.cfg", "xdgcfg");
config.set_verbose(true);
if (config.read() != 0)
{
config.write();
}
libconfig::Config &cfg = config.get_cfg();
libconfig::Setting &root = cfg.getRoot();
if (!root.exists("Hello"))
{
root.add("Hello", libconfig::Setting::TypeString) = "World";
}
config.write();
std::cout << "Hello: " << root["Hello"].c_str() << std::endl;
}