diff options
author | Patrick Simianer <p@simianer.de> | 2014-08-16 21:25:52 +0100 |
---|---|---|
committer | Patrick Simianer <p@simianer.de> | 2014-08-16 21:25:52 +0100 |
commit | 9a0859212de4d1304f9392fe910921227421c8c3 (patch) | |
tree | 1b1276312c83415d7d7d3838ce0347441b71951a /test_nosjob.cc | |
parent | 3ba77e3474e39d7970784812f6851a726572f7c7 (diff) |
cleanup
Diffstat (limited to 'test_nosjob.cc')
-rw-r--r-- | test_nosjob.cc | 32 |
1 files changed, 0 insertions, 32 deletions
diff --git a/test_nosjob.cc b/test_nosjob.cc deleted file mode 100644 index cf8891f..0000000 --- a/test_nosjob.cc +++ /dev/null @@ -1,32 +0,0 @@ -#include <iostream> -#include <fstream> -#include <string> - -/* - * http://fossil.wanderinghorse.net/repos/nosjob/index.cgi/index - * - */ -#include "nosjob-e1d67401fcda6e05/include/wh/nosjob/nosjob.hpp" - -using namespace std; - - -int -main(int argc, char** argv) -{ - ifstream ifs(argv[1]); - string json_str((istreambuf_iterator<char>(ifs)), - (istreambuf_iterator<char>())); - - nosjob::Atom root = nosjob::JsonParser().parse(json_str); - nosjob::Object o = nosjob::Object::cast(root); - nosjob::Atom edges = o.get(nosjob::Utf8String("edges")); - nosjob::Array a = nosjob::Array::cast(edges); - nosjob::Object last_edge = nosjob::Object::cast(a.get(a.size()-1)); - nosjob::Utf8String s = nosjob::Utf8String::cast(last_edge.get(nosjob::Utf8String("rule"))); - string t((char*)s.c_str()); - cerr << t.substr(1, 4) << endl; - - return 0; -} - |