summaryrefslogtreecommitdiff
path: root/include/rtl
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2023-10-13 22:53:16 +0200
committerStephan Bergmann <sbergman@redhat.com>2023-10-15 22:05:17 +0200
commitd3a0815b12c0d040e99e22e53f6574726b868ec7 (patch)
treec57aefa2deaaa7e67cad3b46ed601d9e7ede0769 /include/rtl
parentb4844c310bd9897fef59e8a4da0513100ea86096 (diff)
Drop OStringConstExpr, use constexpr OString instead
Change-Id: Ibb41a27fe7d5456d8db0c98821d5b2acf8586b70 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157949 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'include/rtl')
-rw-r--r--include/rtl/string.hxx38
1 files changed, 0 insertions, 38 deletions
diff --git a/include/rtl/string.hxx b/include/rtl/string.hxx
index 6cc26e7befe3..de468f127757 100644
--- a/include/rtl/string.hxx
+++ b/include/rtl/string.hxx
@@ -153,39 +153,6 @@ public:
};
};
-/**
- This is intended to be used when declaring compile-time-constant structs or arrays
- that can be initialised from named OStringLiteral e.g.
-
- constexpr OStringLiteral AAA = u"aaa";
- constexpr OStringLiteral BBB = u"bbb";
- constexpr OStringConstExpr FOO[] { AAA, BBB };
-*/
-class OString;
-class OStringConstExpr
-{
-public:
- template<std::size_t N> constexpr OStringConstExpr(OStringLiteral<N> const & literal):
- pData(const_cast<rtl_String *>(&literal.str)) {}
-
- // prevent mis-use
- template<std::size_t N> constexpr OStringConstExpr(OStringLiteral<N> && literal)
- = delete;
-
- // no destructor necessary because we know we are pointing at a compile-time
- // constant OStringLiteral, which bypasses ref-counting.
-
- /**
- make it easier to pass to OStringBuffer and similar without casting/converting
- */
- constexpr std::string_view asView() const { return std::string_view(pData->buffer, pData->length); }
-
- inline operator const OString&() const;
-
-private:
- rtl_String* pData;
-};
-
#if !(defined _MSC_VER && _MSC_VER <= 1929 && defined _MANAGED)
namespace detail {
@@ -2287,11 +2254,6 @@ public:
};
#if defined LIBO_INTERNAL_ONLY
-// Can only define this after we define OString
-inline OStringConstExpr::operator const OString &() const { return OString::unacquired(&pData); }
-#endif
-
-#if defined LIBO_INTERNAL_ONLY
inline bool operator ==(OString const & lhs, StringConcatenation<char> const & rhs)
{ return lhs == std::string_view(rhs); }
inline bool operator !=(OString const & lhs, StringConcatenation<char> const & rhs)