Kaydet (Commit) ce744c84 authored tarafından Caolán McNamara's avatar Caolán McNamara

cmcfixes73: #i110068# unify headers in one place

üst cd8457ee
...@@ -116,6 +116,9 @@ CDEFS+=-DCPPDBC_EXPORTS -DCPPCONN_LIB_BUILD ...@@ -116,6 +116,9 @@ CDEFS+=-DCPPDBC_EXPORTS -DCPPCONN_LIB_BUILD
CDEFS += -DCPPCONN_LIB=\"$(DLLPRE)mysqlcppconn$(DLLPOST)\" CDEFS += -DCPPCONN_LIB=\"$(DLLPRE)mysqlcppconn$(DLLPOST)\"
.ELSE .ELSE
CDEFS += -DCPPCONN_LIB=\"$(shell readlink /usr/lib/libmysqlcppconn.so)\" CDEFS += -DCPPCONN_LIB=\"$(shell readlink /usr/lib/libmysqlcppconn.so)\"
.IF "$(USE_SYSTEM_STL)"!="YES"
CDEFS += -DADAPT_EXT_STL
.ENDIF
.ENDIF .ENDIF
# --------------- MySQL settings ------------------ # --------------- MySQL settings ------------------
......
...@@ -26,11 +26,13 @@ ...@@ -26,11 +26,13 @@
* for a copy of the LGPLv3 License. * for a copy of the LGPLv3 License.
************************************************************************/ ************************************************************************/
#include <tools/preextstl.h>
#include <cppconn/driver.h> #include <cppconn/driver.h>
#include <cppconn/connection.h> #include <cppconn/connection.h>
#include <cppconn/statement.h> #include <cppconn/statement.h>
#include <cppconn/metadata.h> #include <cppconn/metadata.h>
#include <cppconn/exception.h> #include <cppconn/exception.h>
#include <tools/postextstl.h>
#include "mysqlc_connection.hxx" #include "mysqlc_connection.hxx"
#include "mysqlc_databasemetadata.hxx" #include "mysqlc_databasemetadata.hxx"
...@@ -186,10 +188,10 @@ void OConnection::construct(const OUString& url, const Sequence< PropertyValue > ...@@ -186,10 +188,10 @@ void OConnection::construct(const OUString& url, const Sequence< PropertyValue >
if (bEmbedded == sal_False) { if (bEmbedded == sal_False) {
try { try {
sql::ConnectOptionsMap connProps; sql::ConnectOptionsMap connProps;
std::string host_str = OUStringToOString(aHostName, m_settings.encoding).getStr(); ext_std::string host_str = OUStringToOString(aHostName, m_settings.encoding).getStr();
std::string user_str = OUStringToOString(aUser, m_settings.encoding).getStr(); ext_std::string user_str = OUStringToOString(aUser, m_settings.encoding).getStr();
std::string pass_str = OUStringToOString(aPass, m_settings.encoding).getStr(); ext_std::string pass_str = OUStringToOString(aPass, m_settings.encoding).getStr();
std::string schema_str = OUStringToOString(aDbName, m_settings.encoding).getStr(); ext_std::string schema_str = OUStringToOString(aDbName, m_settings.encoding).getStr();
connProps["hostName"] = sql::ConnectPropertyVal(host_str); connProps["hostName"] = sql::ConnectPropertyVal(host_str);
connProps["userName"] = sql::ConnectPropertyVal(user_str); connProps["userName"] = sql::ConnectPropertyVal(user_str);
connProps["password"] = sql::ConnectPropertyVal(pass_str); connProps["password"] = sql::ConnectPropertyVal(pass_str);
......
...@@ -46,7 +46,9 @@ ...@@ -46,7 +46,9 @@
#include <com/sun/star/sdbc/XWarningsSupplier.hpp> #include <com/sun/star/sdbc/XWarningsSupplier.hpp>
#include <com/sun/star/util/XStringSubstitution.hpp> #include <com/sun/star/util/XStringSubstitution.hpp>
#include <tools/preextstl.h>
#include <cppconn/driver.h> #include <cppconn/driver.h>
#include <tools/postextstl.h>
#include <cppuhelper/compbase3.hxx> #include <cppuhelper/compbase3.hxx>
#include <cppuhelper/weakref.hxx> #include <cppuhelper/weakref.hxx>
#include <rtl/string.hxx> #include <rtl/string.hxx>
......
...@@ -39,7 +39,9 @@ ...@@ -39,7 +39,9 @@
#include <cppuhelper/implbase1.hxx> #include <cppuhelper/implbase1.hxx>
#endif #endif
#include <tools/preextstl.h>
#include <cppconn/metadata.h> #include <cppconn/metadata.h>
#include <tools/postextstl.h>
namespace connectivity namespace connectivity
{ {
...@@ -67,8 +69,8 @@ namespace connectivity ...@@ -67,8 +69,8 @@ namespace connectivity
bool identifier_quote_string_set; bool identifier_quote_string_set;
private: private:
OUString impl_getStringMetaData( const sal_Char* _methodName, const std::string& (sql::DatabaseMetaData::*_Method)() ); OUString impl_getStringMetaData( const sal_Char* _methodName, const ext_std::string& (sql::DatabaseMetaData::*_Method)() );
OUString impl_getStringMetaData( const sal_Char* _methodName, std::string (sql::DatabaseMetaData::*_Method)() ); OUString impl_getStringMetaData( const sal_Char* _methodName, ext_std::string (sql::DatabaseMetaData::*_Method)() );
OUString impl_getStringMetaData( const sal_Char* _methodName, const sql::SQLString& (sql::DatabaseMetaData::*_Method)() ); OUString impl_getStringMetaData( const sal_Char* _methodName, const sql::SQLString& (sql::DatabaseMetaData::*_Method)() );
OUString impl_getStringMetaData( const sal_Char* _methodName, sql::SQLString (sql::DatabaseMetaData::*_Method)() ); OUString impl_getStringMetaData( const sal_Char* _methodName, sql::SQLString (sql::DatabaseMetaData::*_Method)() );
sal_Int32 impl_getInt32MetaData( const sal_Char* _methodName, unsigned int (sql::DatabaseMetaData::*_Method)() ); sal_Int32 impl_getInt32MetaData( const sal_Char* _methodName, unsigned int (sql::DatabaseMetaData::*_Method)() );
......
...@@ -38,11 +38,13 @@ using namespace connectivity::mysqlc; ...@@ -38,11 +38,13 @@ using namespace connectivity::mysqlc;
using ::rtl::OUString; using ::rtl::OUString;
#include <stdio.h> #include <stdio.h>
#include <tools/preextstl.h>
#include <cppconn/exception.h> #include <cppconn/exception.h>
#ifdef SYSTEM_MYSQL_CPPCONN #ifdef SYSTEM_MYSQL_CPPCONN
#include <mysql_driver.h> #include <mysql_driver.h>
#endif #endif
#include <tools/postextstl.h>
/* {{{ MysqlCDriver::MysqlCDriver() -I- */ /* {{{ MysqlCDriver::MysqlCDriver() -I- */
......
...@@ -36,7 +36,9 @@ ...@@ -36,7 +36,9 @@
#include <com/sun/star/lang/XServiceInfo.hpp> #include <com/sun/star/lang/XServiceInfo.hpp>
#include <cppuhelper/compbase2.hxx> #include <cppuhelper/compbase2.hxx>
#include <tools/preextstl.h>
#include <cppconn/driver.h> #include <cppconn/driver.h>
#include <tools/postextstl.h>
#include <osl/module.h> #include <osl/module.h>
namespace connectivity namespace connectivity
......
...@@ -162,14 +162,14 @@ int mysqlToOOOType(int cppConnType) ...@@ -162,14 +162,14 @@ int mysqlToOOOType(int cppConnType)
} }
::rtl::OUString convert(const ::std::string& _string, const rtl_TextEncoding encoding) ::rtl::OUString convert(const ::ext_std::string& _string, const rtl_TextEncoding encoding)
{ {
return ::rtl::OUString( _string.c_str(), _string.size(), encoding ); return ::rtl::OUString( _string.c_str(), _string.size(), encoding );
} }
::std::string convert(const ::rtl::OUString& _string, const rtl_TextEncoding encoding) ::ext_std::string convert(const ::rtl::OUString& _string, const rtl_TextEncoding encoding)
{ {
return ::std::string( ::rtl::OUStringToOString( _string, encoding ).getStr() ); return ::ext_std::string( ::rtl::OUStringToOString( _string, encoding ).getStr() );
} }
......
...@@ -30,7 +30,9 @@ ...@@ -30,7 +30,9 @@
#ifndef _MYSQLC_GENERAL_ #ifndef _MYSQLC_GENERAL_
#define _MYSQLC_GENERAL_ #define _MYSQLC_GENERAL_
#include <tools/preextstl.h>
#include <cppconn/exception.h> #include <cppconn/exception.h>
#include <tools/postextstl.h>
#include <com/sun/star/uno/XInterface.hpp> #include <com/sun/star/uno/XInterface.hpp>
#include <com/sun/star/sdbc/SQLException.hpp> #include <com/sun/star/sdbc/SQLException.hpp>
...@@ -58,9 +60,9 @@ namespace mysqlc_sdbc_driver ...@@ -58,9 +60,9 @@ namespace mysqlc_sdbc_driver
int mysqlToOOOType(int mysqlType) throw (); int mysqlToOOOType(int mysqlType) throw ();
::rtl::OUString convert(const ::std::string& _string, const rtl_TextEncoding encoding); ::rtl::OUString convert(const ::ext_std::string& _string, const rtl_TextEncoding encoding);
::std::string convert(const ::rtl::OUString& _string, const rtl_TextEncoding encoding); ::ext_std::string convert(const ::rtl::OUString& _string, const rtl_TextEncoding encoding);
} }
#endif #endif
...@@ -234,7 +234,7 @@ void SAL_CALL OPreparedStatement::setString(sal_Int32 parameter, const OUString& ...@@ -234,7 +234,7 @@ void SAL_CALL OPreparedStatement::setString(sal_Int32 parameter, const OUString&
checkParameterIndex(parameter); checkParameterIndex(parameter);
try { try {
std::string stringie(::rtl::OUStringToOString(x, m_pConnection->getConnectionEncoding()).getStr()); ext_std::string stringie(::rtl::OUStringToOString(x, m_pConnection->getConnectionEncoding()).getStr());
((sql::PreparedStatement *)cppStatement)->setString(parameter, stringie); ((sql::PreparedStatement *)cppStatement)->setString(parameter, stringie);
} catch (sql::MethodNotImplementedException) { } catch (sql::MethodNotImplementedException) {
mysqlc_sdbc_driver::throwFeatureNotImplementedException("OPreparedStatement::clearParameters", *this); mysqlc_sdbc_driver::throwFeatureNotImplementedException("OPreparedStatement::clearParameters", *this);
...@@ -344,7 +344,7 @@ void SAL_CALL OPreparedStatement::setDate(sal_Int32 parameter, const Date& aData ...@@ -344,7 +344,7 @@ void SAL_CALL OPreparedStatement::setDate(sal_Int32 parameter, const Date& aData
checkDisposed(OPreparedStatement::rBHelper.bDisposed); checkDisposed(OPreparedStatement::rBHelper.bDisposed);
checkParameterIndex(parameter); checkParameterIndex(parameter);
std::string dateStr; ext_std::string dateStr;
char buf[20]; char buf[20];
dateStr.append(my_i_to_a(buf, sizeof(buf)-1, aData.Year)); dateStr.append(my_i_to_a(buf, sizeof(buf)-1, aData.Year));
dateStr.append("-", 1); dateStr.append("-", 1);
...@@ -372,7 +372,7 @@ void SAL_CALL OPreparedStatement::setTime(sal_Int32 parameter, const Time& aVal) ...@@ -372,7 +372,7 @@ void SAL_CALL OPreparedStatement::setTime(sal_Int32 parameter, const Time& aVal)
checkDisposed(OPreparedStatement::rBHelper.bDisposed); checkDisposed(OPreparedStatement::rBHelper.bDisposed);
checkParameterIndex(parameter); checkParameterIndex(parameter);
std::string timeStr; ext_std::string timeStr;
char buf[20]; char buf[20];
timeStr.append(my_i_to_a(buf, sizeof(buf)-1, aVal.Hours)); timeStr.append(my_i_to_a(buf, sizeof(buf)-1, aVal.Hours));
timeStr.append(":", 1); timeStr.append(":", 1);
...@@ -400,7 +400,7 @@ void SAL_CALL OPreparedStatement::setTimestamp(sal_Int32 parameter, const DateTi ...@@ -400,7 +400,7 @@ void SAL_CALL OPreparedStatement::setTimestamp(sal_Int32 parameter, const DateTi
checkDisposed(OPreparedStatement::rBHelper.bDisposed); checkDisposed(OPreparedStatement::rBHelper.bDisposed);
checkParameterIndex(parameter); checkParameterIndex(parameter);
std::string timeStr; ext_std::string timeStr;
char buf[20]; char buf[20];
timeStr.append(my_i_to_a(buf, sizeof(buf)-1, aVal.Year)); timeStr.append(my_i_to_a(buf, sizeof(buf)-1, aVal.Year));
timeStr.append("-", 1); timeStr.append("-", 1);
...@@ -805,7 +805,7 @@ void SAL_CALL OPreparedStatement::setBytes(sal_Int32 parameter, const Sequence< ...@@ -805,7 +805,7 @@ void SAL_CALL OPreparedStatement::setBytes(sal_Int32 parameter, const Sequence<
checkDisposed(OPreparedStatement::rBHelper.bDisposed); checkDisposed(OPreparedStatement::rBHelper.bDisposed);
checkParameterIndex(parameter); checkParameterIndex(parameter);
std::string blobby((char *)x.getConstArray(), x.getLength()); ext_std::string blobby((char *)x.getConstArray(), x.getLength());
try { try {
((sql::PreparedStatement *)cppStatement)->setString(parameter, blobby); ((sql::PreparedStatement *)cppStatement)->setString(parameter, blobby);
} catch (sql::MethodNotImplementedException) { } catch (sql::MethodNotImplementedException) {
......
...@@ -48,7 +48,9 @@ ...@@ -48,7 +48,9 @@
#include <com/sun/star/io/XInputStream.hpp> #include <com/sun/star/io/XInputStream.hpp>
#endif #endif
#include <tools/preextstl.h>
#include <cppconn/prepared_statement.h> #include <cppconn/prepared_statement.h>
#include <tools/postextstl.h>
namespace connectivity namespace connectivity
{ {
......
...@@ -35,7 +35,9 @@ ...@@ -35,7 +35,9 @@
#include <com/sun/star/sdbc/XResultSetMetaData.hpp> #include <com/sun/star/sdbc/XResultSetMetaData.hpp>
#include <cppuhelper/implbase1.hxx> #include <cppuhelper/implbase1.hxx>
#include <tools/preextstl.h>
#include <cppconn/resultset_metadata.h> #include <cppconn/resultset_metadata.h>
#include <tools/postextstl.h>
namespace connectivity namespace connectivity
{ {
...@@ -62,7 +64,7 @@ namespace connectivity ...@@ -62,7 +64,7 @@ namespace connectivity
{ {
} }
inline ::rtl::OUString convert( const ::std::string& _string ) const inline ::rtl::OUString convert( const ::ext_std::string& _string ) const
{ {
return ::rtl::OUString( _string.c_str(), _string.size(), m_encoding ); return ::rtl::OUString( _string.c_str(), _string.size(), m_encoding );
} }
......
...@@ -13,7 +13,9 @@ ...@@ -13,7 +13,9 @@
#include <com/sun/star/sdbc/XWarningsSupplier.hpp> #include <com/sun/star/sdbc/XWarningsSupplier.hpp>
#include <com/sun/star/util/XCancellable.hpp> #include <com/sun/star/util/XCancellable.hpp>
#include <tools/preextstl.h>
#include <cppconn/statement.h> #include <cppconn/statement.h>
#include <tools/postextstl.h>
#include <cppuhelper/compbase5.hxx> #include <cppuhelper/compbase5.hxx>
#include <list> #include <list>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment