aboutsummaryrefslogtreecommitdiffstats
path: root/tests/configtest.cpp
blob: b616cd567aedf196414f896f2a35b2ae757fd625 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#include <iostream>
#include <swconfig.h>
#ifndef NO_SWORD_NAMESPACE
using sword::SWConfig;
#endif

int main(int argc, char **argv) {
    SWConfig config("./test1.conf");
    config["Section1"]["Entry1"] = "Value1";
    config["Section1"]["Entry2"] = "oops";
    config["Section1"]["Entry2"] = "Value2";
    config.Save();
    SWConfig config2("./test1.conf");
    std::cout << "Should be Value2: " << config2["Section1"]["Entry2"] << std::endl;
    return 0;
}