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;
365 String stripWhiteSpace()
const;
370 bool isLatin1()
const;
375 bool isAscii()
const;
380 static String number(
int n);
385 static String fromLongLong(
long long n);
390 wchar_t &operator[](
int i);
395 const wchar_t &operator[](
int i)
const;
401 bool operator==(
const String &s)
const;
407 bool operator!=(
const String &s)
const;
413 bool operator==(
const char *s)
const;
419 bool operator!=(
const char *s)
const;
425 bool operator==(
const wchar_t *s)
const;
431 bool operator!=(
const wchar_t *s)
const;
441 String &operator+=(
const wchar_t* s);
446 String &operator+=(
const char* s);
451 String &operator+=(
wchar_t c);
456 String &operator+=(
char c);
467 String &operator=(
const std::string &s);
472 String &operator=(
const std::wstring &s);
477 String &operator=(
const wchar_t *s);
482 String &operator=(
char c);
487 String &operator=(
wchar_t c);
492 String &operator=(
const char *s);
502 void swap(
String &s) noexcept;
509 bool operator<(
const String &s)
const;
522 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