Woopsi 1.0
GUI Framework for Nintendo DS Homebrew
|
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 00076 protected: 00077 00082 u8 getCodePointSize(); 00083 00088 void iterateForwardsTo(s32 index); 00089 00094 void iterateBackwardsTo(s32 index); 00095 00096 private: 00097 const WoopsiString* _string; 00098 const char* _currentChar; 00099 s32 _currentIndex; 00100 }; 00101 } 00102 00103 #endif