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

@@ -19,14 +19,14 @@ int main(int, char*[]) {
#if 0
// "normal" parsing, decode strings to new buffers. Can use other input stream via ParseStream().
if (document.Parse<0>(json).HasParseError())
if (document.Parse(json).HasParseError())
return 1;
#else
// In-situ parsing, decode strings directly in the source string. Source must be string.
{
char buffer[sizeof(json)];
memcpy(buffer, json, sizeof(json));
if (document.ParseInsitu<0>(buffer).HasParseError())
if (document.ParseInsitu(buffer).HasParseError())
return 1;
}
#endif