diff options
author | Jean-Francois Mauguit <jfmauguit@mac.com> | 2024-09-24 09:03:25 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-09-24 09:03:25 -0400 |
commit | bab614c421ed7ae329d26bf028c4a3b1d2450f5a (patch) | |
tree | 12f17f78986871dd2cfb0a56e5e93b545c1ae0d0 /Src/Wasabi/bfc/string/playstring.h | |
parent | 4bde6044fddf053f31795b9eaccdd2a5a527d21f (diff) | |
parent | 20d28e80a5c861a9d5f449ea911ab75b4f37ad0d (diff) | |
download | winamp-bab614c421ed7ae329d26bf028c4a3b1d2450f5a.tar.gz |
Merge pull request #5 from WinampDesktop/community
Merge to main
Diffstat (limited to 'Src/Wasabi/bfc/string/playstring.h')
-rw-r--r-- | Src/Wasabi/bfc/string/playstring.h | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/Src/Wasabi/bfc/string/playstring.h b/Src/Wasabi/bfc/string/playstring.h new file mode 100644 index 00000000..2e9b183f --- /dev/null +++ b/Src/Wasabi/bfc/string/playstring.h @@ -0,0 +1,49 @@ +#ifndef _PLAYSTRING_H +#define _PLAYSTRING_H + +#include <bfc/common.h> +#include <bfc/string/StringW.h> + +class Playstring +{ +public: + Playstring(const wchar_t *val=NULL); + Playstring(const Playstring &ps); + ~Playstring(); + + const wchar_t *getValue() const { return val; } + operator const wchar_t *() const { return getValue(); } + + void setValue(const wchar_t *newval); + + // copy + Playstring& operator =(const Playstring &ps); + +protected: + void _setValue(const wchar_t *newval, int tablenum); + +private: + const wchar_t *val; +}; + +class PlaystringComparator { +public: + // comparator for sorting + static int compareItem(Playstring *p1, Playstring* p2) { + return wcscmp(p1->getValue(), p2->getValue()); + } +}; + +template <int tablenum=0> +class PlaystringT : public Playstring { +public: + PlaystringT(const wchar_t *newval) { + val = NULL; setValue(newval); + } + PlaystringT(const Playstring &ps) { + val = NULL; setValue(ps.getValue()); + } + void setValue(const wchar_t *newval) { _setValue(newval, tablenum); } +}; + +#endif |