Commit a045314f authored by Milo Yip's avatar Milo Yip

Merge pull request #576 from ChrisLundquist/patch-1

[simplewriter.cpp] show generated output
parents 7886965e d175915c
...@@ -9,12 +9,12 @@ int main() { ...@@ -9,12 +9,12 @@ int main() {
StringBuffer s; StringBuffer s;
Writer<StringBuffer> writer(s); Writer<StringBuffer> writer(s);
writer.StartObject(); writer.StartObject(); // writer expects subsequent key/value pairs.
writer.String("hello"); writer.String("hello"); // key
writer.String("world"); writer.String("world"); // value
writer.String("t"); writer.String("t"); // key
writer.Bool(true); writer.Bool(true); // value
writer.String("f"); writer.String("f"); // etc...
writer.Bool(false); writer.Bool(false);
writer.String("n"); writer.String("n");
writer.Null(); writer.Null();
...@@ -29,6 +29,7 @@ int main() { ...@@ -29,6 +29,7 @@ int main() {
writer.EndArray(); writer.EndArray();
writer.EndObject(); writer.EndObject();
// {"hello":"world","t":true,"f":false,"n":null,"i":123,"pi":3.1416,"a":[0,1,2,3]}
cout << s.GetString() << endl; cout << s.GetString() << endl;
return 0; return 0;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment