summaryrefslogtreecommitdiff
path: root/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 /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 'connectivity')
-rw-r--r--connectivity/source/commontools/CommonTools.cxx2
-rw-r--r--connectivity/source/commontools/DriversConfig.cxx15
-rw-r--r--connectivity/source/drivers/dbase/dindexnode.cxx2
-rw-r--r--connectivity/source/drivers/evoab2/NStatement.cxx17
-rw-r--r--connectivity/source/drivers/file/FStringFunctions.cxx2
-rw-r--r--connectivity/source/drivers/firebird/StatementCommonBase.cxx2
-rw-r--r--connectivity/source/drivers/firebird/StatementCommonBase.hxx6
-rw-r--r--connectivity/source/drivers/jdbc/Class.cxx2
-rw-r--r--connectivity/source/drivers/odbc/ODatabaseMetaDataResultSet.cxx25
-rw-r--r--connectivity/source/drivers/odbc/OStatement.cxx2
-rw-r--r--connectivity/source/drivers/postgresql/pq_connection.cxx2
-rw-r--r--connectivity/source/drivers/postgresql/pq_statement.cxx3
-rw-r--r--connectivity/source/drivers/postgresql/pq_tools.cxx29
-rw-r--r--connectivity/source/drivers/postgresql/pq_tools.hxx18
-rw-r--r--connectivity/source/drivers/postgresql/pq_xcolumns.cxx4
-rw-r--r--connectivity/source/drivers/postgresql/pq_xcolumns.hxx8
-rw-r--r--connectivity/source/inc/java/lang/Class.hxx6
-rw-r--r--connectivity/source/inc/odbc/ODatabaseMetaDataResultSet.hxx23
-rw-r--r--connectivity/source/inc/odbc/OStatement.hxx3
-rw-r--r--connectivity/source/parse/internalnode.cxx2
-rw-r--r--connectivity/source/parse/sqlnode.cxx4
21 files changed, 101 insertions, 76 deletions
diff --git a/connectivity/source/commontools/CommonTools.cxx b/connectivity/source/commontools/CommonTools.cxx
index 5c84bf6e6f18..223129a71e92 100644
--- a/connectivity/source/commontools/CommonTools.cxx
+++ b/connectivity/source/commontools/CommonTools.cxx
@@ -141,7 +141,7 @@ namespace connectivity
return aRet;
}
- bool existsJavaClassByName( const ::rtl::Reference< jvmaccess::VirtualMachine >& _pJVM,const OUString& _sClassName )
+ bool existsJavaClassByName( const ::rtl::Reference< jvmaccess::VirtualMachine >& _pJVM,std::u16string_view _sClassName )
{
bool bRet = false;
if ( _pJVM.is() )
diff --git a/connectivity/source/commontools/DriversConfig.cxx b/connectivity/source/commontools/DriversConfig.cxx
index 9d2ab8a475d7..c95d30091184 100644
--- a/connectivity/source/commontools/DriversConfig.cxx
+++ b/connectivity/source/commontools/DriversConfig.cxx
@@ -144,7 +144,7 @@ DriversConfig& DriversConfig::operator=( const DriversConfig& _rhs )
}
-OUString DriversConfig::getDriverFactoryName(const OUString& _sURL) const
+OUString DriversConfig::getDriverFactoryName(std::u16string_view _sURL) const
{
const TInstalledDrivers& rDrivers = m_aNode->getInstalledDrivers(m_xORB);
OUString sRet;
@@ -162,7 +162,7 @@ OUString DriversConfig::getDriverFactoryName(const OUString& _sURL) const
return sRet;
}
-OUString DriversConfig::getDriverTypeDisplayName(const OUString& _sURL) const
+OUString DriversConfig::getDriverTypeDisplayName(std::u16string_view _sURL) const
{
const TInstalledDrivers& rDrivers = m_aNode->getInstalledDrivers(m_xORB);
OUString sRet;
@@ -180,22 +180,25 @@ OUString DriversConfig::getDriverTypeDisplayName(const OUString& _sURL) const
return sRet;
}
-const ::comphelper::NamedValueCollection& DriversConfig::getProperties(const OUString& _sURL) const
+const ::comphelper::NamedValueCollection& DriversConfig::getProperties(std::u16string_view _sURL)
+ const
{
return impl_get(_sURL,1);
}
-const ::comphelper::NamedValueCollection& DriversConfig::getFeatures(const OUString& _sURL) const
+const ::comphelper::NamedValueCollection& DriversConfig::getFeatures(std::u16string_view _sURL)
+ const
{
return impl_get(_sURL,0);
}
-const ::comphelper::NamedValueCollection& DriversConfig::getMetaData(const OUString& _sURL) const
+const ::comphelper::NamedValueCollection& DriversConfig::getMetaData(std::u16string_view _sURL)
+ const
{
return impl_get(_sURL,2);
}
-const ::comphelper::NamedValueCollection& DriversConfig::impl_get(const OUString& _sURL,sal_Int32 _nProps) const
+const ::comphelper::NamedValueCollection& DriversConfig::impl_get(std::u16string_view _sURL,sal_Int32 _nProps) const
{
const TInstalledDrivers& rDrivers = m_aNode->getInstalledDrivers(m_xORB);
const ::comphelper::NamedValueCollection* pRet = nullptr;
diff --git a/connectivity/source/drivers/dbase/dindexnode.cxx b/connectivity/source/drivers/dbase/dindexnode.cxx
index 1ac10800f0a9..69648c480e79 100644
--- a/connectivity/source/drivers/dbase/dindexnode.cxx
+++ b/connectivity/source/drivers/dbase/dindexnode.cxx
@@ -760,7 +760,7 @@ int ONDXKey::Compare(const ONDXKey& rKey) const
}
else if (IsText(getDBType()))
{
- nRes = getValue().getString().compareTo(rKey.getValue());
+ nRes = getValue().getString().compareTo(rKey.getValue().getString());
}
else
{
diff --git a/connectivity/source/drivers/evoab2/NStatement.cxx b/connectivity/source/drivers/evoab2/NStatement.cxx
index 1616f9fb1f1f..80b02d82f0a5 100644
--- a/connectivity/source/drivers/evoab2/NStatement.cxx
+++ b/connectivity/source/drivers/evoab2/NStatement.cxx
@@ -17,6 +17,10 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
+#include <sal/config.h>
+
+#include <string_view>
+
#include <osl/diagnose.h>
#include <rtl/ustring.hxx>
#include <sal/log.hxx>
@@ -54,9 +58,9 @@ EBookQuery * createTrue()
return e_book_query_from_string("(exists \"full_name\")");
}
-EBookQuery * createTest( const OUString &aColumnName,
+EBookQuery * createTest( std::u16string_view aColumnName,
EBookQueryTest eTest,
- const OUString &aMatch )
+ std::u16string_view aMatch )
{
OString sMatch = OUStringToOString( aMatch, RTL_TEXTENCODING_UTF8 );
OString sColumnName = OUStringToOString( aColumnName, RTL_TEXTENCODING_UTF8 );
@@ -364,7 +368,7 @@ EBookQuery *OCommonStatement::whereAnalysis( const OSQLParseNode* parseTree )
{
// String containing only a '%' and nothing else matches everything
pResult = createTest( aColumnName, E_BOOK_QUERY_CONTAINS,
- "" );
+ u"" );
}
else if( aMatchString.indexOf( WILDCARD ) == -1 )
{ // Simple string , eg. "to match" "contains in evo"
@@ -381,9 +385,10 @@ EBookQuery *OCommonStatement::whereAnalysis( const OSQLParseNode* parseTree )
else if( aMatchString.indexOf ( WILDCARD ) == aMatchString.lastIndexOf ( WILDCARD ) )
{ // One occurrence of '%' matches...
if ( aMatchString.startsWith(OUStringChar(WILDCARD)) )
- pResult = createTest( aColumnName, E_BOOK_QUERY_ENDS_WITH, aMatchString.copy( 1 ) );
+ pResult = createTest(
+ aColumnName, E_BOOK_QUERY_ENDS_WITH, aMatchString.subView( 1 ) );
else if ( aMatchString.indexOf ( WILDCARD ) == aMatchString.getLength() - 1 )
- pResult = createTest( aColumnName, E_BOOK_QUERY_BEGINS_WITH, aMatchString.copy( 0, aMatchString.getLength() - 1 ) );
+ pResult = createTest( aColumnName, E_BOOK_QUERY_BEGINS_WITH, aMatchString.subView( 0, aMatchString.getLength() - 1 ) );
else
m_xConnection->throwGenericSQLException(STR_QUERY_LIKE_WILDCARD,*this);
}
@@ -391,7 +396,7 @@ EBookQuery *OCommonStatement::whereAnalysis( const OSQLParseNode* parseTree )
aMatchString.startsWith(OUStringChar(WILDCARD)) &&
aMatchString.indexOf ( WILDCARD, 1) == aMatchString.getLength() - 1 ) {
// one '%' at the start and another at the end
- pResult = createTest( aColumnName, E_BOOK_QUERY_CONTAINS, aMatchString.copy (1, aMatchString.getLength() - 2) );
+ pResult = createTest( aColumnName, E_BOOK_QUERY_CONTAINS, aMatchString.subView (1, aMatchString.getLength() - 2) );
}
else
m_xConnection->throwGenericSQLException(STR_QUERY_LIKE_WILDCARD_MANY,*this);
diff --git a/connectivity/source/drivers/file/FStringFunctions.cxx b/connectivity/source/drivers/file/FStringFunctions.cxx
index 1df5e723c4ee..8bac436e07be 100644
--- a/connectivity/source/drivers/file/FStringFunctions.cxx
+++ b/connectivity/source/drivers/file/FStringFunctions.cxx
@@ -43,7 +43,7 @@ ORowSetValue OOp_Ascii::operate(const ORowSetValue& lhs) const
{
if (lhs.isNull())
return lhs;
- OString sStr(OUStringToOString(lhs, RTL_TEXTENCODING_ASCII_US));
+ OString sStr(OUStringToOString(lhs.getString(), RTL_TEXTENCODING_ASCII_US));
sal_Int32 nAscii = sStr.toChar();
return nAscii;
}
diff --git a/connectivity/source/drivers/firebird/StatementCommonBase.cxx b/connectivity/source/drivers/firebird/StatementCommonBase.cxx
index c1219d74b8ed..1d7d5ef32bdf 100644
--- a/connectivity/source/drivers/firebird/StatementCommonBase.cxx
+++ b/connectivity/source/drivers/firebird/StatementCommonBase.cxx
@@ -124,7 +124,7 @@ void SAL_CALL OStatementCommonBase::close()
dispose();
}
-void OStatementCommonBase::prepareAndDescribeStatement(const OUString& sql,
+void OStatementCommonBase::prepareAndDescribeStatement(std::u16string_view sql,
XSQLDA*& pOutSqlda,
XSQLDA* pInSqlda)
{
diff --git a/connectivity/source/drivers/firebird/StatementCommonBase.hxx b/connectivity/source/drivers/firebird/StatementCommonBase.hxx
index b321a27db4f4..c92dd8634109 100644
--- a/connectivity/source/drivers/firebird/StatementCommonBase.hxx
+++ b/connectivity/source/drivers/firebird/StatementCommonBase.hxx
@@ -20,6 +20,10 @@
#ifndef INCLUDED_CONNECTIVITY_SOURCE_DRIVERS_FIREBIRD_STATEMENTCOMMONBASE_HXX
#define INCLUDED_CONNECTIVITY_SOURCE_DRIVERS_FIREBIRD_STATEMENTCOMMONBASE_HXX
+#include <sal/config.h>
+
+#include <string_view>
+
#include "Connection.hxx"
#include "SubComponent.hxx"
@@ -81,7 +85,7 @@ namespace connectivity::firebird
virtual ~OStatementCommonBase() override;
/// @throws css::sdbc::SQLException
- void prepareAndDescribeStatement(const OUString& sqlIn,
+ void prepareAndDescribeStatement(std::u16string_view sqlIn,
XSQLDA*& pOutSqlda,
XSQLDA* pInSqlda=nullptr);
diff --git a/connectivity/source/drivers/jdbc/Class.cxx b/connectivity/source/drivers/jdbc/Class.cxx
index a99dd1fb051d..862827d12c93 100644
--- a/connectivity/source/drivers/jdbc/Class.cxx
+++ b/connectivity/source/drivers/jdbc/Class.cxx
@@ -36,7 +36,7 @@ jclass java_lang_Class::getMyClass() const
return theClass;
}
-java_lang_Class* java_lang_Class::forName(const OUString& _par0)
+java_lang_Class* java_lang_Class::forName(std::u16string_view _par0)
{
jobject out(nullptr);
SDBThreadAttach t;
diff --git a/connectivity/source/drivers/odbc/ODatabaseMetaDataResultSet.cxx b/connectivity/source/drivers/odbc/ODatabaseMetaDataResultSet.cxx
index 7afd4bed54f9..a47758f31a5d 100644
--- a/connectivity/source/drivers/odbc/ODatabaseMetaDataResultSet.cxx
+++ b/connectivity/source/drivers/odbc/ODatabaseMetaDataResultSet.cxx
@@ -822,7 +822,7 @@ void ODatabaseMetaDataResultSet::openTypeInfo()
}
void ODatabaseMetaDataResultSet::openTables(const Any& catalog, const OUString& schemaPattern,
- const OUString& tableNamePattern,
+ std::u16string_view tableNamePattern,
const Sequence< OUString >& types )
{
OString aPKQ,aPKO,aPKN,aCOL;
@@ -919,7 +919,8 @@ void ODatabaseMetaDataResultSet::openSchemas()
}
void ODatabaseMetaDataResultSet::openColumnPrivileges( const Any& catalog, const OUString& schema,
- const OUString& table, const OUString& columnNamePattern )
+ std::u16string_view table,
+ std::u16string_view columnNamePattern )
{
const OUString *pSchemaPat = nullptr;
@@ -953,7 +954,7 @@ void ODatabaseMetaDataResultSet::openColumnPrivileges( const Any& catalog, cons
}
void ODatabaseMetaDataResultSet::openColumns( const Any& catalog, const OUString& schemaPattern,
- const OUString& tableNamePattern, const OUString& columnNamePattern )
+ std::u16string_view tableNamePattern, std::u16string_view columnNamePattern )
{
const OUString *pSchemaPat = nullptr;
@@ -1020,7 +1021,7 @@ void ODatabaseMetaDataResultSet::openColumns( const Any& catalog,
}
void ODatabaseMetaDataResultSet::openProcedureColumns( const Any& catalog, const OUString& schemaPattern,
- const OUString& procedureNamePattern,const OUString& columnNamePattern )
+ std::u16string_view procedureNamePattern,std::u16string_view columnNamePattern )
{
const OUString *pSchemaPat = nullptr;
@@ -1053,7 +1054,7 @@ void ODatabaseMetaDataResultSet::openProcedureColumns( const Any& catalog,
}
void ODatabaseMetaDataResultSet::openProcedures(const Any& catalog, const OUString& schemaPattern,
- const OUString& procedureNamePattern)
+ std::u16string_view procedureNamePattern)
{
const OUString *pSchemaPat = nullptr;
@@ -1083,11 +1084,11 @@ void ODatabaseMetaDataResultSet::openProcedures(const Any& catalog, const OUStri
}
void ODatabaseMetaDataResultSet::openSpecialColumns(bool _bRowVer,const Any& catalog, const OUString& schema,
- const OUString& table,sal_Int32 scope, bool nullable )
+ std::u16string_view table,sal_Int32 scope, bool nullable )
{
// Some ODBC drivers really don't like getting an empty string as tableName
// E.g. psqlodbc up to at least version 09.01.0100 segfaults
- if (table.isEmpty())
+ if (table.empty())
{
const char errMsg[] = "ODBC: Trying to get special columns of empty table name";
const char SQLState[] = "HY009";
@@ -1123,13 +1124,13 @@ void ODatabaseMetaDataResultSet::openSpecialColumns(bool _bRowVer,const Any& cat
}
void ODatabaseMetaDataResultSet::openVersionColumns(const Any& catalog, const OUString& schema,
- const OUString& table)
+ std::u16string_view table)
{
openSpecialColumns(true,catalog,schema,table,SQL_SCOPE_TRANSACTION,false);
}
void ODatabaseMetaDataResultSet::openBestRowIdentifier( const Any& catalog, const OUString& schema,
- const OUString& table,sal_Int32 scope,bool nullable )
+ std::u16string_view table,sal_Int32 scope,bool nullable )
{
openSpecialColumns(false,catalog,schema,table,scope,nullable);
}
@@ -1198,7 +1199,7 @@ void ODatabaseMetaDataResultSet::openExportedKeys(const Any& catalog, const OUSt
}
void ODatabaseMetaDataResultSet::openPrimaryKeys(const Any& catalog, const OUString& schema,
- const OUString& table)
+ std::u16string_view table)
{
const OUString *pSchemaPat = nullptr;
@@ -1228,7 +1229,7 @@ void ODatabaseMetaDataResultSet::openPrimaryKeys(const Any& catalog, const OUStr
}
void ODatabaseMetaDataResultSet::openTablePrivileges(const Any& catalog, const OUString& schemaPattern,
- const OUString& tableNamePattern)
+ std::u16string_view tableNamePattern)
{
const OUString *pSchemaPat = nullptr;
@@ -1257,7 +1258,7 @@ void ODatabaseMetaDataResultSet::openTablePrivileges(const Any& catalog, const O
}
void ODatabaseMetaDataResultSet::openIndexInfo( const Any& catalog, const OUString& schema,
- const OUString& table, bool unique, bool approximate )
+ std::u16string_view table, bool unique, bool approximate )
{
const OUString *pSchemaPat = nullptr;
diff --git a/connectivity/source/drivers/odbc/OStatement.cxx b/connectivity/source/drivers/odbc/OStatement.cxx
index 6e0a37169064..dc693b964d56 100644
--- a/connectivity/source/drivers/odbc/OStatement.cxx
+++ b/connectivity/source/drivers/odbc/OStatement.cxx
@@ -833,7 +833,7 @@ void OStatement_Base::setMaxFieldSize(sal_Int64 _par0)
setStmtOption<SQLULEN, SQL_IS_UINTEGER>(SQL_ATTR_MAX_LENGTH, _par0);
}
-void OStatement_Base::setCursorName(const OUString &_par0)
+void OStatement_Base::setCursorName(std::u16string_view _par0)
{
OSL_ENSURE(m_aStatementHandle,"StatementHandle is null!");
OString aName(OUStringToOString(_par0,getOwnConnection()->getTextEncoding()));
diff --git a/connectivity/source/drivers/postgresql/pq_connection.cxx b/connectivity/source/drivers/postgresql/pq_connection.cxx
index d9889dea8091..4d56d52ec9a9 100644
--- a/connectivity/source/drivers/postgresql/pq_connection.cxx
+++ b/connectivity/source/drivers/postgresql/pq_connection.cxx
@@ -443,7 +443,7 @@ void Connection::initialize( const Sequence< Any >& aArguments )
nColon = url.indexOf( ':' , 1+ nColon );
if( nColon != -1 )
{
- o = OUStringToOString( url.copy(nColon+1), ConnectionSettings::encoding );
+ o = OUStringToOString( url.subView(nColon+1), ConnectionSettings::encoding );
}
}
{
diff --git a/connectivity/source/drivers/postgresql/pq_statement.cxx b/connectivity/source/drivers/postgresql/pq_statement.cxx
index dd7ab576b37f..ff3b05dc8190 100644
--- a/connectivity/source/drivers/postgresql/pq_statement.cxx
+++ b/connectivity/source/drivers/postgresql/pq_statement.cxx
@@ -61,6 +61,7 @@
#include <com/sun/star/container/XEnumerationAccess.hpp>
#include <string.h>
+#include <string_view>
using osl::MutexGuard;
@@ -239,7 +240,7 @@ sal_Int32 Statement::executeUpdate( const OUString& sql )
/// @throws SQLException
static void raiseSQLException(
const Reference< XInterface> & owner,
- const OString & sql,
+ std::string_view sql,
const char * errorMsg,
const char *errorType = nullptr )
{
diff --git a/connectivity/source/drivers/postgresql/pq_tools.cxx b/connectivity/source/drivers/postgresql/pq_tools.cxx
index bece8a806f29..543f042f921e 100644
--- a/connectivity/source/drivers/postgresql/pq_tools.cxx
+++ b/connectivity/source/drivers/postgresql/pq_tools.cxx
@@ -57,6 +57,7 @@
#include <libpq-fe.h>
#include <string.h>
+#include <string_view>
using com::sun::star::beans::XPropertySet;
@@ -91,16 +92,16 @@ OUString concatQualified( const OUString & a, const OUString &b)
return a + "." + b;
}
-static OString iOUStringToOString( const OUString& str, ConnectionSettings const *settings) {
+static OString iOUStringToOString( std::u16string_view str, ConnectionSettings const *settings) {
OSL_ENSURE(settings, "pgsql-sdbc: OUStringToOString got NULL settings");
- return OUStringToOString( str, ConnectionSettings::encoding );
+ return rtl::OUStringToOString( str, ConnectionSettings::encoding );
}
-OString OUStringToOString( const OUString& str, ConnectionSettings const *settings) {
+OString OUStringToOString( std::u16string_view str, ConnectionSettings const *settings) {
return iOUStringToOString( str, settings );
}
-void bufferEscapeConstant( OUStringBuffer & buf, const OUString & value, ConnectionSettings *settings )
+void bufferEscapeConstant( OUStringBuffer & buf, std::u16string_view value, ConnectionSettings *settings )
{
OString y = iOUStringToOString( value, settings );
@@ -127,14 +128,14 @@ void bufferEscapeConstant( OUStringBuffer & buf, const OUString & value, Connect
buf.append( OStringToOUString( strbuf.makeStringAndClear(), RTL_TEXTENCODING_UTF8 ) );
}
-static void ibufferQuoteConstant( OUStringBuffer & buf, const OUString & value, ConnectionSettings *settings )
+static void ibufferQuoteConstant( OUStringBuffer & buf, std::u16string_view value, ConnectionSettings *settings )
{
buf.append( "'" );
bufferEscapeConstant( buf, value, settings );
buf.append( "'" );
}
-void bufferQuoteConstant( OUStringBuffer & buf, const OUString & value, ConnectionSettings *settings )
+void bufferQuoteConstant( OUStringBuffer & buf, std::u16string_view value, ConnectionSettings *settings )
{
return ibufferQuoteConstant( buf, value, settings );
}
@@ -151,7 +152,7 @@ void bufferQuoteAnyConstant( OUStringBuffer & buf, const Any &val, ConnectionSet
buf.append( "NULL" );
}
-static void ibufferQuoteIdentifier( OUStringBuffer & buf, const OUString &toQuote, ConnectionSettings *settings )
+static void ibufferQuoteIdentifier( OUStringBuffer & buf, std::u16string_view toQuote, ConnectionSettings *settings )
{
OSL_ENSURE(settings, "pgsql-sdbc: bufferQuoteIdentifier got NULL settings");
@@ -171,14 +172,14 @@ static void ibufferQuoteIdentifier( OUStringBuffer & buf, const OUString &toQuot
PQfreemem( cstr );
}
-void bufferQuoteIdentifier( OUStringBuffer & buf, const OUString &toQuote, ConnectionSettings *settings )
+void bufferQuoteIdentifier( OUStringBuffer & buf, std::u16string_view toQuote, ConnectionSettings *settings )
{
return ibufferQuoteIdentifier(buf, toQuote, settings);
}
void bufferQuoteQualifiedIdentifier(
- OUStringBuffer & buf, const OUString &schema, const OUString &table, ConnectionSettings *settings )
+ OUStringBuffer & buf, std::u16string_view schema, std::u16string_view table, ConnectionSettings *settings )
{
ibufferQuoteIdentifier(buf, schema, settings);
buf.append( "." );
@@ -187,9 +188,9 @@ void bufferQuoteQualifiedIdentifier(
void bufferQuoteQualifiedIdentifier(
OUStringBuffer & buf,
- const OUString &schema,
- const OUString &table,
- const OUString &col,
+ std::u16string_view schema,
+ std::u16string_view table,
+ std::u16string_view col,
ConnectionSettings *settings)
{
ibufferQuoteIdentifier(buf, schema, settings);
@@ -544,10 +545,10 @@ void tokenizeSQL( const OString & sql, std::vector< OString > &vec )
}
-void splitConcatenatedIdentifier( const OUString & source, OUString *first, OUString *second)
+void splitConcatenatedIdentifier( std::u16string_view source, OUString *first, OUString *second)
{
std::vector< OString > vec;
- tokenizeSQL( OUStringToOString( source, RTL_TEXTENCODING_UTF8 ), vec );
+ tokenizeSQL( rtl::OUStringToOString( source, RTL_TEXTENCODING_UTF8 ), vec );
switch (vec.size())
{
case 1:
diff --git a/connectivity/source/drivers/postgresql/pq_tools.hxx b/connectivity/source/drivers/postgresql/pq_tools.hxx
index 0647a1b38f55..90490be81eb6 100644
--- a/connectivity/source/drivers/postgresql/pq_tools.hxx
+++ b/connectivity/source/drivers/postgresql/pq_tools.hxx
@@ -57,28 +57,28 @@ bool isWhitespace( sal_Unicode c );
OUString concatQualified( const OUString & a, const OUString &b);
-OString OUStringToOString( const OUString& str, ConnectionSettings const *settings);
+OString OUStringToOString( std::u16string_view str, ConnectionSettings const *settings);
-void bufferQuoteConstant( OUStringBuffer & buf, const OUString & str, ConnectionSettings *settings );
+void bufferQuoteConstant( OUStringBuffer & buf, std::u16string_view str, ConnectionSettings *settings );
void bufferQuoteAnyConstant( OUStringBuffer & buf, const css::uno::Any &val, ConnectionSettings *settings );
-void bufferEscapeConstant( OUStringBuffer & buf, const OUString & str, ConnectionSettings *settings );
+void bufferEscapeConstant( OUStringBuffer & buf, std::u16string_view str, ConnectionSettings *settings );
OUString sqltype2string(
const css::uno::Reference< css::beans::XPropertySet > & column );
void bufferQuoteQualifiedIdentifier(
- OUStringBuffer & buf, const OUString &schema, const OUString &name, ConnectionSettings *settings );
+ OUStringBuffer & buf, std::u16string_view schema, std::u16string_view name, ConnectionSettings *settings );
void bufferQuoteQualifiedIdentifier(
OUStringBuffer & buf,
- const OUString &schema,
- const OUString &name,
- const OUString &col,
+ std::u16string_view schema,
+ std::u16string_view name,
+ std::u16string_view col,
ConnectionSettings *settings );
-void bufferQuoteIdentifier( OUStringBuffer & buf, const OUString &toQuote, ConnectionSettings *settings );
+void bufferQuoteIdentifier( OUStringBuffer & buf, std::u16string_view toQuote, ConnectionSettings *settings );
void bufferKey2TableConstraint(
OUStringBuffer &buf,
const css::uno::Reference< css::beans::XPropertySet > &key,
@@ -115,7 +115,7 @@ OUString array2String( const css::uno::Sequence< css::uno::Any > &seq );
css::uno::Reference< css::sdbc::XConnection > extractConnectionFromStatement(
const css::uno::Reference< css::uno::XInterface > & stmt );
-void splitConcatenatedIdentifier( const OUString & source, OUString *first, OUString *second);
+void splitConcatenatedIdentifier( std::u16string_view source, OUString *first, OUString *second);
void fillAttnum2attnameMap(
diff --git a/connectivity/source/drivers/postgresql/pq_xcolumns.cxx b/connectivity/source/drivers/postgresql/pq_xcolumns.cxx
index 4edb1aabc068..ed3af3579d2a 100644
--- a/connectivity/source/drivers/postgresql/pq_xcolumns.cxx
+++ b/connectivity/source/drivers/postgresql/pq_xcolumns.cxx
@@ -328,8 +328,8 @@ void Columns::refresh()
void alterColumnByDescriptor(
- const OUString & schemaName,
- const OUString & tableName,
+ std::u16string_view schemaName,
+ std::u16string_view tableName,
ConnectionSettings *settings,
const Reference< XStatement > &stmt,
const css::uno::Reference< css::beans::XPropertySet > & past,
diff --git a/connectivity/source/drivers/postgresql/pq_xcolumns.hxx b/connectivity/source/drivers/postgresql/pq_xcolumns.hxx
index ab8c47914516..78bb9770ebdf 100644
--- a/connectivity/source/drivers/postgresql/pq_xcolumns.hxx
+++ b/connectivity/source/drivers/postgresql/pq_xcolumns.hxx
@@ -37,6 +37,10 @@
#ifndef INCLUDED_CONNECTIVITY_SOURCE_DRIVERS_POSTGRESQL_PQ_XCOLUMNS_HXX
#define INCLUDED_CONNECTIVITY_SOURCE_DRIVERS_POSTGRESQL_PQ_XCOLUMNS_HXX
+#include <sal/config.h>
+
+#include <string_view>
+
#include "pq_xcontainer.hxx"
#include "pq_xbase.hxx"
@@ -46,8 +50,8 @@ namespace pq_sdbc_driver
{
void alterColumnByDescriptor(
- const OUString & schemaName,
- const OUString & tableName,
+ std::u16string_view schemaName,
+ std::u16string_view tableName,
ConnectionSettings *settings,
const css::uno::Reference< css::sdbc::XStatement > &stmt,
const css::uno::Reference< css::beans::XPropertySet > & past,
diff --git a/connectivity/source/inc/java/lang/Class.hxx b/connectivity/source/inc/java/lang/Class.hxx
index bc68a01a536a..bdf8e2742472 100644
--- a/connectivity/source/inc/java/lang/Class.hxx
+++ b/connectivity/source/inc/java/lang/Class.hxx
@@ -21,6 +21,10 @@
//************ Class: java.lang.Class
+#include <sal/config.h>
+
+#include <string_view>
+
#include <java/lang/Object.hxx>
namespace connectivity
@@ -36,7 +40,7 @@ namespace connectivity
// a Constructor, that is needed for when Returning the Object is needed:
java_lang_Class( JNIEnv * pEnv, jobject myObj ) : java_lang_Object( pEnv, myObj ){}
- static java_lang_Class * forName( const OUString &_par0 );
+ static java_lang_Class * forName( std::u16string_view _par0 );
// return the jre object
jobject newInstanceObject();
diff --git a/connectivity/source/inc/odbc/ODatabaseMetaDataResultSet.hxx b/connectivity/source/inc/odbc/ODatabaseMetaDataResultSet.hxx
index 41f3f756cf74..8f10f3c10ad4 100644
--- a/connectivity/source/inc/odbc/ODatabaseMetaDataResultSet.hxx
+++ b/connectivity/source/inc/odbc/ODatabaseMetaDataResultSet.hxx
@@ -39,6 +39,7 @@
#include <odbc/ODatabaseMetaData.hxx>
#include <odbc/odbcbasedllapi.hxx>
#include <memory>
+#include <string_view>
namespace connectivity::odbc
{
@@ -199,31 +200,31 @@ namespace connectivity::odbc
/// @throws css::sdbc::SQLException
/// @throws css::uno::RuntimeException
void openTables(const css::uno::Any& catalog, const OUString& schemaPattern,
- const OUString& tableNamePattern, const css::uno::Sequence< OUString >& types );
+ std::u16string_view tableNamePattern, const css::uno::Sequence< OUString >& types );
/// @throws css::sdbc::SQLException
/// @throws css::uno::RuntimeException
void openColumnPrivileges( const css::uno::Any& catalog, const OUString& schema,
- const OUString& table, const OUString& columnNamePattern );
+ std::u16string_view table, std::u16string_view columnNamePattern );
/// @throws css::sdbc::SQLException
/// @throws css::uno::RuntimeException
void openColumns( const css::uno::Any& catalog, const OUString& schemaPattern,
- const OUString& tableNamePattern, const OUString& columnNamePattern );
+ std::u16string_view tableNamePattern, std::u16string_view columnNamePattern );
/// @throws css::sdbc::SQLException
/// @throws css::uno::RuntimeException
void openProcedureColumns( const css::uno::Any& catalog, const OUString& schemaPattern,
- const OUString& procedureNamePattern,const OUString& columnNamePattern );
+ std::u16string_view procedureNamePattern,std::u16string_view columnNamePattern );
/// @throws css::sdbc::SQLException
/// @throws css::uno::RuntimeException
void openProcedures( const css::uno::Any& catalog, const OUString& schemaPattern,
- const OUString& procedureNamePattern);
+ std::u16string_view procedureNamePattern);
/// @throws css::sdbc::SQLException
/// @throws css::uno::RuntimeException
void openVersionColumns(const css::uno::Any& catalog, const OUString& schema,
- const OUString& table);
+ std::u16string_view table);
/// @throws css::sdbc::SQLException
/// @throws css::uno::RuntimeException
void openBestRowIdentifier( const css::uno::Any& catalog, const OUString& schema,
- const OUString& table,sal_Int32 scope, bool nullable );
+ std::u16string_view table,sal_Int32 scope, bool nullable );
/// @throws css::sdbc::SQLException
/// @throws css::uno::RuntimeException
void openForeignKeys( const css::uno::Any& catalog, const OUString* schema,const OUString* table,
@@ -236,19 +237,19 @@ namespace connectivity::odbc
void openImportedKeys(const css::uno::Any& catalog, const OUString& schema,const OUString& table);
/// @throws css::sdbc::SQLException
/// @throws css::uno::RuntimeException
- void openPrimaryKeys(const css::uno::Any& catalog, const OUString& schema,const OUString& table);
+ void openPrimaryKeys(const css::uno::Any& catalog, const OUString& schema,std::u16string_view table);
/// @throws css::sdbc::SQLException
/// @throws css::uno::RuntimeException
void openTablePrivileges(const css::uno::Any& catalog, const OUString& schemaPattern,
- const OUString& tableNamePattern);
+ std::u16string_view tableNamePattern);
/// @throws css::sdbc::SQLException
/// @throws css::uno::RuntimeException
void openSpecialColumns(bool _bRowVer,const css::uno::Any& catalog, const OUString& schema,
- const OUString& table,sal_Int32 scope, bool nullable );
+ std::u16string_view table,sal_Int32 scope, bool nullable );
/// @throws css::sdbc::SQLException
/// @throws css::uno::RuntimeException
void openIndexInfo( const css::uno::Any& catalog, const OUString& schema,
- const OUString& table,bool unique,bool approximate );
+ std::u16string_view table,bool unique,bool approximate );
protected:
using OPropertySetHelper::getFastPropertyValue;
diff --git a/connectivity/source/inc/odbc/OStatement.hxx b/connectivity/source/inc/odbc/OStatement.hxx
index 54b28cac825e..1b7b3a569434 100644
--- a/connectivity/source/inc/odbc/OStatement.hxx
+++ b/connectivity/source/inc/odbc/OStatement.hxx
@@ -35,6 +35,7 @@
#include <odbc/OFunctions.hxx>
#include <odbc/OConnection.hxx>
#include <odbc/odbcbasedllapi.hxx>
+#include <string_view>
#include <vector>
#include <com/sun/star/lang/XServiceInfo.hpp>
@@ -91,7 +92,7 @@ namespace connectivity::odbc
void setMaxRows(sal_Int64 _par0) ;
void setFetchDirection(sal_Int32 _par0) ;
void setFetchSize(sal_Int32 _par0) ;
- void setCursorName(const OUString &_par0);
+ void setCursorName(std::u16string_view _par0);
void setEscapeProcessing( const bool _bEscapeProc );
template < typename T, SQLINTEGER BufferLength > SQLRETURN setStmtOption (SQLINTEGER fOption, T value) const;
diff --git a/connectivity/source/parse/internalnode.cxx b/connectivity/source/parse/internalnode.cxx
index ccee05746a17..1906ad3d4625 100644
--- a/connectivity/source/parse/internalnode.cxx
+++ b/connectivity/source/parse/internalnode.cxx
@@ -33,7 +33,7 @@ OSQLInternalNode::OSQLInternalNode(const char* pNewValue,
}
-OSQLInternalNode::OSQLInternalNode(const OString &NewValue,
+OSQLInternalNode::OSQLInternalNode(std::string_view NewValue,
SQLNodeType eNodeType,
sal_uInt32 nNodeID)
:OSQLParseNode(NewValue,eNodeType,nNodeID)
diff --git a/connectivity/source/parse/sqlnode.cxx b/connectivity/source/parse/sqlnode.cxx
index d31bcd2a9ada..544d14e6491a 100644
--- a/connectivity/source/parse/sqlnode.cxx
+++ b/connectivity/source/parse/sqlnode.cxx
@@ -1599,7 +1599,7 @@ OSQLParseNode::OSQLParseNode(const char * pNewValue,
OSL_ENSURE(m_eNodeType >= SQLNodeType::Rule && m_eNodeType <= SQLNodeType::Concat,"OSQLParseNode: created with invalid NodeType");
}
-OSQLParseNode::OSQLParseNode(const OString &_rNewValue,
+OSQLParseNode::OSQLParseNode(std::string_view _rNewValue,
SQLNodeType eNewNodeType,
sal_uInt32 nNewNodeID)
:m_pParent(nullptr)
@@ -2508,7 +2508,7 @@ void OSQLParseNode::parseLeaf(OUStringBuffer& rString, const SQLParseNodeParamet
}
-sal_Int32 OSQLParser::getFunctionReturnType(const OUString& _sFunctionName, const IParseContext* pContext)
+sal_Int32 OSQLParser::getFunctionReturnType(std::u16string_view _sFunctionName, const IParseContext* pContext)
{
sal_Int32 nType = DataType::VARCHAR;
OString sFunctionName(OUStringToOString(_sFunctionName,RTL_TEXTENCODING_UTF8));