MIDAS
Loading...
Searching...
No Matches
mjson_test.cxx File Reference
#include <stdio.h>
#include <unistd.h>
#include "mjson.h"
Include dependency graph for mjson_test.cxx:

Go to the source code of this file.

Functions

int main (int argc, char *argv[])
 

Function Documentation

◆ main()

int main ( int  argc,
char argv[] 
)

Definition at line 5 of file mjson_test.cxx.

6{
7 std::string sin;
8
9 while (1) {
10 char buf[100];
11 int rd = read(0, buf, sizeof(buf)-1);
12 if (rd <= 0)
13 break;
14 buf[rd] = 0;
15 sin += buf;
16 }
17
18 //printf("Input string:\n");
19 //printf("%s\n", sin.c_str());
20
21 MJsonNode* n = MJsonNode::Parse(sin.c_str());
22 if (n==NULL) {
23 printf("Parse returned NULL!\n");
24 return 1;
25 }
26 n->Dump();
27 std::string sout = n->Stringify();
28 printf("Output JSON:\n");
29 printf("%s\n", sout.c_str());
30 delete n;
31 return 0;
32}
DWORD n[4]
Definition mana.cxx:247
#define read(n, a, f)
TH1X EXPRT * h1_book(const char *name, const char *title, int bins, double min, double max)
Definition rmidas.h:24
Here is the call graph for this function: