diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2021-11-11 08:04:02 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2021-11-11 10:01:39 +0100 |
commit | 1ef0261539ca6ee8ad9f43d91536c9caa4f7ea53 (patch) | |
tree | cbbd26a27356c7d0ee2019694eab99017173c0c1 /include/rtl/ustring.hxx | |
parent | 2875c65946e59f5dd7968155463bf00bd71d440b (diff) |
Drop the OUString vs. OUStringLiteral comparison operator overloads
...which can be subsumed by their OUString vs. OUString counterparts now that
conversion from OUStringLiteral to OUString is cheap since
e6dfaf9f44f9939abc338c83b3024108431d0f69 "Turn OUStringLiteral into a
consteval'ed, static-refcound rtl_uString". (The only place that needed
adaption was the dubious use of temporary OUStringLiteral instances in
sal/qa/rtl/strings/test_oustring_stringliterals.cxx, which now caused "error:
conversion function from 'rtlunittest::OUStringLiteral<6>' to
'const rtlunittest::OUString' invokes a deleted function".)
Change-Id: I4f0f96efa2d5331ed5cbc9a29bdfdf3c0f4148a7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125020
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'include/rtl/ustring.hxx')
-rw-r--r-- | include/rtl/ustring.hxx | 107 |
1 files changed, 0 insertions, 107 deletions
diff --git a/include/rtl/ustring.hxx b/include/rtl/ustring.hxx index 9a893d3764af..1a5ff2d97d6c 100644 --- a/include/rtl/ustring.hxx +++ b/include/rtl/ustring.hxx @@ -1845,113 +1845,6 @@ public: } #endif -#if defined LIBO_INTERNAL_ONLY - /// @cond INTERNAL - - /* Comparison between OUString and OUStringLiteral. - - @since LibreOffice 5.0 - */ - - template<std::size_t N> - friend bool operator ==(OUString const & lhs, OUStringLiteral<N> const & rhs) { - return - rtl_ustr_reverseCompare_WithLength( - lhs.pData->buffer, lhs.pData->length, rhs.getStr(), rhs.getLength()) - == 0; - } - - template<std::size_t N> - friend bool operator !=(OUString const & lhs, OUStringLiteral<N> const & rhs) { - return - rtl_ustr_reverseCompare_WithLength( - lhs.pData->buffer, lhs.pData->length, rhs.getStr(), rhs.getLength()) - != 0; - } - - template<std::size_t N> - friend bool operator <(OUString const & lhs, OUStringLiteral<N> const & rhs) { - return - (rtl_ustr_compare_WithLength( - lhs.pData->buffer, lhs.pData->length, rhs.getStr(), rhs.getLength())) - < 0; - } - - template<std::size_t N> - friend bool operator <=(OUString const & lhs, OUStringLiteral<N> const & rhs) { - return - (rtl_ustr_compare_WithLength( - lhs.pData->buffer, lhs.pData->length, rhs.getStr(), rhs.getLength())) - <= 0; - } - - template<std::size_t N> - friend bool operator >(OUString const & lhs, OUStringLiteral<N> const & rhs) { - return - (rtl_ustr_compare_WithLength( - lhs.pData->buffer, lhs.pData->length, rhs.getStr(), rhs.getLength())) - > 0; - } - - template<std::size_t N> - friend bool operator >=(OUString const & lhs, OUStringLiteral<N> const & rhs) { - return - (rtl_ustr_compare_WithLength( - lhs.pData->buffer, lhs.pData->length, rhs.getStr(), rhs.getLength())) - >= 0; - } - - template<std::size_t N> - friend bool operator ==(OUStringLiteral<N> const & lhs, OUString const & rhs) { - return - rtl_ustr_reverseCompare_WithLength( - lhs.getStr(), lhs.getLength(), rhs.pData->buffer, rhs.pData->length) - == 0; - } - - template<std::size_t N> - friend bool operator !=(OUStringLiteral<N> const & lhs, OUString const & rhs) { - return - rtl_ustr_reverseCompare_WithLength( - lhs.getStr(), lhs.getLength(), rhs.pData->buffer, rhs.pData->length) - != 0; - } - - template<std::size_t N> - friend bool operator <(OUStringLiteral<N> const & lhs, OUString const & rhs) { - return - (rtl_ustr_compare_WithLength( - lhs.getStr(), lhs.getLength(), rhs.pData->buffer, rhs.pData->length)) - < 0; - } - - template<std::size_t N> - friend bool operator <=(OUStringLiteral<N> const & lhs, OUString const & rhs) { - return - (rtl_ustr_compare_WithLength( - lhs.getStr(), lhs.getLength(), rhs.pData->buffer, rhs.pData->length)) - <= 0; - } - - template<std::size_t N> - friend bool operator >(OUStringLiteral<N> const & lhs, OUString const & rhs) { - return - (rtl_ustr_compare_WithLength( - lhs.getStr(), lhs.getLength(), rhs.pData->buffer, rhs.pData->length)) - > 0; - } - - template<std::size_t N> - friend bool operator >=(OUStringLiteral<N> const & lhs, OUString const & rhs) { - return - (rtl_ustr_compare_WithLength( - lhs.getStr(), lhs.getLength(), rhs.pData->buffer, rhs.pData->length)) - >= 0; - } - - /// @endcond -#endif - /** Returns a hashcode for this string. |