diff options
author | Philipp A. Hartmann <pah@qo.cx> | 2014-07-31 03:45:26 +0400 |
---|---|---|
committer | Philipp A. Hartmann <pah@qo.cx> | 2014-07-31 15:03:32 +0400 |
commit | 6ed9934143bdd5b144b4e38b73950f3ef25b6b1e (patch) | |
tree | bffcfd5486d5c05ce84c3baf88ffb70bb43e2051 /include | |
parent | 11d31aaa7be700e50f97819aa887310460e38484 (diff) |
GenericValue: document Array iterator functions
Diffstat (limited to 'include')
-rw-r--r-- | include/rapidjson/document.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/include/rapidjson/document.h b/include/rapidjson/document.h index f1fa8503..250c33e8 100644 --- a/include/rapidjson/document.h +++ b/include/rapidjson/document.h @@ -919,9 +919,16 @@ int z = a[0u].GetInt(); // This works too. const GenericValue& operator[](SizeType index) const { return const_cast<GenericValue&>(*this)[index]; }
//! Element iterator
+ /*! \pre IsArray() == true */
ValueIterator Begin() { RAPIDJSON_ASSERT(IsArray()); return data_.a.elements; }
+ //! \em Past-the-end element iterator
+ /*! \pre IsArray() == true */
ValueIterator End() { RAPIDJSON_ASSERT(IsArray()); return data_.a.elements + data_.a.size; }
+ //! Constant element iterator
+ /*! \pre IsArray() == true */
ConstValueIterator Begin() const { return const_cast<GenericValue&>(*this).Begin(); }
+ //! Constant \em past-the-end element iterator
+ /*! \pre IsArray() == true */
ConstValueIterator End() const { return const_cast<GenericValue&>(*this).End(); }
//! Request the array to have enough capacity to store elements.
|