From 73d3dceb86e05e03de1f14f0a6c4fa2d82995f5e Mon Sep 17 00:00:00 2001 From: Marian Krivos Date: Tue, 23 Aug 2011 07:11:28 +0000 Subject: [PATCH] trunk/branch integration: documentation --- Foundation/include/Poco/TextIterator.h | 30 ++++++++++++++++++-------- 1 file changed, 21 insertions(+), 9 deletions(-) diff --git a/Foundation/include/Poco/TextIterator.h b/Foundation/include/Poco/TextIterator.h index 67cbe4c4c..c99cc0a84 100644 --- a/Foundation/include/Poco/TextIterator.h +++ b/Foundation/include/Poco/TextIterator.h @@ -64,12 +64,14 @@ class Foundation_API TextIterator /// int n = 0; /// while (it != end) { ++n; ++it; } /// - /// NOTE: When an UTF-16 encoding is used, surrogate pairs will be - /// reported as two separate characters, due to restrictions of - /// the TextEncoding class. + /// NOTE: When an UTF-16 encoding is used, surrogate pairs will be + /// reported as two separate characters, due to restrictions of + /// the TextEncoding class. + /// + /// For iterating over char buffers, see the TextBufferIterator class. { public: - TextIterator(); + TextIterator(); /// Creates an uninitialized TextIterator. TextIterator(const std::string& str, const TextEncoding& encoding); @@ -114,12 +116,16 @@ public: bool operator == (const TextIterator& it) const; /// Compares two iterators for equality. - bool operator != (const TextIterator& it) const; - /// Compares two iterators for inequality. - + bool operator != (const TextIterator& it) const; + /// Compares two iterators for inequality. + + TextIterator end() const; + /// Returns the end iterator for the range handled + /// by the iterator. + private: - const TextEncoding* _pEncoding; - std::string::const_iterator _it; + const TextEncoding* _pEncoding; + std::string::const_iterator _it; std::string::const_iterator _end; }; @@ -145,6 +151,12 @@ inline void swap(TextIterator& it1, TextIterator& it2) } +inline TextIterator TextIterator::end() const +{ + return TextIterator(_end); +} + + } // namespace Poco