diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2022-04-21 13:59:07 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2022-04-22 13:28:35 +0200 |
commit | 25ada1e520b50247aa27fdbb6f1ab35e678c7ef9 (patch) | |
tree | 84273aee328c778cfbd166d52d4e1a9fefeb4bf9 /cppuhelper/source/paths.cxx | |
parent | 9820f11ad2b1ef32e5527eec519b0a7c766e2602 (diff) |
use more string_view in cppuhelper
Change-Id: I846a1201b1b4fb8ca694a0b78b7d4cc2973dfbd2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133258
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'cppuhelper/source/paths.cxx')
-rw-r--r-- | cppuhelper/source/paths.cxx | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/cppuhelper/source/paths.cxx b/cppuhelper/source/paths.cxx index b6a1e12600dd..ece7650ded4c 100644 --- a/cppuhelper/source/paths.cxx +++ b/cppuhelper/source/paths.cxx @@ -28,6 +28,7 @@ #include <osl/module.hxx> #include <rtl/ustring.hxx> #include <sal/types.h> +#include <o3tl/string_view.hxx> #include "paths.hxx" @@ -108,18 +109,18 @@ bool cppu::nextDirectoryItem(osl::Directory & directory, OUString * url) { } } -void cppu::decodeRdbUri(OUString * uri, bool * optional, bool * directory) +void cppu::decodeRdbUri(std::u16string_view * uri, bool * optional, bool * directory) { assert(uri != nullptr && optional != nullptr && directory != nullptr); - if(!(uri->isEmpty())) + if(!(uri->empty())) { *optional = (*uri)[0] == '?'; if (*optional) { - *uri = uri->copy(1); + *uri = uri->substr(1); } - *directory = uri->startsWith("<") && uri->endsWith(">*"); + *directory = o3tl::starts_with(*uri, u"<") && o3tl::ends_with(*uri, u">*"); if (*directory) { - *uri = uri->copy(1, uri->getLength() - 3); + *uri = uri->substr(1, uri->size() - 3); } } else |