aboutsummaryrefslogtreecommitdiffstats
path: root/samples/c++/sample1.cpp
diff options
context:
space:
mode:
authorJonathan McCrohan <jmccrohan@gmail.com>2011-12-01 22:56:23 +0000
committerJonathan McCrohan <jmccrohan@gmail.com>2011-12-01 22:56:23 +0000
commit429e46051dba814e7d6c74368eb1bba550222cbe (patch)
treeed1dd43cd23c69f156aae2165006a16a66262cef /samples/c++/sample1.cpp
parent58bf1382be0cbcf3f9649286fd2719b789a1595f (diff)
downloadlibconfig-429e46051dba814e7d6c74368eb1bba550222cbe.tar.gz
Imported Upstream version 1.4.8upstream/1.4.8
Diffstat (limited to 'samples/c++/sample1.cpp')
-rw-r--r--samples/c++/sample1.cpp47
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;
-}
-
-/***************************************************************************/