summaryrefslogtreecommitdiff
path: root/include/rtl/ustrbuf.hxx
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2021-04-21 11:56:40 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2021-04-21 17:58:54 +0200
commit967da14b48035f5acdd8a604a5c33cc6fe37035a (patch)
tree1fd6ae9b4cdb1c3fa790b56314ea0d0f33eacf16 /include/rtl/ustrbuf.hxx
parentf40bd2c5cca0d6f95e48f60179669a21ac9aa8ca (diff)
string_view conversion operator for O[U]StringBuffer
which will be useful in an upcoming change of mine, so I don't need to construct a temporary from a buffer Change-Id: I1737a725ac5792b7d866d7f2b4c9f9ff7b50dffe Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114397 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'include/rtl/ustrbuf.hxx')
-rw-r--r--include/rtl/ustrbuf.hxx5
1 files changed, 5 insertions, 0 deletions
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 )