summaryrefslogtreecommitdiff
path: root/include/rtl/strbuf.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/strbuf.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/strbuf.hxx')
-rw-r--r--include/rtl/strbuf.hxx4
1 files changed, 4 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 )