diff options
author | Jonathan McCrohan <jmccrohan@gmail.com> | 2011-12-01 23:47:41 +0000 |
---|---|---|
committer | Jonathan McCrohan <jmccrohan@gmail.com> | 2011-12-01 23:47:41 +0000 |
commit | 1eaceca55c7e62892fd28bfbb5fc03240a48cee3 (patch) | |
tree | 7243fcd09c57e06e72b15f0044fd2c77babd7843 /samples/c++/sample1.cpp | |
parent | d4b5ddf4bcacd692011f5a597025c38a1262d6ca (diff) | |
parent | 429e46051dba814e7d6c74368eb1bba550222cbe (diff) | |
download | libconfig-1eaceca55c7e62892fd28bfbb5fc03240a48cee3.tar.gz |
Merge commit 'upstream/1.4.8'
Conflicts:
debian/changelog
debian/control
debian/libconfig++9-dev.install
debian/libconfig8.install
debian/libconfig9-dev.install
debian/rules
Diffstat (limited to '')
-rw-r--r-- | samples/c++/sample1.cpp | 47 |
1 files changed, 0 insertions, 47 deletions
diff --git a/samples/c++/sample1.cpp b/samples/c++/sample1.cpp deleted file mode 100644 index 7344838..0000000 --- a/samples/c++/sample1.cpp +++ /dev/null @@ -1,47 +0,0 @@ -/************************************************************************* - ** Sample1 - ** Load sample.cfg and increment the "X" setting - *************************************************************************/ - -#include <iostream> -#include <libconfig.h++> - -using namespace libconfig; -using namespace std; - -/***************************************************************************/ - -int main() -{ - Config cfg; - - try - { - /* Load the configuration.. */ - cout << "loading [sample.cfg].."; - cfg.readFile("sample.cfg"); - cout << "ok" << endl; - - /* Increment "x" */ - cout << "increment \"x\".."; - Setting& s = cfg.lookup("x"); - long x = s; - s = ++x; - cout << "ok (x=" << x << ")" << endl; - - // Save the configuration - cout << "saving [sample.cfg].."; - cfg.writeFile("sample.cfg"); - cout << "ok" << endl; - - cout << "Done!" << endl; - } - catch (...) - { - cout << "failed" << endl; - } - - return 0; -} - -/***************************************************************************/ |