summaryrefslogtreecommitdiff
path: root/include/rtl
diff options
context:
space:
mode:
Diffstat (limited to 'include/rtl')
-rw-r--r--include/rtl/string.hxx7
-rw-r--r--include/rtl/ustring.hxx8
2 files changed, 15 insertions, 0 deletions
diff --git a/include/rtl/string.hxx b/include/rtl/string.hxx
index cac60d34d8e6..b26aa23e556a 100644
--- a/include/rtl/string.hxx
+++ b/include/rtl/string.hxx
@@ -28,6 +28,10 @@
#include <ostream>
#include <string.h>
+#if defined LIBO_INTERNAL_ONLY
+#include <string_view>
+#endif
+
#include "rtl/textenc.h"
#include "rtl/string.h"
#include "rtl/stringutils.hxx"
@@ -1787,6 +1791,9 @@ public:
return number(d);
}
+#if defined LIBO_INTERNAL_ONLY
+ operator std::string_view() const { return {getStr(), sal_uInt32(getLength())}; }
+#endif
};
/* ======================================================================= */
diff --git a/include/rtl/ustring.hxx b/include/rtl/ustring.hxx
index 5f738cfaa5fc..bf63efc71723 100644
--- a/include/rtl/ustring.hxx
+++ b/include/rtl/ustring.hxx
@@ -27,6 +27,10 @@
#include <new>
#include <ostream>
+#if defined LIBO_INTERNAL_ONLY
+#include <string_view>
+#endif
+
#include "rtl/ustring.h"
#include "rtl/string.hxx"
#include "rtl/stringutils.hxx"
@@ -3544,6 +3548,10 @@ public:
return OUString( pNew, SAL_NO_ACQUIRE );
}
+#if defined LIBO_INTERNAL_ONLY
+ operator std::u16string_view() const { return {getStr(), sal_uInt32(getLength())}; }
+#endif
+
private:
OUString & internalAppend( rtl_uString* pOtherData )
{