summaryrefslogtreecommitdiff
path: root/include/connectivity
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2020-12-11 17:44:34 +0100
committerStephan Bergmann <sbergman@redhat.com>2020-12-11 21:25:10 +0100
commit35e471bb4d1388cf5afcdcee214cf5111edf44e3 (patch)
treebb78f4f13f131f0cb206a9707cc3cfc495a3876a /include/connectivity
parent0c06e77c122f10a1842bc908bd6e25b1110ddbd2 (diff)
Adapt the remaining OUString functions to std string_view
...for LIBO_INTERNAL_ONLY. These had been missed by 1b43cceaea2084a0489db68cd0113508f34b6643 "Make many OUString functions take std::u16string_view parameters" because they did not match the multi-overload pattern that was addressed there, but they nevertheless benefit from being changed just as well (witness e.g. the various resulting changes from copy() to subView()). This showed a conversion from OStringChar to std::string_view to be missing (while the corresponding conversion form OUStringChar to std::u16string_view was already present). The improvement to loplugin:stringadd became necessary to fix > [CPT] compilerplugins/clang/test/stringadd.cxx > error: 'error' diagnostics expected but not seen: > File ~/lo/core/compilerplugins/clang/test/stringadd.cxx Line 43 (directive at ~/lo/core/compilerplugins/clang/test/stringadd.cxx:42): simplify by merging with the preceding assignment [loplugin:stringadd] > File ~/lo/core/compilerplugins/clang/test/stringadd.cxx Line 61 (directive at ~/lo/core/compilerplugins/clang/test/stringadd.cxx:60): simplify by merging with the preceding assignment [loplugin:stringadd] > 2 errors generated. Change-Id: Ie40de0616a66e60e289c1af0ca60aed6f9ecc279 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107602 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'include/connectivity')
-rw-r--r--include/connectivity/CommonTools.hxx2
-rw-r--r--include/connectivity/DriversConfig.hxx13
-rw-r--r--include/connectivity/internalnode.hxx6
-rw-r--r--include/connectivity/sqlnode.hxx3
-rw-r--r--include/connectivity/sqlparse.hxx3
5 files changed, 17 insertions, 10 deletions
diff --git a/include/connectivity/CommonTools.hxx b/include/connectivity/CommonTools.hxx
index 98f5a1c50f3b..a5279024e351 100644
--- a/include/connectivity/CommonTools.hxx
+++ b/include/connectivity/CommonTools.hxx
@@ -138,7 +138,7 @@ namespace connectivity
@param _sClassName
The class name to look for.
*/
- OOO_DLLPUBLIC_DBTOOLS bool existsJavaClassByName( const ::rtl::Reference< jvmaccess::VirtualMachine >& _pJVM,const OUString& _sClassName );
+ OOO_DLLPUBLIC_DBTOOLS bool existsJavaClassByName( const ::rtl::Reference< jvmaccess::VirtualMachine >& _pJVM,std::u16string_view _sClassName );
#endif
}
diff --git a/include/connectivity/DriversConfig.hxx b/include/connectivity/DriversConfig.hxx
index f64a5a63882c..ceb15bedd2db 100644
--- a/include/connectivity/DriversConfig.hxx
+++ b/include/connectivity/DriversConfig.hxx
@@ -22,6 +22,7 @@
#include <sal/config.h>
#include <map>
+#include <string_view>
#include <com/sun/star/uno/Sequence.h>
#include <connectivity/dbtoolsdllapi.hxx>
@@ -57,7 +58,7 @@ namespace connectivity
{
typedef salhelper::SingletonRef<DriversConfigImpl> OSharedConfigNode;
- const ::comphelper::NamedValueCollection& impl_get(const OUString& _sURL,sal_Int32 _nProps) const;
+ const ::comphelper::NamedValueCollection& impl_get(std::u16string_view _sURL,sal_Int32 _nProps) const;
public:
DriversConfig(const css::uno::Reference< css::uno::XComponentContext >& _rxORB);
~DriversConfig();
@@ -65,11 +66,11 @@ namespace connectivity
DriversConfig( const DriversConfig& );
DriversConfig& operator=( const DriversConfig& );
- OUString getDriverFactoryName(const OUString& _sUrl) const;
- OUString getDriverTypeDisplayName(const OUString& _sUrl) const;
- const ::comphelper::NamedValueCollection& getProperties(const OUString& _sURL) const;
- const ::comphelper::NamedValueCollection& getFeatures(const OUString& _sURL) const;
- const ::comphelper::NamedValueCollection& getMetaData(const OUString& _sURL) const;
+ OUString getDriverFactoryName(std::u16string_view _sUrl) const;
+ OUString getDriverTypeDisplayName(std::u16string_view _sUrl) const;
+ const ::comphelper::NamedValueCollection& getProperties(std::u16string_view _sURL) const;
+ const ::comphelper::NamedValueCollection& getFeatures(std::u16string_view _sURL) const;
+ const ::comphelper::NamedValueCollection& getMetaData(std::u16string_view _sURL) const;
css::uno::Sequence< OUString > getURLs() const;
private:
OSharedConfigNode m_aNode;
diff --git a/include/connectivity/internalnode.hxx b/include/connectivity/internalnode.hxx
index 13ace88dc67a..3402f8e3a447 100644
--- a/include/connectivity/internalnode.hxx
+++ b/include/connectivity/internalnode.hxx
@@ -18,6 +18,10 @@
*/
#pragma once
+#include <sal/config.h>
+
+#include <string_view>
+
#include <connectivity/sqlnode.hxx>
namespace connectivity
@@ -33,7 +37,7 @@ namespace connectivity
OSQLInternalNode(const char* pNewValue,
SQLNodeType eNodeType,
sal_uInt32 nNodeID = 0);
- OSQLInternalNode(const OString& _rNewValue,
+ OSQLInternalNode(std::string_view _rNewValue,
SQLNodeType eNodeType,
sal_uInt32 nNodeID = 0);
OSQLInternalNode(const OUString& _rNewValue,
diff --git a/include/connectivity/sqlnode.hxx b/include/connectivity/sqlnode.hxx
index 7f394ef49de3..0e9ca82bec4a 100644
--- a/include/connectivity/sqlnode.hxx
+++ b/include/connectivity/sqlnode.hxx
@@ -24,6 +24,7 @@
#include <com/sun/star/uno/Reference.hxx>
#include <memory>
#include <set>
+#include <string_view>
#include <vector>
#include <rtl/ustrbuf.hxx>
@@ -230,7 +231,7 @@ namespace connectivity
SQLNodeType _eNodeType,
sal_uInt32 _nNodeID = 0);
- OSQLParseNode(const OString& _rValue,
+ OSQLParseNode(std::string_view _rValue,
SQLNodeType eNewNodeType,
sal_uInt32 nNewNodeID=0);
diff --git a/include/connectivity/sqlparse.hxx b/include/connectivity/sqlparse.hxx
index 2cd85ba69fa7..b92ff3b1c7c0 100644
--- a/include/connectivity/sqlparse.hxx
+++ b/include/connectivity/sqlparse.hxx
@@ -20,6 +20,7 @@
#define INCLUDED_CONNECTIVITY_SQLPARSE_HXX
#include <memory>
+#include <string_view>
#include <com/sun/star/uno/Reference.h>
#include <osl/mutex.hxx>
@@ -195,7 +196,7 @@ namespace connectivity
// RuleId with enum, far more efficient
static sal_uInt32 RuleID(OSQLParseNode::Rule eRule);
// compares the _sFunctionName with all known function names and return the DataType of the return value
- static sal_Int32 getFunctionReturnType(const OUString& _sFunctionName, const IParseContext* pContext);
+ static sal_Int32 getFunctionReturnType(std::u16string_view _sFunctionName, const IParseContext* pContext);
// returns the type for a parameter in a given function name
static sal_Int32 getFunctionParameterType(sal_uInt32 _nTokenId,sal_uInt32 _nPos);