diff options
author | miloyip <miloyip@gmail.com> | 2015-05-08 17:18:46 +0300 |
---|---|---|
committer | miloyip <miloyip@gmail.com> | 2015-05-08 17:18:46 +0300 |
commit | 771fa9879a8c290e34a53bb8e9374119f76e4d2d (patch) | |
tree | e3351c7c9d3990da4c638e9ba01ec3a8dd137bf6 /include/rapidjson/pointer.h | |
parent | 5dee394004088cbfac1ecc80102a8353c0db8281 (diff) |
Add Pointer::Append(Value, Allocator) overload
Diffstat (limited to 'include/rapidjson/pointer.h')
-rw-r--r-- | include/rapidjson/pointer.h | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/include/rapidjson/pointer.h b/include/rapidjson/pointer.h index adb819e4..a8d0094a 100644 --- a/include/rapidjson/pointer.h +++ b/include/rapidjson/pointer.h @@ -273,6 +273,21 @@ public: } } + //! Append a token by value, and return a new Pointer + /*! + \param value Value (either Uint or String) to be appended. + \param allocator Allocator for the newly return Pointer. + \return A new Pointer with appended token. + */ + GenericPointer Append(const ValueType& token, Allocator* allocator = 0) const { + if (token.IsString()) + return Append(token.GetString(), token.GetStringLength(), allocator); + else { + RAPIDJSON_ASSERT(token.IsUint64()); + return Append(static_cast<SizeType>(token.GetUint64()), allocator); + } + } + //!@name Handling Parse Error //@{ |