summaryrefslogtreecommitdiff
path: root/src/test_MicroJSON.cc
blob: d8d4969093422b65c7be0f377880bc0f635ccea2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#include <iostream>
#include <fstream>
#include <string>

/*
 * http://grigory.info/MicroJSON.About.html
 *
 */
#include "MicroJSON-0.3.2/Node.h"

using namespace std;


int
main(int argc, char** argv)
{
  ifstream ifs(argv[1]);
  string json_str((istreambuf_iterator<char>(ifs)),
                   (istreambuf_iterator<char>()));

  MicroJSON::Node Root;
  Root.Parse(json_str);
  MicroJSON::Node* edges = Root.GetSubNode("edges");
  cerr << edges->GetChildren().back()->GetSubNode("rule") << endl;

  return 0;
}