mirror of
https://github.com/taglib/taglib.git
synced 2025-05-27 21:20:26 -04:00
Add methods to check if this string is Latin1/ASCII compatible.
git-svn-id: svn://anonsvn.kde.org/home/kde/trunk/kdesupport/taglib@768593 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
This commit is contained in:
parent
3f19588bb1
commit
bdad22b3c6
@ -461,6 +461,24 @@ String String::stripWhiteSpace() const
|
||||
return String(wstring(begin, end + 1));
|
||||
}
|
||||
|
||||
bool String::isLatin1() const
|
||||
{
|
||||
for(wstring::const_iterator it = d->data.begin(); it != d->data.end(); it++) {
|
||||
if(*it >= 256)
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
bool String::isAscii() const
|
||||
{
|
||||
for(wstring::const_iterator it = d->data.begin(); it != d->data.end(); it++) {
|
||||
if(*it >= 128)
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
String String::number(int n) // static
|
||||
{
|
||||
if(n == 0)
|
||||
|
@ -292,6 +292,16 @@ namespace TagLib {
|
||||
*/
|
||||
String stripWhiteSpace() const;
|
||||
|
||||
/*!
|
||||
* Returns true if the file only uses characters required by Latin1.
|
||||
*/
|
||||
bool isLatin1() const;
|
||||
|
||||
/*!
|
||||
* Returns true if the file only uses characters required by (7-bit) ASCII.
|
||||
*/
|
||||
bool isAscii() const;
|
||||
|
||||
/*!
|
||||
* Converts the base-10 integer \a n to a string.
|
||||
*/
|
||||
|
Loading…
Reference in New Issue
Block a user