mirror of
https://github.com/taglib/taglib.git
synced 2025-06-04 01:28:21 -04:00
Add String::clear() method to clear the string.
This commit is contained in:
parent
3128f425b8
commit
1a942627bf
@ -358,6 +358,12 @@ String &String::append(const String &s)
|
||||
return *this;
|
||||
}
|
||||
|
||||
String & String::clear()
|
||||
{
|
||||
*this = String();
|
||||
return *this;
|
||||
}
|
||||
|
||||
String String::upper() const
|
||||
{
|
||||
String s;
|
||||
|
@ -299,6 +299,11 @@ namespace TagLib {
|
||||
*/
|
||||
String &append(const String &s);
|
||||
|
||||
/*!
|
||||
* Clears the string.
|
||||
*/
|
||||
String &clear();
|
||||
|
||||
/*!
|
||||
* Returns an upper case version of the string.
|
||||
*
|
||||
|
@ -67,6 +67,10 @@ public:
|
||||
CPPUNIT_ASSERT(s != L"taglib");
|
||||
CPPUNIT_ASSERT(s != L"taglib string taglib");
|
||||
|
||||
s.clear();
|
||||
CPPUNIT_ASSERT(s.isEmpty());
|
||||
CPPUNIT_ASSERT(!s.isNull());
|
||||
|
||||
String unicode("José Carlos", String::UTF8);
|
||||
CPPUNIT_ASSERT(strcmp(unicode.toCString(), "Jos\xe9 Carlos") == 0);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user