strlist.hpp 1008 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. #ifndef _RAR_STRLIST_
  2. #define _RAR_STRLIST_
  3. class StringList
  4. {
  5. private:
  6. Array<char> StringData;
  7. size_t CurPos;
  8. Array<wchar> StringDataW;
  9. size_t CurPosW;
  10. uint StringsCount;
  11. size_t SaveCurPos[16],SaveCurPosW[16],SavePosNumber;
  12. public:
  13. StringList();
  14. void Reset();
  15. void AddString(const char *Str);
  16. void AddString(const wchar *Str);
  17. void AddString(const char *Str,const wchar *StrW);
  18. bool GetString(char *Str,size_t MaxLength);
  19. bool GetString(wchar *Str,size_t MaxLength);
  20. bool GetString(char *Str,wchar *StrW,size_t MaxLength);
  21. bool GetString(char *Str,wchar *StrW,size_t MaxLength,int StringNum);
  22. char* GetString();
  23. wchar* GetStringW();
  24. bool GetString(char **Str,wchar **StrW);
  25. void Rewind();
  26. uint ItemsCount() {return(StringsCount);};
  27. size_t GetCharCount();
  28. bool Search(char *Str,wchar *StrW,bool CaseSensitive);
  29. void SavePosition();
  30. void RestorePosition();
  31. };
  32. #endif