Remove unused comphelper::string::reverseString overload
Change-Id: Ic1c56c7be9804685fd37b8f6a13aaab039e07afa Reviewed-on: https://gerrit.libreoffice.org/c/core/+/141361 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
This commit is contained in:
@@ -178,9 +178,9 @@ void TestString::testTokenCount()
|
|||||||
|
|
||||||
void TestString::testReverseString()
|
void TestString::testReverseString()
|
||||||
{
|
{
|
||||||
OString aOut = ::comphelper::string::reverseString("ABC");
|
OUString aOut = ::comphelper::string::reverseString(u"ABC");
|
||||||
|
|
||||||
CPPUNIT_ASSERT_EQUAL(OString("CBA"), aOut);
|
CPPUNIT_ASSERT_EQUAL(OUString("CBA"), aOut);
|
||||||
}
|
}
|
||||||
|
|
||||||
void TestString::testSplit()
|
void TestString::testSplit()
|
||||||
|
@@ -518,29 +518,16 @@ bool isdigitAsciiString(std::u16string_view rString)
|
|||||||
[](sal_Unicode c){ return rtl::isAsciiDigit(c); });
|
[](sal_Unicode c){ return rtl::isAsciiDigit(c); });
|
||||||
}
|
}
|
||||||
|
|
||||||
namespace
|
|
||||||
{
|
|
||||||
template <typename T, typename I, typename O> T tmpl_reverseString(I rIn)
|
|
||||||
{
|
|
||||||
if (rIn.empty())
|
|
||||||
return T();
|
|
||||||
|
|
||||||
typename I::size_type i = rIn.size();
|
|
||||||
O sBuf(static_cast<sal_Int32>(i));
|
|
||||||
while (i)
|
|
||||||
sBuf.append(rIn[--i]);
|
|
||||||
return sBuf.makeStringAndClear();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
OUString reverseString(std::u16string_view rStr)
|
OUString reverseString(std::u16string_view rStr)
|
||||||
{
|
{
|
||||||
return tmpl_reverseString<OUString, std::u16string_view, OUStringBuffer>(rStr);
|
if (rStr.empty())
|
||||||
}
|
return OUString();
|
||||||
|
|
||||||
OString reverseString(std::string_view rStr)
|
std::size_t i = rStr.size();
|
||||||
{
|
OUStringBuffer sBuf(static_cast<sal_Int32>(i));
|
||||||
return tmpl_reverseString<OString, std::string_view, OStringBuffer>(rStr);
|
while (i)
|
||||||
|
sBuf.append(rStr[--i]);
|
||||||
|
return sBuf.makeStringAndClear();
|
||||||
}
|
}
|
||||||
|
|
||||||
sal_Int32 indexOfAny(std::u16string_view rIn,
|
sal_Int32 indexOfAny(std::u16string_view rIn,
|
||||||
|
@@ -157,13 +157,6 @@ COMPHELPER_DLLPUBLIC sal_Int32 getTokenCount(std::u16string_view rIn, sal_Unicod
|
|||||||
*/
|
*/
|
||||||
COMPHELPER_DLLPUBLIC OUString reverseString(std::u16string_view rStr);
|
COMPHELPER_DLLPUBLIC OUString reverseString(std::u16string_view rStr);
|
||||||
|
|
||||||
/** Reverse an OString
|
|
||||||
|
|
||||||
@param rIn the input OString
|
|
||||||
@return the reversed input
|
|
||||||
*/
|
|
||||||
COMPHELPER_DLLPUBLIC OString reverseString(std::string_view rStr);
|
|
||||||
|
|
||||||
|
|
||||||
namespace detail
|
namespace detail
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user