Commit 53b27ac8 authored by Philipp A. Hartmann's avatar Philipp A. Hartmann

GenericReader: improve doxygen documentation

parent ec8f26e6
...@@ -43,6 +43,8 @@ namespace rapidjson { ...@@ -43,6 +43,8 @@ namespace rapidjson {
// ParseFlag // ParseFlag
//! Combination of parseFlags //! Combination of parseFlags
/*! \see Reader::Parse, Document::Parse, Document::ParseInsitu, Document::ParseStream
*/
enum ParseFlag { enum ParseFlag {
kParseDefaultFlags = 0, //!< Default parse flags. Non-destructive parsing. Text strings are decoded into allocated buffer. kParseDefaultFlags = 0, //!< Default parse flags. Non-destructive parsing. Text strings are decoded into allocated buffer.
kParseInsituFlag = 1, //!< In-situ(destructive) parsing. kParseInsituFlag = 1, //!< In-situ(destructive) parsing.
...@@ -257,7 +259,7 @@ template<> inline void SkipWhitespace(StringStream& is) { ...@@ -257,7 +259,7 @@ template<> inline void SkipWhitespace(StringStream& is) {
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
// GenericReader // GenericReader
//! SAX-style JSON parser. Use Reader for UTF8 encoding and default allocator. //! SAX-style JSON parser. Use \ref Reader for UTF8 encoding and default allocator.
/*! GenericReader parses JSON text from a stream, and send events synchronously to an /*! GenericReader parses JSON text from a stream, and send events synchronously to an
object implementing Handler concept. object implementing Handler concept.
...@@ -276,7 +278,7 @@ template<> inline void SkipWhitespace(StringStream& is) { ...@@ -276,7 +278,7 @@ template<> inline void SkipWhitespace(StringStream& is) {
template <typename SourceEncoding, typename TargetEncoding, typename Allocator = MemoryPoolAllocator<> > template <typename SourceEncoding, typename TargetEncoding, typename Allocator = MemoryPoolAllocator<> >
class GenericReader { class GenericReader {
public: public:
typedef typename SourceEncoding::Ch Ch; typedef typename SourceEncoding::Ch Ch; //!< SourceEncoding character type
//! Constructor. //! Constructor.
/*! \param allocator Optional allocator for allocating stack memory. (Only use for non-destructive parsing) /*! \param allocator Optional allocator for allocating stack memory. (Only use for non-destructive parsing)
...@@ -285,12 +287,12 @@ public: ...@@ -285,12 +287,12 @@ public:
GenericReader(Allocator* allocator = 0, size_t stackCapacity = kDefaultStackCapacity) : stack_(allocator, stackCapacity), parseErrorCode_(kParseErrorNone), errorOffset_(0) {} GenericReader(Allocator* allocator = 0, size_t stackCapacity = kDefaultStackCapacity) : stack_(allocator, stackCapacity), parseErrorCode_(kParseErrorNone), errorOffset_(0) {}
//! Parse JSON text. //! Parse JSON text.
/*! \tparam parseFlags Combination of ParseFlag. /*! \tparam parseFlags Combination of \ref ParseFlag.
\tparam InputStream Type of input stream. \tparam InputStream Type of input stream, implementing Stream concept.
\tparam Handler Type of handler which must implement Handler concept. \tparam Handler Type of handler, implementing Handler concept.
\param is Input stream to be parsed. \param is Input stream to be parsed.
\param handler The handler to receive events. \param handler The handler to receive events.
\return Whether the parsing is successful. \return Whether the parsing is successful.
*/ */
template <unsigned parseFlags, typename InputStream, typename Handler> template <unsigned parseFlags, typename InputStream, typename Handler>
bool Parse(InputStream& is, Handler& handler) { bool Parse(InputStream& is, Handler& handler) {
...@@ -321,6 +323,13 @@ public: ...@@ -321,6 +323,13 @@ public:
return !HasParseError(); return !HasParseError();
} }
//! Parse JSON text (with \ref kParseDefaultFlags)
/*! \tparam InputStream Type of input stream, implementing Stream concept
\tparam Handler Type of handler, implementing Handler concept.
\param is Input stream to be parsed.
\param handler The handler to receive events.
\return Whether the parsing is successful.
*/
template <typename InputStream, typename Handler> template <typename InputStream, typename Handler>
bool Parse(InputStream& is, Handler& handler) { bool Parse(InputStream& is, Handler& handler) {
return Parse<kParseDefaultFlags>(is, handler); return Parse<kParseDefaultFlags>(is, handler);
......
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