forked from qt-creator/qt-creator
Sqlite: Add endsWith to UtfString
Change-Id: I82ea54a1e23625690192a967b5f33451cdc199af Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
This commit is contained in:
@@ -153,6 +153,11 @@ bool Utf8String::startsWith(char character) const
|
|||||||
return byteArray.startsWith(character);
|
return byteArray.startsWith(character);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool Utf8String::endsWith(const Utf8String &text) const
|
||||||
|
{
|
||||||
|
return byteArray.endsWith(text.byteArray);
|
||||||
|
}
|
||||||
|
|
||||||
bool Utf8String::isEmpty() const
|
bool Utf8String::isEmpty() const
|
||||||
{
|
{
|
||||||
return byteArray.isEmpty();
|
return byteArray.isEmpty();
|
||||||
|
|||||||
@@ -82,6 +82,7 @@ public:
|
|||||||
bool startsWith(const Utf8String &text) const;
|
bool startsWith(const Utf8String &text) const;
|
||||||
bool startsWith(const char *text) const;
|
bool startsWith(const char *text) const;
|
||||||
bool startsWith(char character) const;
|
bool startsWith(char character) const;
|
||||||
|
bool endsWith(const Utf8String &text) const;
|
||||||
bool isEmpty() const;
|
bool isEmpty() const;
|
||||||
bool hasContent() const;
|
bool hasContent() const;
|
||||||
|
|
||||||
|
|||||||
@@ -176,6 +176,13 @@ TEST(Utf8, StartsWith)
|
|||||||
ASSERT_FALSE(text.startsWith('@'));
|
ASSERT_FALSE(text.startsWith('@'));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
TEST(Utf8, EndsWith)
|
||||||
|
{
|
||||||
|
Utf8String text(Utf8StringLiteral("/my/path"));
|
||||||
|
|
||||||
|
ASSERT_TRUE(text.endsWith(Utf8StringLiteral("path")));
|
||||||
|
}
|
||||||
|
|
||||||
TEST(Utf8, Clear)
|
TEST(Utf8, Clear)
|
||||||
{
|
{
|
||||||
Utf8String text(Utf8StringLiteral("$column"));
|
Utf8String text(Utf8StringLiteral("$column"));
|
||||||
|
|||||||
Reference in New Issue
Block a user