summaryrefslogtreecommitdiff
path: root/idlc
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2021-09-22 22:19:43 +0200
committerStephan Bergmann <sbergman@redhat.com>2021-09-23 07:27:14 +0200
commit4706eb93350b2613b1fe6b98afa1243415c40577 (patch)
treecc6fc582dae595e3db107234bb73901b287a989b /idlc
parent310d43b9a27efc36f2c9e6737a0b5ac3f211bda0 (diff)
Extend loplugin:stringviewparam to starts/endsWith: idlc
Change-Id: Ib9c97576746b6acfddeacec658a2ae994aa28516 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122497 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'idlc')
-rw-r--r--idlc/inc/idlc.hxx2
-rw-r--r--idlc/source/astscope.cxx6
-rw-r--r--idlc/source/idlccompile.cxx5
3 files changed, 8 insertions, 5 deletions
diff --git a/idlc/inc/idlc.hxx b/idlc/inc/idlc.hxx
index 8995ead72de4..1be11b1457da 100644
--- a/idlc/inc/idlc.hxx
+++ b/idlc/inc/idlc.hxx
@@ -147,7 +147,7 @@ void removeIfExists(std::string_view pathname);
bool copyFile(const OString* source, const OString& target);
// a null source means stdin
-bool isFileUrl(const OString& fileName);
+bool isFileUrl(std::string_view fileName);
OString convertToAbsoluteSystemPath(const OString& fileName);
OString convertToFileUrl(const OString& fileName);
diff --git a/idlc/source/astscope.cxx b/idlc/source/astscope.cxx
index d4c0f954367c..ca6214129c87 100644
--- a/idlc/source/astscope.cxx
+++ b/idlc/source/astscope.cxx
@@ -20,17 +20,19 @@
#include <sal/config.h>
#include <algorithm>
+#include <string_view>
#include <astscope.hxx>
#include <astbasetype.hxx>
#include <astinterface.hxx>
#include <errorhandler.hxx>
+#include <o3tl/string_view.hxx>
#include <osl/diagnose.h>
-static bool isGlobal(const OString& scopedName)
+static bool isGlobal(std::string_view scopedName)
{
- return scopedName.isEmpty() || scopedName.startsWith(":");
+ return scopedName.empty() || o3tl::starts_with(scopedName, ":");
}
AstScope::AstScope(NodeType nodeType)
diff --git a/idlc/source/idlccompile.cxx b/idlc/source/idlccompile.cxx
index 1902d63e0cad..6db9a615d316 100644
--- a/idlc/source/idlccompile.cxx
+++ b/idlc/source/idlccompile.cxx
@@ -22,6 +22,7 @@
#include <rtl/ustring.hxx>
#include <rtl/strbuf.hxx>
#include <o3tl/safeint.hxx>
+#include <o3tl/string_view.hxx>
#include <osl/process.h>
#include <osl/diagnose.h>
#include <osl/thread.h>
@@ -52,9 +53,9 @@ extern int yydebug;
static char tmpFilePattern[512];
-bool isFileUrl(const OString& fileName)
+bool isFileUrl(std::string_view fileName)
{
- return fileName.startsWith("file://");
+ return o3tl::starts_with(fileName, "file://");
}
OString convertToAbsoluteSystemPath(const OString& fileName)