Added overloaded functions for default parseFlags

Can write d.Parse(...) instead of d.Parse<0>(...)
Hope to reduce strangeness and confusion for beginner.
This commit is contained in:
Milo Yip
2014-06-29 15:03:38 +08:00
parent 6f306755d5
commit 1d14748bc9
9 changed files with 34 additions and 16 deletions

View File

@@ -8,7 +8,7 @@ using namespace rapidjson;
TEST(Document, Parse) {
Document doc;
doc.Parse<0>(" { \"hello\" : \"world\", \"t\" : true , \"f\" : false, \"n\": null, \"i\":123, \"pi\": 3.1416, \"a\":[1, 2, 3, 4] } ");
doc.Parse(" { \"hello\" : \"world\", \"t\" : true , \"f\" : false, \"n\": null, \"i\":123, \"pi\": 3.1416, \"a\":[1, 2, 3, 4] } ");
EXPECT_TRUE(doc.IsObject());
@@ -59,7 +59,7 @@ struct OutputStringStream : public std::ostringstream {
TEST(Document, AcceptWriter) {
Document doc;
doc.Parse<0>(" { \"hello\" : \"world\", \"t\" : true , \"f\" : false, \"n\": null, \"i\":123, \"pi\": 3.1416, \"a\":[1, 2, 3, 4] } ");
doc.Parse(" { \"hello\" : \"world\", \"t\" : true , \"f\" : false, \"n\": null, \"i\":123, \"pi\": 3.1416, \"a\":[1, 2, 3, 4] } ");
OutputStringStream os;
Writer<OutputStringStream> writer(os);