26 #ifndef TAGLIB_STRING_H 27 #define TAGLIB_STRING_H 43 #if defined(QT_VERSION) && (QT_VERSION >= 0x040000) 44 #define QStringToTString(s) TagLib::String(s.toUtf8().data(), TagLib::String::UTF8) 46 #define QStringToTString(s) TagLib::String((s).utf8().data(), TagLib::String::UTF8) 59 #define TStringToQString(s) QString::fromUtf8((s).toCString(true)) 86 #ifndef DO_NOT_DOCUMENT 87 using Iterator = std::wstring::iterator;
88 using ConstIterator = std::wstring::const_iterator;
138 String(
const std::string &s, Type t = Latin1);
143 String(
const std::wstring &s);
148 String(
const std::wstring &s, Type t);
158 String(
const wchar_t *s, Type t);
166 String(
char c, Type t = Latin1);
171 String(
wchar_t c, Type t = Latin1);
179 String(
const char *s, Type t = Latin1);
197 std::string to8Bit(
bool unicode =
false)
const;
206 std::wstring toWString()
const;
226 const char *toCString(
bool unicode =
false)
const;
244 const wchar_t *toCWString()
const;
254 ConstIterator begin()
const;
259 ConstIterator cbegin()
const;
271 ConstIterator end()
const;
277 ConstIterator cend()
const;
283 int find(
const String &s,
int offset = 0)
const;
290 int rfind(
const String &s,
int offset = -1)
const;
300 bool startsWith(
const String &s)
const;
306 String substr(
unsigned int position,
unsigned int n = 0xffffffff)
const;
329 unsigned int size()
const;
334 unsigned int length()
const;
339 bool isEmpty()
const;
360 int toInt(
bool *ok =
nullptr)
const;
369 long long toLongLong(
bool *ok =
nullptr,
int base = 10)
const;
378 unsigned long long toULongLong(
bool *ok =
nullptr,
int base = 10)
const;
383 String stripWhiteSpace()
const;
388 bool isLatin1()
const;
393 bool isAscii()
const;
398 static String number(
int n);
403 static String fromLongLong(
long long n);
408 static String fromULongLong(
unsigned long long n);
413 wchar_t &operator[](
int i);
418 const wchar_t &operator[](
int i)
const;
424 bool operator==(
const String &s)
const;
430 bool operator!=(
const String &s)
const;
436 bool operator==(
const char *s)
const;
442 bool operator!=(
const char *s)
const;
448 bool operator==(
const wchar_t *s)
const;
454 bool operator!=(
const wchar_t *s)
const;
464 String &operator+=(
const wchar_t* s);
469 String &operator+=(
const char* s);
474 String &operator+=(
wchar_t c);
479 String &operator+=(
char c);
490 String &operator=(
const std::string &s);
495 String &operator=(
const std::wstring &s);
500 String &operator=(
const wchar_t *s);
505 String &operator=(
char c);
510 String &operator=(
wchar_t c);
515 String &operator=(
const char *s);
525 void swap(
String &s) noexcept;
532 bool operator<(
const String &s)
const;
545 std::shared_ptr<StringPrivate> d;
TAGLIB_EXPORT std::ostream & operator<<(std::ostream &s, const TagLib::ByteVector &v)
A wide string class suitable for unicode.
Definition: tstring.h:82
A byte vector.
Definition: tbytevector.h:45
#define TAGLIB_MSVC_SUPPRESS_WARNING_NEEDS_TO_HAVE_DLL_INTERFACE
Definition: taglib_export.h:55
A list of strings.
Definition: tstringlist.h:43
#define TAGLIB_EXPORT
Definition: taglib_export.h:40
Type
Definition: tstring.h:96
TAGLIB_EXPORT TagLib::String operator+(const TagLib::String &s1, const TagLib::String &s2)
A namespace for all TagLib related classes and functions.
Definition: apefile.h:41