Commit e7f1c6dd authored by miloyip's avatar miloyip

Remove an invalid Document::ParseInsitu() API

parent 35d0577e
...@@ -84,29 +84,25 @@ template <typename InputStream> ...@@ -84,29 +84,25 @@ template <typename InputStream>
GenericDocument& GenericDocument::ParseStream(InputStream& is); GenericDocument& GenericDocument::ParseStream(InputStream& is);
// (4) In situ parsing // (4) In situ parsing
template <unsigned parseFlags, typename SourceEncoding>
GenericDocument& GenericDocument::ParseInsitu(Ch* str);
// (5) In situ parsing, using same Encoding of Document
template <unsigned parseFlags> template <unsigned parseFlags>
GenericDocument& GenericDocument::ParseInsitu(Ch* str); GenericDocument& GenericDocument::ParseInsitu(Ch* str);
// (6) In situ parsing, using default parse flags // (5) In situ parsing, using default parse flags
GenericDocument& GenericDocument::ParseInsitu(Ch* str); GenericDocument& GenericDocument::ParseInsitu(Ch* str);
// (7) Normal parsing of a string // (6) Normal parsing of a string
template <unsigned parseFlags, typename SourceEncoding> template <unsigned parseFlags, typename SourceEncoding>
GenericDocument& GenericDocument::Parse(const Ch* str); GenericDocument& GenericDocument::Parse(const Ch* str);
// (8) Normal parsing of a string, using same Encoding of Document // (7) Normal parsing of a string, using same Encoding of Document
template <unsigned parseFlags> template <unsigned parseFlags>
GenericDocument& GenericDocument::Parse(const Ch* str); GenericDocument& GenericDocument::Parse(const Ch* str);
// (9) Normal parsing of a string, using default parse flags // (8) Normal parsing of a string, using default parse flags
GenericDocument& GenericDocument::Parse(const Ch* str); GenericDocument& GenericDocument::Parse(const Ch* str);
~~~~~~~~~~ ~~~~~~~~~~
The examples of [tutorial](doc/tutorial.md) uses (9) for normal parsing of string. The examples of [stream](doc/stream.md) uses the first three. *In situ* parsing will be described soon. The examples of [tutorial](doc/tutorial.md) uses (8) for normal parsing of string. The examples of [stream](doc/stream.md) uses the first three. *In situ* parsing will be described soon.
The `parseFlags` are combination of the following bit-flags: The `parseFlags` are combination of the following bit-flags:
......
...@@ -84,29 +84,25 @@ template <typename InputStream> ...@@ -84,29 +84,25 @@ template <typename InputStream>
GenericDocument& GenericDocument::ParseStream(InputStream& is); GenericDocument& GenericDocument::ParseStream(InputStream& is);
// (4) 原位解析 // (4) 原位解析
template <unsigned parseFlags, typename SourceEncoding>
GenericDocument& GenericDocument::ParseInsitu(Ch* str);
// (5) 原位解析,使用Document的编码
template <unsigned parseFlags> template <unsigned parseFlags>
GenericDocument& GenericDocument::ParseInsitu(Ch* str); GenericDocument& GenericDocument::ParseInsitu(Ch* str);
// (6) 原位解析,使用缺省标志 // (5) 原位解析,使用缺省标志
GenericDocument& GenericDocument::ParseInsitu(Ch* str); GenericDocument& GenericDocument::ParseInsitu(Ch* str);
// (7) 正常解析一个字符串 // (6) 正常解析一个字符串
template <unsigned parseFlags, typename SourceEncoding> template <unsigned parseFlags, typename SourceEncoding>
GenericDocument& GenericDocument::Parse(const Ch* str); GenericDocument& GenericDocument::Parse(const Ch* str);
// (8) 正常解析一个字符串,使用Document的编码 // (7) 正常解析一个字符串,使用Document的编码
template <unsigned parseFlags> template <unsigned parseFlags>
GenericDocument& GenericDocument::Parse(const Ch* str); GenericDocument& GenericDocument::Parse(const Ch* str);
// (9) 正常解析一个字符串,使用缺省标志 // (8) 正常解析一个字符串,使用缺省标志
GenericDocument& GenericDocument::Parse(const Ch* str); GenericDocument& GenericDocument::Parse(const Ch* str);
~~~~~~~~~~ ~~~~~~~~~~
[教程](tutorial.md)中的例使用(9)去正常解析字符串。而[](stream.md)的例子使用前3个函数。我们将稍后介绍原位(*In situ*) 解析。 [教程](tutorial.md)中的例使用(8)去正常解析字符串。而[](stream.md)的例子使用前3个函数。我们将稍后介绍原位(*In situ*) 解析。
`parseFlags`是以下位标置的组合: `parseFlags`是以下位标置的组合:
......
...@@ -1770,18 +1770,6 @@ public: ...@@ -1770,18 +1770,6 @@ public:
//!@name Parse in-place from mutable string //!@name Parse in-place from mutable string
//!@{ //!@{
//! Parse JSON text from a mutable string (with Encoding conversion)
/*! \tparam parseFlags Combination of \ref ParseFlag.
\tparam SourceEncoding Transcoding from input Encoding
\param str Mutable zero-terminated string to be parsed.
\return The document itself for fluent API.
*/
template <unsigned parseFlags, typename SourceEncoding>
GenericDocument& ParseInsitu(Ch* str) {
GenericInsituStringStream<Encoding> s(str);
return ParseStream<parseFlags | kParseInsituFlag, SourceEncoding>(s);
}
//! Parse JSON text from a mutable string //! Parse JSON text from a mutable string
/*! \tparam parseFlags Combination of \ref ParseFlag. /*! \tparam parseFlags Combination of \ref ParseFlag.
\param str Mutable zero-terminated string to be parsed. \param str Mutable zero-terminated string to be parsed.
...@@ -1789,7 +1777,8 @@ public: ...@@ -1789,7 +1777,8 @@ public:
*/ */
template <unsigned parseFlags> template <unsigned parseFlags>
GenericDocument& ParseInsitu(Ch* str) { GenericDocument& ParseInsitu(Ch* str) {
return ParseInsitu<parseFlags, Encoding>(str); GenericInsituStringStream<Encoding> s(str);
return ParseStream<parseFlags | kParseInsituFlag, SourceEncoding>(s);
} }
//! Parse JSON text from a mutable string (with \ref kParseDefaultFlags) //! Parse JSON text from a mutable string (with \ref kParseDefaultFlags)
...@@ -1797,7 +1786,7 @@ public: ...@@ -1797,7 +1786,7 @@ public:
\return The document itself for fluent API. \return The document itself for fluent API.
*/ */
GenericDocument& ParseInsitu(Ch* str) { GenericDocument& ParseInsitu(Ch* str) {
return ParseInsitu<kParseDefaultFlags, Encoding>(str); return ParseInsitu<kParseDefaultFlags>(str);
} }
//!@} //!@}
......
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