summaryrefslogtreecommitdiff
path: root/include/rtl/ustring.hxx
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2019-01-10 11:21:45 +0100
committerStephan Bergmann <sbergman@redhat.com>2019-01-10 22:22:29 +0100
commit6856da30665705be6380e84cf55de954c41f15d1 (patch)
treea6e42bf0d65a180498a267490164fddb391f4235 /include/rtl/ustring.hxx
parentf0856d3c6115163da837c141b69ab017b8f1fd81 (diff)
o3tl::string_view -> std::string_view (in embedserv)
Change-Id: I32bba8f45ff3b77084aa2d416126f96c051022f4 Reviewed-on: https://gerrit.libreoffice.org/66073 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'include/rtl/ustring.hxx')
-rw-r--r--include/rtl/ustring.hxx11
1 files changed, 11 insertions, 0 deletions
diff --git a/include/rtl/ustring.hxx b/include/rtl/ustring.hxx
index c6e3760838ce..35e0ca7756be 100644
--- a/include/rtl/ustring.hxx
+++ b/include/rtl/ustring.hxx
@@ -24,6 +24,7 @@
#include <cassert>
#include <cstddef>
+#include <limits>
#include <new>
#include <ostream>
#include <utility>
@@ -410,6 +411,16 @@ public:
}
#endif
+#if defined LIBO_INTERNAL_ONLY
+ OUString(std::u16string_view sv) {
+ if (sv.size() > sal_uInt32(std::numeric_limits<sal_Int32>::max())) {
+ throw std::bad_alloc();
+ }
+ pData = nullptr;
+ rtl_uString_newFromStr_WithLength(&pData, sv.data(), sv.size());
+ }
+#endif
+
/**
Release the string data.
*/