MCPcopy Create free account
hub / github.com/Tencent/rapidjson / Education

Class Education

example/serialize/serialize.cpp:45–70  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

43}
44
45class Education {
46public:
47 Education(const std::string& school, double GPA) : school_(school), GPA_(GPA) {}
48 Education(const Education& rhs) : school_(rhs.school_), GPA_(rhs.GPA_) {}
49
50 template <typename Writer>
51 void Serialize(Writer& writer) const {
52 writer.StartObject();
53
54 writer.String("school");
55#if RAPIDJSON_HAS_STDSTRING
56 writer.String(school_);
57#else
58 writer.String(school_.c_str(), static_cast<SizeType>(school_.length()));
59#endif
60
61 writer.String("GPA");
62 writer.Double(GPA_);
63
64 writer.EndObject();
65 }
66
67private:
68 std::string school_;
69 double GPA_;
70};
71
72class Dependent : public Person {
73public:

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected