Wire Sysio Wire Sysion 1.0.0
Loading...
Searching...
No Matches
simplepullreader.cpp File Reference
#include "rapidjson/reader.h"
#include <iostream>
#include <sstream>
Include dependency graph for simplepullreader.cpp:

Go to the source code of this file.

Classes

struct  MyHandler
 

Functions

template<typename T >
std::string stringify (T x)
 
int main ()
 

Function Documentation

◆ main()

int main ( void )

Definition at line 40 of file simplepullreader.cpp.

40 {
41 const char json[] = " { \"hello\" : \"world\", \"t\" : true , \"f\" : false, \"n\": null, \"i\":123, \"pi\": 3.1416, \"a\":[1, 2, 3, 4] } ";
42
43 MyHandler handler;
44 Reader reader;
45 StringStream ss(json);
46 reader.IterativeParseInit();
47 while (!reader.IterativeParseComplete()) {
49 cout << handler.type << handler.data << endl;
50 }
51
52 return 0;
53}
bool IterativeParseNext(InputStream &is, Handler &handler)
Parse one token from JSON text.
Definition reader.h:618
void IterativeParseInit()
Initialize JSON text token-by-token parsing.
Definition reader.h:605
RAPIDJSON_FORCEINLINE bool IterativeParseComplete() const
Check if token-by-token parsing JSON text is complete.
Definition reader.h:675
static const Segment ss(Segment::ss)
@ kParseDefaultFlags
Default parse flags. Can be customized by defining RAPIDJSON_PARSE_DEFAULT_FLAGS.
Definition reader.h:156
Read-only string stream.
Definition stream.h:154
std::string data
const char * type
Here is the call graph for this function:

◆ stringify()

template<typename T >
std::string stringify ( T x)

Definition at line 9 of file simplepullreader.cpp.

9 {
10 std::stringstream ss;
11 ss << x;
12 return ss.str();
13}
Here is the caller graph for this function: