diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2021-09-22 17:16:30 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2021-09-22 19:59:35 +0200 |
commit | 743e6aa211ccd631c811fb57e2050a5b4e8ffbba (patch) | |
tree | 01f5aa3d99f57d1b32715cdae94b669d7f655e99 /unodevtools/source | |
parent | 924e0774a8201651a762394d51a964a4f8a0c566 (diff) |
Extend loplugin:stringviewparam to starts/endsWith: unodevtools
Change-Id: I89e559d3956bb0b4b59314d55a3ca57d087b8146
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122471
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'unodevtools/source')
-rw-r--r-- | unodevtools/source/unodevtools/options.cxx | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/unodevtools/source/unodevtools/options.cxx b/unodevtools/source/unodevtools/options.cxx index eb34e723c38a..8cd2b652f8b0 100644 --- a/unodevtools/source/unodevtools/options.cxx +++ b/unodevtools/source/unodevtools/options.cxx @@ -20,6 +20,7 @@ #include <stdio.h> #include <codemaker/global.hxx> +#include <o3tl/string_view.hxx> #include <rtl/ustring.hxx> #include <rtl/process.h> #include <sal/log.hxx> @@ -66,12 +67,12 @@ bool readOption( OUString * pValue, const char * pOpt, bool readOption( const char * pOpt, - sal_uInt32 * pnIndex, const OUString & aArg) + sal_uInt32 * pnIndex, std::u16string_view aArg) { OUString aOpt = OUString::createFromAscii(pOpt); - if((aArg.startsWith("-") && aOpt.equalsIgnoreAsciiCase(aArg.subView(1))) || - (aArg.startsWith("--") && aOpt.equalsIgnoreAsciiCase(aArg.subView(2))) ) + if((o3tl::starts_with(aArg, u"-") && aOpt.equalsIgnoreAsciiCase(aArg.substr(1))) || + (o3tl::starts_with(aArg, u"--") && aOpt.equalsIgnoreAsciiCase(aArg.substr(2))) ) { ++(*pnIndex); SAL_INFO("unodevtools", "identified option --" << pOpt); |