diff --git a/include/rapidjson/reader.h b/include/rapidjson/reader.h index 584ad65..597e6f4 100644 --- a/include/rapidjson/reader.h +++ b/include/rapidjson/reader.h @@ -347,9 +347,9 @@ template<> inline void SkipWhitespace(StringStream& is) { \tparam SourceEncoding Encoding of the input stream. \tparam TargetEncoding Encoding of the parse output. - \tparam Allocator Allocator type for stack. + \tparam StackAllocator Allocator type for stack. */ -template > +template class GenericReader { public: typedef typename SourceEncoding::Ch Ch; //!< SourceEncoding character type @@ -358,7 +358,7 @@ public: /*! \param allocator Optional allocator for allocating stack memory. (Only use for non-destructive parsing) \param stackCapacity stack capacity in bytes for storing a single decoded string. (Only use for non-destructive parsing) */ - GenericReader(Allocator* allocator = 0, size_t stackCapacity = kDefaultStackCapacity) : stack_(allocator, stackCapacity), parseResult_() {} + GenericReader(StackAllocator* stackAllocator = 0, size_t stackCapacity = kDefaultStackCapacity) : stack_(stackAllocator, stackCapacity), parseResult_() {} //! Parse JSON text. /*! \tparam parseFlags Combination of \ref ParseFlag. @@ -591,12 +591,12 @@ private: public: typedef typename TargetEncoding::Ch Ch; - StackStream(internal::Stack& stack) : stack_(stack), length_(0) {} + StackStream(internal::Stack& stack) : stack_(stack), length_(0) {} RAPIDJSON_FORCEINLINE void Put(Ch c) { *stack_.template Push() = c; ++length_; } - internal::Stack& stack_; + internal::Stack& stack_; SizeType length_; private: @@ -1317,7 +1317,7 @@ private: } static const size_t kDefaultStackCapacity = 256; //!< Default stack capacity in bytes for storing a single decoded string. - internal::Stack stack_; //!< A stack for storing decoded string temporarily during non-destructive parsing. + internal::Stack stack_; //!< A stack for storing decoded string temporarily during non-destructive parsing. ParseResult parseResult_; }; // class GenericReader diff --git a/include/rapidjson/writer.h b/include/rapidjson/writer.h index 7927a0c..c844853 100644 --- a/include/rapidjson/writer.h +++ b/include/rapidjson/writer.h @@ -49,10 +49,10 @@ namespace rapidjson { \tparam OutputStream Type of output stream. \tparam SourceEncoding Encoding of source string. \tparam TargetEncoding Encoding of output stream. - \tparam Allocator Type of allocator for allocating memory of stack. + \tparam StackAllocator Type of allocator for allocating memory of stack. \note implements Handler concept */ -template, typename TargetEncoding = UTF8<>, typename Allocator = MemoryPoolAllocator<> > +template, typename TargetEncoding = UTF8<>, typename StackAllocator = CrtAllocator> class Writer { public: typedef typename SourceEncoding::Ch Ch; @@ -62,10 +62,10 @@ public: \param allocator User supplied allocator. If it is null, it will create a private one. \param levelDepth Initial capacity of stack. */ - Writer(OutputStream& os, Allocator* allocator = 0, size_t levelDepth = kDefaultLevelDepth) : - os_(&os), level_stack_(allocator, levelDepth * sizeof(Level)), hasRoot_(false) {} + Writer(OutputStream& os, StackAllocator* stackAllocator = 0, size_t levelDepth = kDefaultLevelDepth) : + os_(&os), level_stack_(stackAllocator, levelDepth * sizeof(Level)), hasRoot_(false) {} - Writer(Allocator* allocator = 0, size_t levelDepth = kDefaultLevelDepth) : + Writer(StackAllocator* allocator = 0, size_t levelDepth = kDefaultLevelDepth) : os_(0), level_stack_(allocator, levelDepth * sizeof(Level)), hasRoot_(false) {} //! Reset the writer with a new stream. @@ -327,7 +327,7 @@ protected: } OutputStream* os_; - internal::Stack level_stack_; + internal::Stack level_stack_; bool hasRoot_; private: