Woopsi 1.3
Nintendo DS Gui Framework
libwoopsi/include/stringiterator.h
00001 #ifndef _STRING_ITERATOR_H_
00002 #define _STRING_ITERATOR_H_
00003 
00004 #include <nds.h>
00005 
00006 namespace WoopsiUI {
00007     
00008     class WoopsiString;
00009     
00017     class StringIterator {
00018     public:
00019 
00025         StringIterator(const WoopsiString* string);
00026 
00030         inline ~StringIterator() { };
00031         
00035         void moveToFirst();
00036 
00040         void moveToLast();
00041 
00047         bool moveToNext();
00048 
00054         bool moveToPrevious();
00055 
00062         bool moveTo(s32 index);
00063         
00068         inline s32 getIndex() const { return _currentIndex; };
00069 
00074         u32 getCodePoint() const;
00075 
00084         u32 getInteger(u32* charCount = NULL);
00085         
00086     protected:
00087 
00092         u8 getCodePointSize();
00093 
00098         void iterateForwardsTo(s32 index);
00099 
00104         void iterateBackwardsTo(s32 index);
00105         
00106     private:
00107         const WoopsiString* _string;        
00108         const char* _currentChar;           
00109         s32 _currentIndex;                  
00110     };
00111 }
00112 
00113 #endif
 All Classes Functions Variables Enumerations Enumerator