From 343c5152c05e8475da81e28dd7bae7b926c73127 Mon Sep 17 00:00:00 2001 From: Max Horn Date: Sun, 15 May 2005 13:20:52 +0000 Subject: Added String::iterator svn-id: r18105 --- common/str.h | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'common') diff --git a/common/str.h b/common/str.h index 4ca744193d..5c04f85f59 100644 --- a/common/str.h +++ b/common/str.h @@ -87,6 +87,26 @@ public: void toLowercase(); void toUppercase(); +public: + typedef char * iterator; + typedef const char * const_iterator; + + iterator begin() { + return _str; + } + + iterator end() { + return begin() + size(); + } + + const_iterator begin() const { + return _str; + } + + const_iterator end() const { + return begin() + size(); + } + protected: void ensureCapacity(int new_len, bool keep_old); void decRefCount(); -- cgit v1.2.3