#include "rapidjson/reader.h"
#include "rapidjson/error/en.h"
#include <iostream>
#include <string>
#include <map>
Go to the source code of this file.
◆ MessageMap
◆ main()
Definition at line 89 of file messagereader.cpp.
92 const char* json1 =
"{ \"greeting\" : \"Hello!\", \"farewell\" : \"bye-bye!\" }";
93 cout << json1 << endl;
94 ParseMessages(json1, messages);
96 for (MessageMap::const_iterator itr = messages.begin(); itr != messages.end(); ++itr)
97 cout << itr->first <<
": " << itr->second << endl;
99 cout << endl <<
"Parse a JSON with invalid schema." << endl;
100 const char* json2 =
"{ \"greeting\" : \"Hello!\", \"farewell\" : \"bye-bye!\", \"foo\" : {} }";
101 cout << json2 << endl;
102 ParseMessages(json2, messages);
map< string, string > MessageMap