#include "rapidjson/prettywriter.h"
#include <cstdio>
#include <string>
#include <vector>
Go to the source code of this file.
◆ main()
int main |
( |
int | , |
|
|
char * | [] ) |
Definition at line 153 of file serialize.cpp.
153 {
154 std::vector<Employee> employees;
155
156 employees.push_back(
Employee(
"Milo YIP", 34,
true));
157 employees.back().AddDependent(
Dependent(
"Lua YIP", 3,
new Education(
"Happy Kindergarten", 3.5)));
158 employees.back().AddDependent(
Dependent(
"Mio YIP", 1));
159
160 employees.push_back(
Employee(
"Percy TSE", 30,
false));
161
164
165 writer.StartArray();
166 for (std::vector<Employee>::const_iterator employeeItr = employees.begin(); employeeItr != employees.end(); ++employeeItr)
167 employeeItr->Serialize(writer);
168 writer.EndArray();
169
171
172 return 0;
173}
const Ch * GetString() const
Writer with indentation and spacing.