summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/rtl/strbuf.hxx4
-rw-r--r--include/rtl/ustrbuf.hxx5
2 files changed, 9 insertions, 0 deletions
diff --git a/include/rtl/strbuf.hxx b/include/rtl/strbuf.hxx
index 5bdf072a7777..a238f305fa07 100644
--- a/include/rtl/strbuf.hxx
+++ b/include/rtl/strbuf.hxx
@@ -248,6 +248,10 @@ public:
{}
#endif
+#if defined LIBO_INTERNAL_ONLY
+ operator std::string_view() const { return {getStr(), sal_uInt32(getLength())}; }
+#endif
+
/** Assign to this a copy of value.
*/
OStringBuffer& operator = ( const OStringBuffer& value )
diff --git a/include/rtl/ustrbuf.hxx b/include/rtl/ustrbuf.hxx
index 170b76908dff..65762d53960d 100644
--- a/include/rtl/ustrbuf.hxx
+++ b/include/rtl/ustrbuf.hxx
@@ -253,6 +253,11 @@ public:
rtl_uStringbuffer_newFromStr_WithLength( &pData, n.buf, n.length );
}
#endif
+
+#if defined LIBO_INTERNAL_ONLY
+ operator std::u16string_view() const { return {getStr(), sal_uInt32(getLength())}; }
+#endif
+
/** Assign to this a copy of value.
*/
OUStringBuffer& operator = ( const OUStringBuffer& value )