diff options
Diffstat (limited to 'odk/examples/DevelopersGuide/Database/DriverSkeleton')
19 files changed, 538 insertions, 538 deletions
diff --git a/odk/examples/DevelopersGuide/Database/DriverSkeleton/OSubComponent.hxx b/odk/examples/DevelopersGuide/Database/DriverSkeleton/OSubComponent.hxx index 2de4fbecab35..4d728611b18f 100644 --- a/odk/examples/DevelopersGuide/Database/DriverSkeleton/OSubComponent.hxx +++ b/odk/examples/DevelopersGuide/Database/DriverSkeleton/OSubComponent.hxx @@ -3,7 +3,7 @@ * * The Contents of this file are made available subject to the terms of * the BSD license. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * All rights reserved. * @@ -30,7 +30,7 @@ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * + * *************************************************************************/ #ifndef _CONNECTIVITY_OSUBCOMPONENT_HXX_ @@ -79,7 +79,7 @@ namespace connectivity protected: // the parent must support the tunnel implementation ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > m_xParent; - SELF* m_pDerivedImplementation; + SELF* m_pDerivedImplementation; public: OSubComponent( @@ -112,14 +112,14 @@ namespace connectivity class OPropertyArrayUsageHelper { protected: - static sal_Int32 s_nRefCount; - static ::cppu::IPropertyArrayHelper* s_pProps; - static ::osl::Mutex s_aMutex; + static sal_Int32 s_nRefCount; + static ::cppu::IPropertyArrayHelper* s_pProps; + static ::osl::Mutex s_aMutex; public: OPropertyArrayUsageHelper(); virtual ~OPropertyArrayUsageHelper() - { // ARGHHHHHHH ..... would like to implement this in proparrhlp_impl.hxx (as we do with all other methods) + { // ARGHHHHHHH ..... would like to implement this in proparrhlp_impl.hxx (as we do with all other methods) // but SUNPRO 5 compiler (linker) doesn't like this ::osl::MutexGuard aGuard(s_aMutex); OSL_ENSURE(s_nRefCount > 0, "OPropertyArrayUsageHelper::~OPropertyArrayUsageHelper : suspicious call : have a refcount of 0 !"); @@ -133,7 +133,7 @@ namespace connectivity /** call this in the getInfoHelper method of your derived class. The method returns the array helper of the class, which is created if neccessary. */ - ::cppu::IPropertyArrayHelper* getArrayHelper(); + ::cppu::IPropertyArrayHelper* getArrayHelper(); protected: /** used to implement the creation of the array helper which is shared amongst all instances of the class. @@ -143,19 +143,19 @@ namespace connectivity <BR> as long as IPropertyArrayHelper has no virtual destructor, the implementation of ~OPropertyArrayUsageHelper assumes that you created an ::cppu::OPropertyArrayHelper when deleting s_pProps. - @return an pointer to the newly created array helper. Must not be NULL. + @return an pointer to the newly created array helper. Must not be NULL. */ virtual ::cppu::IPropertyArrayHelper* createArrayHelper( ) const = 0; }; - template<class TYPE> - sal_Int32 OPropertyArrayUsageHelper< TYPE >::s_nRefCount = 0; + template<class TYPE> + sal_Int32 OPropertyArrayUsageHelper< TYPE >::s_nRefCount = 0; - template<class TYPE> - ::cppu::IPropertyArrayHelper* OPropertyArrayUsageHelper< TYPE >::s_pProps = NULL; + template<class TYPE> + ::cppu::IPropertyArrayHelper* OPropertyArrayUsageHelper< TYPE >::s_pProps = NULL; - template<class TYPE> - ::osl::Mutex OPropertyArrayUsageHelper< TYPE >::s_aMutex; + template<class TYPE> + ::osl::Mutex OPropertyArrayUsageHelper< TYPE >::s_aMutex; //------------------------------------------------------------------ template <class TYPE> @@ -219,32 +219,32 @@ namespace connectivity } -#define DECLARE_SERVICE_INFO() \ - virtual ::rtl::OUString SAL_CALL getImplementationName( ) throw (::com::sun::star::uno::RuntimeException); \ - virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName ) throw(::com::sun::star::uno::RuntimeException); \ - virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames( ) throw(::com::sun::star::uno::RuntimeException) \ - -#define IMPLEMENT_SERVICE_INFO(classname, implasciiname, serviceasciiname) \ - ::rtl::OUString SAL_CALL classname::getImplementationName( ) throw (::com::sun::star::uno::RuntimeException) \ - { \ - return ::rtl::OUString::createFromAscii(implasciiname); \ - } \ - ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL classname::getSupportedServiceNames( ) throw(::com::sun::star::uno::RuntimeException) \ - { \ - ::com::sun::star::uno::Sequence< ::rtl::OUString > aSupported(1); \ - aSupported[0] = ::rtl::OUString::createFromAscii(serviceasciiname); \ - return aSupported; \ - } \ - sal_Bool SAL_CALL classname::supportsService( const ::rtl::OUString& _rServiceName ) throw(::com::sun::star::uno::RuntimeException) \ - { \ - Sequence< ::rtl::OUString > aSupported(getSupportedServiceNames()); \ - const ::rtl::OUString* pSupported = aSupported.getConstArray(); \ - const ::rtl::OUString* pEnd = pSupported + aSupported.getLength(); \ - for (;pSupported != pEnd && !pSupported->equals(_rServiceName); ++pSupported) \ - ; \ +#define DECLARE_SERVICE_INFO() \ + virtual ::rtl::OUString SAL_CALL getImplementationName( ) throw (::com::sun::star::uno::RuntimeException); \ + virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName ) throw(::com::sun::star::uno::RuntimeException); \ + virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames( ) throw(::com::sun::star::uno::RuntimeException) \ + +#define IMPLEMENT_SERVICE_INFO(classname, implasciiname, serviceasciiname) \ + ::rtl::OUString SAL_CALL classname::getImplementationName( ) throw (::com::sun::star::uno::RuntimeException) \ + { \ + return ::rtl::OUString::createFromAscii(implasciiname); \ + } \ + ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL classname::getSupportedServiceNames( ) throw(::com::sun::star::uno::RuntimeException) \ + { \ + ::com::sun::star::uno::Sequence< ::rtl::OUString > aSupported(1); \ + aSupported[0] = ::rtl::OUString::createFromAscii(serviceasciiname); \ + return aSupported; \ + } \ + sal_Bool SAL_CALL classname::supportsService( const ::rtl::OUString& _rServiceName ) throw(::com::sun::star::uno::RuntimeException) \ + { \ + Sequence< ::rtl::OUString > aSupported(getSupportedServiceNames()); \ + const ::rtl::OUString* pSupported = aSupported.getConstArray(); \ + const ::rtl::OUString* pEnd = pSupported + aSupported.getLength(); \ + for (;pSupported != pEnd && !pSupported->equals(_rServiceName); ++pSupported) \ + ; \ \ - return pSupported != pEnd; \ - } \ + return pSupported != pEnd; \ + } \ } diff --git a/odk/examples/DevelopersGuide/Database/DriverSkeleton/OTypeInfo.hxx b/odk/examples/DevelopersGuide/Database/DriverSkeleton/OTypeInfo.hxx index 912f07bb64d7..4a28333adc35 100644 --- a/odk/examples/DevelopersGuide/Database/DriverSkeleton/OTypeInfo.hxx +++ b/odk/examples/DevelopersGuide/Database/DriverSkeleton/OTypeInfo.hxx @@ -3,7 +3,7 @@ * * The Contents of this file are made available subject to the terms of * the BSD license. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * All rights reserved. * @@ -30,7 +30,7 @@ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * + * *************************************************************************/ #ifndef _CONNECTIVITY_OTYPEINFO_HXX_ @@ -43,28 +43,28 @@ namespace connectivity { struct OTypeInfo { - ::rtl::OUString aTypeName; // Name des Types in der Datenbank - ::rtl::OUString aLiteralPrefix; // Prefix zum Quoten - ::rtl::OUString aLiteralSuffix; // Suffix zum Quoten - ::rtl::OUString aCreateParams; // Parameter zum Erstellen - ::rtl::OUString aLocalTypeName; - - sal_Int32 nPrecision; // Laenge des Types - - sal_Int16 nMaximumScale; // Nachkommastellen - sal_Int16 nMinimumScale; // Min Nachkommastellen - - sal_Int16 nType; // Datenbanktyp - sal_Int16 nSearchType; // kann nach dem Typen gesucht werden - sal_Int16 nNumPrecRadix; // indicating the radix, which is usually 2 or 10 - - sal_Bool bCurrency : 1, // Waehrung - bAutoIncrement : 1, // Ist es ein automatisch incrementierendes Feld - bNullable : 1, // Kann das Feld NULL annehmen - bCaseSensitive : 1, // Ist der Type Casesensitive - bUnsigned : 1, // Ist der Type Unsigned - bEmpty_1 : 1, // for later use - bEmpty_2 : 1; + ::rtl::OUString aTypeName; // Name des Types in der Datenbank + ::rtl::OUString aLiteralPrefix; // Prefix zum Quoten + ::rtl::OUString aLiteralSuffix; // Suffix zum Quoten + ::rtl::OUString aCreateParams; // Parameter zum Erstellen + ::rtl::OUString aLocalTypeName; + + sal_Int32 nPrecision; // Laenge des Types + + sal_Int16 nMaximumScale; // Nachkommastellen + sal_Int16 nMinimumScale; // Min Nachkommastellen + + sal_Int16 nType; // Datenbanktyp + sal_Int16 nSearchType; // kann nach dem Typen gesucht werden + sal_Int16 nNumPrecRadix; // indicating the radix, which is usually 2 or 10 + + sal_Bool bCurrency : 1, // Waehrung + bAutoIncrement : 1, // Ist es ein automatisch incrementierendes Feld + bNullable : 1, // Kann das Feld NULL annehmen + bCaseSensitive : 1, // Ist der Type Casesensitive + bUnsigned : 1, // Ist der Type Unsigned + bEmpty_1 : 1, // for later use + bEmpty_2 : 1; OTypeInfo() :bCurrency(sal_False) diff --git a/odk/examples/DevelopersGuide/Database/DriverSkeleton/SConnection.cxx b/odk/examples/DevelopersGuide/Database/DriverSkeleton/SConnection.cxx index 1e52822705b8..62c70353b9f2 100644 --- a/odk/examples/DevelopersGuide/Database/DriverSkeleton/SConnection.cxx +++ b/odk/examples/DevelopersGuide/Database/DriverSkeleton/SConnection.cxx @@ -3,7 +3,7 @@ * * The Contents of this file are made available subject to the terms of * the BSD license. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * All rights reserved. * @@ -30,7 +30,7 @@ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * + * *************************************************************************/ #include "SConnection.hxx" @@ -52,7 +52,7 @@ using namespace com::sun::star::lang; using namespace com::sun::star::beans; using namespace com::sun::star::sdbc; // -------------------------------------------------------------------------------- -OConnection::OConnection(SkeletonDriver* _pDriver) +OConnection::OConnection(SkeletonDriver* _pDriver) : OSubComponent<OConnection, OConnection_BASE>((::cppu::OWeakObject*)_pDriver, this), OMetaConnection_BASE(m_aMutex), m_pDriver(_pDriver), @@ -81,7 +81,7 @@ void SAL_CALL OConnection::release() throw() void OConnection::construct(const ::rtl::OUString& url,const Sequence< PropertyValue >& info) throw(SQLException) { osl_incrementInterlockedCount( &m_refCount ); - + // some example code how to get the information out of the sequence sal_Int32 nLen = url.indexOf(':'); @@ -89,17 +89,17 @@ void OConnection::construct(const ::rtl::OUString& url,const Sequence< PropertyV ::rtl::OUString aDSN(RTL_CONSTASCII_USTRINGPARAM("DSN=")), aUID, aPWD, aSysDrvSettings; aDSN += url.copy(nLen+1); - const char* pUser = "user"; - const char* pTimeout = "Timeout"; - const char* pSilent = "Silent"; - const char* pPwd = "password"; + const char* pUser = "user"; + const char* pTimeout = "Timeout"; + const char* pSilent = "Silent"; + const char* pPwd = "password"; const char* pUseCatalog = "UseCatalog"; - const char* pSysDrv = "SystemDriverSettings"; + const char* pSysDrv = "SystemDriverSettings"; sal_Int32 nTimeout = 20; sal_Bool bSilent = sal_True; - const PropertyValue *pBegin = info.getConstArray(); - const PropertyValue *pEnd = pBegin + info.getLength(); + const PropertyValue *pBegin = info.getConstArray(); + const PropertyValue *pEnd = pBegin + info.getLength(); for(;pBegin != pEnd;++pBegin) { if(!pBegin->Name.compareToAscii(pTimeout)) @@ -140,7 +140,7 @@ Reference< XStatement > SAL_CALL OConnection::createStatement( ) throw(SQLExcep { ::osl::MutexGuard aGuard( m_aMutex ); checkDisposed(OConnection_BASE::rBHelper.bDisposed); - + // create a statement // the statement can only be executed once Reference< XStatement > xReturn = new OStatement(this); @@ -152,7 +152,7 @@ Reference< XPreparedStatement > SAL_CALL OConnection::prepareStatement( const :: { ::osl::MutexGuard aGuard( m_aMutex ); checkDisposed(OConnection_BASE::rBHelper.bDisposed); - + // the pre if(m_aTypeInfo.empty()) buildTypeInfo(); @@ -168,8 +168,8 @@ Reference< XPreparedStatement > SAL_CALL OConnection::prepareCall( const ::rtl:: { ::osl::MutexGuard aGuard( m_aMutex ); checkDisposed(OConnection_BASE::rBHelper.bDisposed); - - // not implemented yet :-) a task to do + + // not implemented yet :-) a task to do return NULL; } // -------------------------------------------------------------------------------- @@ -177,7 +177,7 @@ Reference< XPreparedStatement > SAL_CALL OConnection::prepareCall( const ::rtl:: { ::osl::MutexGuard aGuard( m_aMutex ); // when you need to transform SQL92 to you driver specific you can do it here - + return _sSql; } // -------------------------------------------------------------------------------- @@ -210,7 +210,7 @@ void SAL_CALL OConnection::rollback( ) throw(SQLException, RuntimeException) { ::osl::MutexGuard aGuard( m_aMutex ); checkDisposed(OConnection_BASE::rBHelper.bDisposed); - + // same as commit but for the other case } @@ -218,7 +218,7 @@ void SAL_CALL OConnection::rollback( ) throw(SQLException, RuntimeException) sal_Bool SAL_CALL OConnection::isClosed( ) throw(SQLException, RuntimeException) { ::osl::MutexGuard aGuard( m_aMutex ); - + // just simple -> we are close when we are disposed taht means someone called dispose(); (XComponent) return OConnection_BASE::rBHelper.bDisposed; } @@ -227,7 +227,7 @@ Reference< XDatabaseMetaData > SAL_CALL OConnection::getMetaData( ) throw(SQLEx { ::osl::MutexGuard aGuard( m_aMutex ); checkDisposed(OConnection_BASE::rBHelper.bDisposed); - + // here we have to create the class with biggest interface // The answer is 42 :-) Reference< XDatabaseMetaData > xMetaData = m_xMetaData; @@ -244,15 +244,15 @@ void SAL_CALL OConnection::setReadOnly( sal_Bool readOnly ) throw(SQLException, { ::osl::MutexGuard aGuard( m_aMutex ); checkDisposed(OConnection_BASE::rBHelper.bDisposed); - + // set you connection to readonly } // -------------------------------------------------------------------------------- sal_Bool SAL_CALL OConnection::isReadOnly( ) throw(SQLException, RuntimeException) -{ +{ ::osl::MutexGuard aGuard( m_aMutex ); checkDisposed(OConnection_BASE::rBHelper.bDisposed); - + // return if your connection to readonly return sal_False; } @@ -269,7 +269,7 @@ void SAL_CALL OConnection::setCatalog( const ::rtl::OUString& catalog ) throw(SQ { ::osl::MutexGuard aGuard( m_aMutex ); checkDisposed(OConnection_BASE::rBHelper.bDisposed); - + // return your current catalog return ::rtl::OUString(); @@ -288,7 +288,7 @@ sal_Int32 SAL_CALL OConnection::getTransactionIsolation( ) throw(SQLException, { ::osl::MutexGuard aGuard( m_aMutex ); checkDisposed(OConnection_BASE::rBHelper.bDisposed); - + // please have a look at @see com.sun.star.sdbc.TransactionIsolation return TransactionIsolation::NONE; @@ -298,7 +298,7 @@ Reference< ::com::sun::star::container::XNameAccess > SAL_CALL OConnection::getT { ::osl::MutexGuard aGuard( m_aMutex ); checkDisposed(OConnection_BASE::rBHelper.bDisposed); - + // if your driver has special database types you can return it here return NULL; @@ -316,7 +316,7 @@ void SAL_CALL OConnection::close( ) throw(SQLException, RuntimeException) { ::osl::MutexGuard aGuard( m_aMutex ); checkDisposed(OConnection_BASE::rBHelper.bDisposed); - + } dispose(); } @@ -340,30 +340,30 @@ void OConnection::buildTypeInfo() throw( SQLException) Reference< XResultSet> xRs = getMetaData ()->getTypeInfo (); Reference< XRow> xRow(xRs,UNO_QUERY); // Information for a single SQL type - + // Loop on the result set until we reach end of file - while (xRs->next ()) + while (xRs->next ()) { OTypeInfo aInfo; - aInfo.aTypeName = xRow->getString (1); - aInfo.nType = xRow->getShort (2); - aInfo.nPrecision = xRow->getInt (3); - aInfo.aLiteralPrefix = xRow->getString (4); - aInfo.aLiteralSuffix = xRow->getString (5); - aInfo.aCreateParams = xRow->getString (6); - aInfo.bNullable = xRow->getBoolean (7) == ColumnValue::NULLABLE; - aInfo.bCaseSensitive = xRow->getBoolean (8); - aInfo.nSearchType = xRow->getShort (9); - aInfo.bUnsigned = xRow->getBoolean (10); - aInfo.bCurrency = xRow->getBoolean (11); - aInfo.bAutoIncrement = xRow->getBoolean (12); - aInfo.aLocalTypeName = xRow->getString (13); - aInfo.nMinimumScale = xRow->getShort (14); - aInfo.nMaximumScale = xRow->getShort (15); - aInfo.nNumPrecRadix = (sal_Int16)xRow->getInt(18); - - + aInfo.aTypeName = xRow->getString (1); + aInfo.nType = xRow->getShort (2); + aInfo.nPrecision = xRow->getInt (3); + aInfo.aLiteralPrefix = xRow->getString (4); + aInfo.aLiteralSuffix = xRow->getString (5); + aInfo.aCreateParams = xRow->getString (6); + aInfo.bNullable = xRow->getBoolean (7) == ColumnValue::NULLABLE; + aInfo.bCaseSensitive = xRow->getBoolean (8); + aInfo.nSearchType = xRow->getShort (9); + aInfo.bUnsigned = xRow->getBoolean (10); + aInfo.bCurrency = xRow->getBoolean (11); + aInfo.bAutoIncrement = xRow->getBoolean (12); + aInfo.aLocalTypeName = xRow->getString (13); + aInfo.nMinimumScale = xRow->getShort (14); + aInfo.nMaximumScale = xRow->getShort (15); + aInfo.nNumPrecRadix = (sal_Int16)xRow->getInt(18); + + // Now that we have the type info, save it // in the Hashtable if we don't already have an @@ -382,7 +382,7 @@ void OConnection::disposing() { // we noticed that we should be destroied in near future so we have to dispose our statements ::osl::MutexGuard aGuard(m_aMutex); - + for (OWeakRefArray::iterator i = m_aStatements.begin(); m_aStatements.end() != i; ++i) { Reference< XComponent > xComp(i->get(), UNO_QUERY); @@ -391,7 +391,7 @@ void OConnection::disposing() } m_aStatements.clear(); - m_bClosed = sal_True; + m_bClosed = sal_True; m_xMetaData = ::com::sun::star::uno::WeakReference< ::com::sun::star::sdbc::XDatabaseMetaData>(); dispose_ChildImpl(); diff --git a/odk/examples/DevelopersGuide/Database/DriverSkeleton/SConnection.hxx b/odk/examples/DevelopersGuide/Database/DriverSkeleton/SConnection.hxx index 8072094d7346..8961cf49bfa4 100644 --- a/odk/examples/DevelopersGuide/Database/DriverSkeleton/SConnection.hxx +++ b/odk/examples/DevelopersGuide/Database/DriverSkeleton/SConnection.hxx @@ -3,7 +3,7 @@ * * The Contents of this file are made available subject to the terms of * the BSD license. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * All rights reserved. * @@ -30,7 +30,7 @@ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * + * *************************************************************************/ #ifndef CONNECTIVITY_SCONNECTION_HXX @@ -64,8 +64,8 @@ namespace connectivity class SkeletonDriver; class ODatabaseMetaData; - typedef OMetaConnection_BASE OConnection_BASE; // implements basics and text encoding - typedef ::std::vector< ::connectivity::OTypeInfo> TTypeInfoVector; + typedef OMetaConnection_BASE OConnection_BASE; // implements basics and text encoding + typedef ::std::vector< ::connectivity::OTypeInfo> TTypeInfoVector; typedef std::vector< ::com::sun::star::uno::WeakReferenceHelper > OWeakRefArray; class OConnection : public OBase_Mutex, @@ -75,38 +75,38 @@ namespace connectivity friend class connectivity::skeleton::OSubComponent<OConnection, OConnection_BASE>; protected: - - rtl_TextEncoding m_nTextEncoding; // the encoding which is used for all text conversions + + rtl_TextEncoding m_nTextEncoding; // the encoding which is used for all text conversions //==================================================================== // Data attributes //==================================================================== - TTypeInfoVector m_aTypeInfo; // vector containing an entry + TTypeInfoVector m_aTypeInfo; // vector containing an entry // for each row returned by // DatabaseMetaData.getTypeInfo. ::com::sun::star::uno::WeakReference< ::com::sun::star::sdbc::XDatabaseMetaData > m_xMetaData; - OWeakRefArray m_aStatements; // vector containing a list + OWeakRefArray m_aStatements; // vector containing a list // of all the Statement objects // for this Connection ::com::sun::star::sdbc::SQLWarning m_aLastWarning; // Last SQLWarning generated by // an operation - ::rtl::OUString m_aURL; // URL of connection - ::rtl::OUString m_sUser; // the user name - SkeletonDriver* m_pDriver; // Pointer to the owning + ::rtl::OUString m_aURL; // URL of connection + ::rtl::OUString m_sUser; // the user name + SkeletonDriver* m_pDriver; // Pointer to the owning // driver object - - sal_Bool m_bClosed; - sal_Bool m_bUseCatalog; // should we use the catalog on filebased databases - sal_Bool m_bUseOldDateFormat; + + sal_Bool m_bClosed; + sal_Bool m_bUseCatalog; // should we use the catalog on filebased databases + sal_Bool m_bUseOldDateFormat; void buildTypeInfo() throw( ::com::sun::star::sdbc::SQLException); - + public: virtual void construct( const ::rtl::OUString& url,const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& info) throw(::com::sun::star::sdbc::SQLException); - OConnection(SkeletonDriver* _pDriver); + OConnection(SkeletonDriver* _pDriver); virtual ~OConnection(); void closeAllStatements () throw( ::com::sun::star::sdbc::SQLException); @@ -143,12 +143,12 @@ namespace connectivity virtual ::com::sun::star::uno::Any SAL_CALL getWarnings( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException); virtual void SAL_CALL clearWarnings( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException); // - + // should we use the catalog on filebased databases - inline sal_Bool isCatalogUsed() const { return m_bUseCatalog; } - inline ::rtl::OUString getUserName() const { return m_sUser; } - inline SkeletonDriver* getDriver() const { return m_pDriver;} - inline rtl_TextEncoding getTextEncoding() const { return m_nTextEncoding; } + inline sal_Bool isCatalogUsed() const { return m_bUseCatalog; } + inline ::rtl::OUString getUserName() const { return m_sUser; } + inline SkeletonDriver* getDriver() const { return m_pDriver;} + inline rtl_TextEncoding getTextEncoding() const { return m_nTextEncoding; } }; } } diff --git a/odk/examples/DevelopersGuide/Database/DriverSkeleton/SDatabaseMetaData.cxx b/odk/examples/DevelopersGuide/Database/DriverSkeleton/SDatabaseMetaData.cxx index 0a8bf55cbed1..b17b8053e9b0 100644 --- a/odk/examples/DevelopersGuide/Database/DriverSkeleton/SDatabaseMetaData.cxx +++ b/odk/examples/DevelopersGuide/Database/DriverSkeleton/SDatabaseMetaData.cxx @@ -3,7 +3,7 @@ * * The Contents of this file are made available subject to the terms of * the BSD license. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * All rights reserved. * @@ -30,7 +30,7 @@ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * + * *************************************************************************/ #include "SDatabaseMetaData.hxx" @@ -45,7 +45,7 @@ using namespace com::sun::star::lang; using namespace com::sun::star::beans; using namespace com::sun::star::sdbc; -ODatabaseMetaData::ODatabaseMetaData(OConnection* _pCon) +ODatabaseMetaData::ODatabaseMetaData(OConnection* _pCon) : m_pConnection(_pCon) , m_bUseCatalog(sal_True) { @@ -53,7 +53,7 @@ ODatabaseMetaData::ODatabaseMetaData(OConnection* _pCon) if(!m_pConnection->isCatalogUsed()) { osl_incrementInterlockedCount( &m_refCount ); - m_bUseCatalog = !(usesLocalFiles() || usesLocalFilePerTable()); + m_bUseCatalog = !(usesLocalFiles() || usesLocalFilePerTable()); osl_decrementInterlockedCount( &m_refCount ); } } @@ -789,88 +789,88 @@ Reference< XResultSet > SAL_CALL ODatabaseMetaData::getSchemas( ) throw(SQLExce return NULL; } // ------------------------------------------------------------------------- -Reference< XResultSet > SAL_CALL ODatabaseMetaData::getColumnPrivileges( - const Any& catalog, const ::rtl::OUString& schema, const ::rtl::OUString& table, +Reference< XResultSet > SAL_CALL ODatabaseMetaData::getColumnPrivileges( + const Any& catalog, const ::rtl::OUString& schema, const ::rtl::OUString& table, const ::rtl::OUString& columnNamePattern ) throw(SQLException, RuntimeException) { return NULL; } // ------------------------------------------------------------------------- -Reference< XResultSet > SAL_CALL ODatabaseMetaData::getColumns( - const Any& catalog, const ::rtl::OUString& schemaPattern, const ::rtl::OUString& tableNamePattern, +Reference< XResultSet > SAL_CALL ODatabaseMetaData::getColumns( + const Any& catalog, const ::rtl::OUString& schemaPattern, const ::rtl::OUString& tableNamePattern, const ::rtl::OUString& columnNamePattern ) throw(SQLException, RuntimeException) { return NULL; } // ------------------------------------------------------------------------- -Reference< XResultSet > SAL_CALL ODatabaseMetaData::getTables( - const Any& catalog, const ::rtl::OUString& schemaPattern, +Reference< XResultSet > SAL_CALL ODatabaseMetaData::getTables( + const Any& catalog, const ::rtl::OUString& schemaPattern, const ::rtl::OUString& tableNamePattern, const Sequence< ::rtl::OUString >& types ) throw(SQLException, RuntimeException) { return NULL; } // ------------------------------------------------------------------------- -Reference< XResultSet > SAL_CALL ODatabaseMetaData::getProcedureColumns( - const Any& catalog, const ::rtl::OUString& schemaPattern, +Reference< XResultSet > SAL_CALL ODatabaseMetaData::getProcedureColumns( + const Any& catalog, const ::rtl::OUString& schemaPattern, const ::rtl::OUString& procedureNamePattern, const ::rtl::OUString& columnNamePattern ) throw(SQLException, RuntimeException) { return NULL; } // ------------------------------------------------------------------------- -Reference< XResultSet > SAL_CALL ODatabaseMetaData::getProcedures( - const Any& catalog, const ::rtl::OUString& schemaPattern, +Reference< XResultSet > SAL_CALL ODatabaseMetaData::getProcedures( + const Any& catalog, const ::rtl::OUString& schemaPattern, const ::rtl::OUString& procedureNamePattern ) throw(SQLException, RuntimeException) { return NULL; } // ------------------------------------------------------------------------- -Reference< XResultSet > SAL_CALL ODatabaseMetaData::getVersionColumns( +Reference< XResultSet > SAL_CALL ODatabaseMetaData::getVersionColumns( const Any& catalog, const ::rtl::OUString& schema, const ::rtl::OUString& table ) throw(SQLException, RuntimeException) { return NULL; } // ------------------------------------------------------------------------- -Reference< XResultSet > SAL_CALL ODatabaseMetaData::getExportedKeys( +Reference< XResultSet > SAL_CALL ODatabaseMetaData::getExportedKeys( const Any& catalog, const ::rtl::OUString& schema, const ::rtl::OUString& table ) throw(SQLException, RuntimeException) { return NULL; } // ------------------------------------------------------------------------- -Reference< XResultSet > SAL_CALL ODatabaseMetaData::getImportedKeys( +Reference< XResultSet > SAL_CALL ODatabaseMetaData::getImportedKeys( const Any& catalog, const ::rtl::OUString& schema, const ::rtl::OUString& table ) throw(SQLException, RuntimeException) { return NULL; } // ------------------------------------------------------------------------- -Reference< XResultSet > SAL_CALL ODatabaseMetaData::getPrimaryKeys( +Reference< XResultSet > SAL_CALL ODatabaseMetaData::getPrimaryKeys( const Any& catalog, const ::rtl::OUString& schema, const ::rtl::OUString& table ) throw(SQLException, RuntimeException) { return NULL; } // ------------------------------------------------------------------------- -Reference< XResultSet > SAL_CALL ODatabaseMetaData::getIndexInfo( - const Any& catalog, const ::rtl::OUString& schema, const ::rtl::OUString& table, +Reference< XResultSet > SAL_CALL ODatabaseMetaData::getIndexInfo( + const Any& catalog, const ::rtl::OUString& schema, const ::rtl::OUString& table, sal_Bool unique, sal_Bool approximate ) throw(SQLException, RuntimeException) { return NULL; } // ------------------------------------------------------------------------- -Reference< XResultSet > SAL_CALL ODatabaseMetaData::getBestRowIdentifier( - const Any& catalog, const ::rtl::OUString& schema, const ::rtl::OUString& table, sal_Int32 scope, +Reference< XResultSet > SAL_CALL ODatabaseMetaData::getBestRowIdentifier( + const Any& catalog, const ::rtl::OUString& schema, const ::rtl::OUString& table, sal_Int32 scope, sal_Bool nullable ) throw(SQLException, RuntimeException) { return NULL; } // ------------------------------------------------------------------------- -Reference< XResultSet > SAL_CALL ODatabaseMetaData::getTablePrivileges( +Reference< XResultSet > SAL_CALL ODatabaseMetaData::getTablePrivileges( const Any& catalog, const ::rtl::OUString& schemaPattern, const ::rtl::OUString& tableNamePattern ) throw(SQLException, RuntimeException) { return NULL; } // ------------------------------------------------------------------------- -Reference< XResultSet > SAL_CALL ODatabaseMetaData::getCrossReference( - const Any& primaryCatalog, const ::rtl::OUString& primarySchema, - const ::rtl::OUString& primaryTable, const Any& foreignCatalog, +Reference< XResultSet > SAL_CALL ODatabaseMetaData::getCrossReference( + const Any& primaryCatalog, const ::rtl::OUString& primarySchema, + const ::rtl::OUString& primaryTable, const Any& foreignCatalog, const ::rtl::OUString& foreignSchema, const ::rtl::OUString& foreignTable ) throw(SQLException, RuntimeException) { return NULL; diff --git a/odk/examples/DevelopersGuide/Database/DriverSkeleton/SDatabaseMetaData.hxx b/odk/examples/DevelopersGuide/Database/DriverSkeleton/SDatabaseMetaData.hxx index bdd3ac439796..4e62def377fd 100644 --- a/odk/examples/DevelopersGuide/Database/DriverSkeleton/SDatabaseMetaData.hxx +++ b/odk/examples/DevelopersGuide/Database/DriverSkeleton/SDatabaseMetaData.hxx @@ -3,7 +3,7 @@ * * The Contents of this file are made available subject to the terms of * the BSD license. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * All rights reserved. * @@ -30,7 +30,7 @@ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * + * *************************************************************************/ #ifndef CONNECTIVITY_SDATABASEMETADATA_HXX @@ -52,8 +52,8 @@ namespace connectivity class ODatabaseMetaData : public ODatabaseMetaData_BASE { - OConnection* m_pConnection; - sal_Bool m_bUseCatalog; + OConnection* m_pConnection; + sal_Bool m_bUseCatalog; public: inline OConnection* getOwnConnection() const { return m_pConnection; } diff --git a/odk/examples/DevelopersGuide/Database/DriverSkeleton/SDriver.cxx b/odk/examples/DevelopersGuide/Database/DriverSkeleton/SDriver.cxx index 6e3521d8b878..d0f435effe60 100644 --- a/odk/examples/DevelopersGuide/Database/DriverSkeleton/SDriver.cxx +++ b/odk/examples/DevelopersGuide/Database/DriverSkeleton/SDriver.cxx @@ -3,7 +3,7 @@ * * The Contents of this file are made available subject to the terms of * the BSD license. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * All rights reserved. * @@ -30,7 +30,7 @@ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * + * *************************************************************************/ #include "SDriver.hxx" @@ -54,7 +54,7 @@ namespace connectivity } } // -------------------------------------------------------------------------------- -SkeletonDriver::SkeletonDriver() +SkeletonDriver::SkeletonDriver() : ODriver_BASE(m_aMutex) { } @@ -62,7 +62,7 @@ SkeletonDriver::SkeletonDriver() void SkeletonDriver::disposing() { ::osl::MutexGuard aGuard(m_aMutex); - + // when driver will be destroied so all our connections have to be destroied as well for (OWeakRefArray::iterator i = m_xConnections.begin(); m_xConnections.end() != i; ++i) { @@ -86,7 +86,7 @@ rtl::OUString SkeletonDriver::getImplementationName_Static( ) throw(RuntimeExce //------------------------------------------------------------------------------ Sequence< ::rtl::OUString > SkeletonDriver::getSupportedServiceNames_Static( ) throw (RuntimeException) { - // which service is supported + // which service is supported // for more information @see com.sun.star.sdbc.Driver Sequence< ::rtl::OUString > aSNS( 1 ); aSNS[0] = ::rtl::OUString::createFromAscii("com.sun.star.sdbc.Driver"); @@ -122,14 +122,14 @@ Reference< XConnection > SAL_CALL SkeletonDriver::connect( const ::rtl::OUString { // create a new connection with the given properties and append it to our vector OConnection* pCon = new OConnection(this); - Reference< XConnection > xCon = pCon; // important here because otherwise the connection could be deleted inside (refcount goes -> 0) - pCon->construct(url,info); // late constructor call which can throw exception and allows a correct dtor call when so + Reference< XConnection > xCon = pCon; // important here because otherwise the connection could be deleted inside (refcount goes -> 0) + pCon->construct(url,info); // late constructor call which can throw exception and allows a correct dtor call when so m_xConnections.push_back(WeakReferenceHelper(*pCon)); - + return xCon; } // -------------------------------------------------------------------------------- -sal_Bool SAL_CALL SkeletonDriver::acceptsURL( const ::rtl::OUString& url ) +sal_Bool SAL_CALL SkeletonDriver::acceptsURL( const ::rtl::OUString& url ) throw(SQLException, RuntimeException) { // here we have to look if we support this url format @@ -202,7 +202,7 @@ void checkDisposed(sal_Bool _bThrow) throw ( DisposedException ) { if (_bThrow) throw DisposedException(); - + } //......................................................................... } diff --git a/odk/examples/DevelopersGuide/Database/DriverSkeleton/SDriver.hxx b/odk/examples/DevelopersGuide/Database/DriverSkeleton/SDriver.hxx index 36d50a486b6d..2c1cb2cc50ee 100644 --- a/odk/examples/DevelopersGuide/Database/DriverSkeleton/SDriver.hxx +++ b/odk/examples/DevelopersGuide/Database/DriverSkeleton/SDriver.hxx @@ -3,7 +3,7 @@ * * The Contents of this file are made available subject to the terms of * the BSD license. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * All rights reserved. * @@ -30,7 +30,7 @@ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * + * *************************************************************************/ #ifndef CONNECTIVITY_SDRIVER_HXX @@ -47,14 +47,14 @@ namespace connectivity { ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL SkeletonDriver_CreateInstance(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rxFactory) throw( ::com::sun::star::uno::Exception ); - typedef ::cppu::WeakComponentImplHelper2< ::com::sun::star::sdbc::XDriver, + typedef ::cppu::WeakComponentImplHelper2< ::com::sun::star::sdbc::XDriver, ::com::sun::star::lang::XServiceInfo > ODriver_BASE; class SkeletonDriver : public ODriver_BASE { protected: - ::osl::Mutex m_aMutex; // mutex is need to control member access - OWeakRefArray m_xConnections; // vector containing a list + ::osl::Mutex m_aMutex; // mutex is need to control member access + OWeakRefArray m_xConnections; // vector containing a list // of all the Connection objects // for this Driver public: diff --git a/odk/examples/DevelopersGuide/Database/DriverSkeleton/SPreparedStatement.cxx b/odk/examples/DevelopersGuide/Database/DriverSkeleton/SPreparedStatement.cxx index 17217402462f..f896abb13e98 100644 --- a/odk/examples/DevelopersGuide/Database/DriverSkeleton/SPreparedStatement.cxx +++ b/odk/examples/DevelopersGuide/Database/DriverSkeleton/SPreparedStatement.cxx @@ -3,7 +3,7 @@ * * The Contents of this file are made available subject to the terms of * the BSD license. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * All rights reserved. * @@ -30,7 +30,7 @@ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * + * *************************************************************************/ #include <stdio.h> @@ -95,7 +95,7 @@ Reference< XResultSetMetaData > SAL_CALL OPreparedStatement::getMetaData( ) thr { ::osl::MutexGuard aGuard( m_aMutex ); checkDisposed(OStatement_BASE::rBHelper.bDisposed); - + if(!m_xMetaData.is()) m_xMetaData = new OResultSetMetaData(getOwnConnection()); return m_xMetaData; @@ -106,7 +106,7 @@ void SAL_CALL OPreparedStatement::close( ) throw(SQLException, RuntimeException { ::osl::MutexGuard aGuard( m_aMutex ); checkDisposed(OStatement_BASE::rBHelper.bDisposed); - + // Reset last warning message @@ -127,7 +127,7 @@ sal_Bool SAL_CALL OPreparedStatement::execute( ) throw(SQLException, RuntimeExc { ::osl::MutexGuard aGuard( m_aMutex ); checkDisposed(OStatement_BASE::rBHelper.bDisposed); - + // same as in statement with the difference that this statement also can contain parameter return sal_False; @@ -138,7 +138,7 @@ sal_Int32 SAL_CALL OPreparedStatement::executeUpdate( ) throw(SQLException, Run { ::osl::MutexGuard aGuard( m_aMutex ); checkDisposed(OStatement_BASE::rBHelper.bDisposed); - + // same as in statement with the difference that this statement also can contain parameter return 0; } @@ -155,7 +155,7 @@ Reference< XConnection > SAL_CALL OPreparedStatement::getConnection( ) throw(SQ { ::osl::MutexGuard aGuard( m_aMutex ); checkDisposed(OStatement_BASE::rBHelper.bDisposed); - + return (Reference< XConnection >)m_pConnection; } // ------------------------------------------------------------------------- @@ -164,10 +164,10 @@ Reference< XResultSet > SAL_CALL OPreparedStatement::executeQuery( ) throw(SQLE { ::osl::MutexGuard aGuard( m_aMutex ); checkDisposed(OStatement_BASE::rBHelper.bDisposed); - + Reference< XResultSet > rs = NULL; - + return rs; } // ------------------------------------------------------------------------- @@ -176,14 +176,14 @@ void SAL_CALL OPreparedStatement::setBoolean( sal_Int32 parameterIndex, sal_Bool { ::osl::MutexGuard aGuard( m_aMutex ); checkDisposed(OStatement_BASE::rBHelper.bDisposed); - + } // ------------------------------------------------------------------------- void SAL_CALL OPreparedStatement::setByte( sal_Int32 parameterIndex, sal_Int8 x ) throw(SQLException, RuntimeException) { ::osl::MutexGuard aGuard( m_aMutex ); checkDisposed(OStatement_BASE::rBHelper.bDisposed); - + } // ------------------------------------------------------------------------- @@ -192,7 +192,7 @@ void SAL_CALL OPreparedStatement::setDate( sal_Int32 parameterIndex, const Date& { ::osl::MutexGuard aGuard( m_aMutex ); checkDisposed(OStatement_BASE::rBHelper.bDisposed); - + } // ------------------------------------------------------------------------- @@ -201,7 +201,7 @@ void SAL_CALL OPreparedStatement::setTime( sal_Int32 parameterIndex, const Time& { ::osl::MutexGuard aGuard( m_aMutex ); checkDisposed(OStatement_BASE::rBHelper.bDisposed); - + } // ------------------------------------------------------------------------- @@ -209,7 +209,7 @@ void SAL_CALL OPreparedStatement::setTimestamp( sal_Int32 parameterIndex, const { ::osl::MutexGuard aGuard( m_aMutex ); checkDisposed(OStatement_BASE::rBHelper.bDisposed); - + } // ------------------------------------------------------------------------- @@ -217,7 +217,7 @@ void SAL_CALL OPreparedStatement::setDouble( sal_Int32 parameterIndex, double x { ::osl::MutexGuard aGuard( m_aMutex ); checkDisposed(OStatement_BASE::rBHelper.bDisposed); - + } // ------------------------------------------------------------------------- @@ -226,7 +226,7 @@ void SAL_CALL OPreparedStatement::setFloat( sal_Int32 parameterIndex, float x ) { ::osl::MutexGuard aGuard( m_aMutex ); checkDisposed(OStatement_BASE::rBHelper.bDisposed); - + } // ------------------------------------------------------------------------- @@ -234,7 +234,7 @@ void SAL_CALL OPreparedStatement::setInt( sal_Int32 parameterIndex, sal_Int32 x { ::osl::MutexGuard aGuard( m_aMutex ); checkDisposed(OStatement_BASE::rBHelper.bDisposed); - + } // ------------------------------------------------------------------------- @@ -242,7 +242,7 @@ void SAL_CALL OPreparedStatement::setLong( sal_Int32 parameterIndex, sal_Int64 a { ::osl::MutexGuard aGuard( m_aMutex ); checkDisposed(OStatement_BASE::rBHelper.bDisposed); - + } // ------------------------------------------------------------------------- @@ -250,7 +250,7 @@ void SAL_CALL OPreparedStatement::setNull( sal_Int32 parameterIndex, sal_Int32 s { ::osl::MutexGuard aGuard( m_aMutex ); checkDisposed(OStatement_BASE::rBHelper.bDisposed); - + } // ------------------------------------------------------------------------- @@ -258,7 +258,7 @@ void SAL_CALL OPreparedStatement::setClob( sal_Int32 parameterIndex, const Refer { ::osl::MutexGuard aGuard( m_aMutex ); checkDisposed(OStatement_BASE::rBHelper.bDisposed); - + } // ------------------------------------------------------------------------- @@ -266,7 +266,7 @@ void SAL_CALL OPreparedStatement::setBlob( sal_Int32 parameterIndex, const Refer { ::osl::MutexGuard aGuard( m_aMutex ); checkDisposed(OStatement_BASE::rBHelper.bDisposed); - + } // ------------------------------------------------------------------------- @@ -274,7 +274,7 @@ void SAL_CALL OPreparedStatement::setArray( sal_Int32 parameterIndex, const Refe { ::osl::MutexGuard aGuard( m_aMutex ); checkDisposed(OStatement_BASE::rBHelper.bDisposed); - + } // ------------------------------------------------------------------------- @@ -282,14 +282,14 @@ void SAL_CALL OPreparedStatement::setRef( sal_Int32 parameterIndex, const Refere { ::osl::MutexGuard aGuard( m_aMutex ); checkDisposed(OStatement_BASE::rBHelper.bDisposed); - + } // ------------------------------------------------------------------------- void SAL_CALL OPreparedStatement::setObjectWithInfo( sal_Int32 parameterIndex, const Any& x, sal_Int32 sqlType, sal_Int32 scale ) throw(SQLException, RuntimeException) { checkDisposed(OStatement_BASE::rBHelper.bDisposed); - ::osl::MutexGuard aGuard( m_aMutex ); + ::osl::MutexGuard aGuard( m_aMutex ); } // ------------------------------------------------------------------------- @@ -298,7 +298,7 @@ void SAL_CALL OPreparedStatement::setObjectNull( sal_Int32 parameterIndex, sal_I { ::osl::MutexGuard aGuard( m_aMutex ); checkDisposed(OStatement_BASE::rBHelper.bDisposed); - + } // ------------------------------------------------------------------------- @@ -306,7 +306,7 @@ void SAL_CALL OPreparedStatement::setObject( sal_Int32 parameterIndex, const Any { ::osl::MutexGuard aGuard( m_aMutex ); checkDisposed(OStatement_BASE::rBHelper.bDisposed); - + } // ------------------------------------------------------------------------- @@ -314,7 +314,7 @@ void SAL_CALL OPreparedStatement::setShort( sal_Int32 parameterIndex, sal_Int16 { ::osl::MutexGuard aGuard( m_aMutex ); checkDisposed(OStatement_BASE::rBHelper.bDisposed); - + } // ------------------------------------------------------------------------- @@ -322,7 +322,7 @@ void SAL_CALL OPreparedStatement::setBytes( sal_Int32 parameterIndex, const Sequ { ::osl::MutexGuard aGuard( m_aMutex ); checkDisposed(OStatement_BASE::rBHelper.bDisposed); - + } // ------------------------------------------------------------------------- @@ -331,7 +331,7 @@ void SAL_CALL OPreparedStatement::setCharacterStream( sal_Int32 parameterIndex, { ::osl::MutexGuard aGuard( m_aMutex ); checkDisposed(OStatement_BASE::rBHelper.bDisposed); - + } // ------------------------------------------------------------------------- @@ -339,7 +339,7 @@ void SAL_CALL OPreparedStatement::setBinaryStream( sal_Int32 parameterIndex, con { ::osl::MutexGuard aGuard( m_aMutex ); checkDisposed(OStatement_BASE::rBHelper.bDisposed); - + } // ------------------------------------------------------------------------- @@ -381,7 +381,7 @@ void OPreparedStatement::setFastPropertyValue_NoBroadcast(sal_Int32 nHandle,cons // ----------------------------------------------------------------------------- void OPreparedStatement::checkParameterIndex(sal_Int32 _parameterIndex) { - if( !_parameterIndex || _parameterIndex > m_nNumParams) + if( !_parameterIndex || _parameterIndex > m_nNumParams) throw SQLException(); } // ----------------------------------------------------------------------------- diff --git a/odk/examples/DevelopersGuide/Database/DriverSkeleton/SPreparedStatement.hxx b/odk/examples/DevelopersGuide/Database/DriverSkeleton/SPreparedStatement.hxx index b01823f76a64..709d676db9bb 100644 --- a/odk/examples/DevelopersGuide/Database/DriverSkeleton/SPreparedStatement.hxx +++ b/odk/examples/DevelopersGuide/Database/DriverSkeleton/SPreparedStatement.hxx @@ -3,7 +3,7 @@ * * The Contents of this file are made available subject to the terms of * the BSD license. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * All rights reserved. * @@ -30,7 +30,7 @@ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * + * *************************************************************************/ #ifndef CONNECTIVITY_SPREPAREDSTATEMENT_HXX @@ -48,42 +48,42 @@ namespace connectivity { class OBoundParam; - typedef ::cppu::ImplHelper5< ::com::sun::star::sdbc::XPreparedStatement, + typedef ::cppu::ImplHelper5< ::com::sun::star::sdbc::XPreparedStatement, ::com::sun::star::sdbc::XParameters, ::com::sun::star::sdbc::XPreparedBatchExecution, ::com::sun::star::sdbc::XResultSetMetaDataSupplier, ::com::sun::star::lang::XServiceInfo> OPreparedStatement_BASE; - class OPreparedStatement : public OStatement_BASE2, + class OPreparedStatement : public OStatement_BASE2, public OPreparedStatement_BASE { protected: struct Parameter { - ::com::sun::star::uno::Any aValue; - sal_Int32 nDataType; + ::com::sun::star::uno::Any aValue; + sal_Int32 nDataType; - Parameter(const ::com::sun::star::uno::Any& rValue, - sal_Int32 rDataType) : aValue(rValue),nDataType(rDataType) + Parameter(const ::com::sun::star::uno::Any& rValue, + sal_Int32 rDataType) : aValue(rValue),nDataType(rDataType) { } }; - ::std::vector< Parameter> m_aParameters; + ::std::vector< Parameter> m_aParameters; //==================================================================== // Data attributes //==================================================================== - TTypeInfoVector m_aTypeInfo; // Hashtable containing an entry + TTypeInfoVector m_aTypeInfo; // Hashtable containing an entry // for each row returned by // DatabaseMetaData.getTypeInfo. - sal_Int32 m_nNumParams; // Number of parameter markers + sal_Int32 m_nNumParams; // Number of parameter markers // for the prepared statement - ::rtl::OUString m_sSqlStatement; - ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSetMetaData > m_xMetaData; - sal_Bool m_bPrepared; + ::rtl::OUString m_sSqlStatement; + ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSetMetaData > m_xMetaData; + sal_Bool m_bPrepared; void checkParameterIndex(sal_Int32 _parameterIndex); diff --git a/odk/examples/DevelopersGuide/Database/DriverSkeleton/SResultSet.cxx b/odk/examples/DevelopersGuide/Database/DriverSkeleton/SResultSet.cxx index 985ddb032fc5..72c23a44667b 100644 --- a/odk/examples/DevelopersGuide/Database/DriverSkeleton/SResultSet.cxx +++ b/odk/examples/DevelopersGuide/Database/DriverSkeleton/SResultSet.cxx @@ -3,7 +3,7 @@ * * The Contents of this file are made available subject to the terms of * the BSD license. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * All rights reserved. * @@ -30,7 +30,7 @@ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * + * *************************************************************************/ #include "SResultSet.hxx" @@ -54,8 +54,8 @@ using namespace com::sun::star::io; using namespace com::sun::star::util; //------------------------------------------------------------------------------ -// IMPLEMENT_SERVICE_INFO(OResultSet,"com.sun.star.sdbcx.OResultSet","com.sun.star.sdbc.ResultSet"); -::rtl::OUString SAL_CALL OResultSet::getImplementationName( ) throw ( RuntimeException) \ +// IMPLEMENT_SERVICE_INFO(OResultSet,"com.sun.star.sdbcx.OResultSet","com.sun.star.sdbc.ResultSet"); +::rtl::OUString SAL_CALL OResultSet::getImplementationName( ) throw ( RuntimeException) \ { return ::rtl::OUString::createFromAscii("com.sun.star.sdbcx.skeleton.ResultSet"); } @@ -80,7 +80,7 @@ sal_Bool SAL_CALL OResultSet::supportsService( const ::rtl::OUString& _rServiceN } // ------------------------------------------------------------------------- -OResultSet::OResultSet(OStatement_Base* pStmt) +OResultSet::OResultSet(OStatement_Base* pStmt) : OResultSet_BASE(m_aMutex) ,OPropertySetHelper(OResultSet_BASE::rBHelper) ,m_aStatement((OWeakObject*)pStmt) @@ -101,8 +101,8 @@ void OResultSet::disposing(void) ::osl::MutexGuard aGuard(m_aMutex); - m_aStatement = NULL; - m_xMetaData = NULL; + m_aStatement = NULL; + m_xMetaData = NULL; } // ------------------------------------------------------------------------- Any SAL_CALL OResultSet::queryInterface( const Type & rType ) throw(RuntimeException) @@ -126,10 +126,10 @@ Any SAL_CALL OResultSet::queryInterface( const Type & rType ) throw(RuntimeExcep sal_Int32 SAL_CALL OResultSet::findColumn( const ::rtl::OUString& columnName ) throw(SQLException, RuntimeException) { - + checkDisposed(OResultSet_BASE::rBHelper.bDisposed); - // find the first column with the name columnName + // find the first column with the name columnName ::osl::MutexGuard aGuard( m_aMutex ); @@ -137,7 +137,7 @@ sal_Int32 SAL_CALL OResultSet::findColumn( const ::rtl::OUString& columnName ) t sal_Int32 nLen = xMeta->getColumnCount(); sal_Int32 i = 1; for(;i<=nLen;++i) - if(xMeta->isCaseSensitive(i) ? columnName == xMeta->getColumnName(i) : + if(xMeta->isCaseSensitive(i) ? columnName == xMeta->getColumnName(i) : columnName.equalsIgnoreAsciiCase(xMeta->getColumnName(i))) break; return i; @@ -147,7 +147,7 @@ Reference< XInputStream > SAL_CALL OResultSet::getBinaryStream( sal_Int32 column { ::osl::MutexGuard aGuard( m_aMutex ); checkDisposed(OResultSet_BASE::rBHelper.bDisposed); - + return NULL; } @@ -156,7 +156,7 @@ Reference< XInputStream > SAL_CALL OResultSet::getCharacterStream( sal_Int32 col { ::osl::MutexGuard aGuard( m_aMutex ); checkDisposed(OResultSet_BASE::rBHelper.bDisposed); - + return NULL; } @@ -166,7 +166,7 @@ sal_Bool SAL_CALL OResultSet::getBoolean( sal_Int32 columnIndex ) throw(SQLExcep { ::osl::MutexGuard aGuard( m_aMutex ); checkDisposed(OResultSet_BASE::rBHelper.bDisposed); - + return sal_False; } // ------------------------------------------------------------------------- @@ -175,7 +175,7 @@ sal_Int8 SAL_CALL OResultSet::getByte( sal_Int32 columnIndex ) throw(SQLExceptio { ::osl::MutexGuard aGuard( m_aMutex ); checkDisposed(OResultSet_BASE::rBHelper.bDisposed); - + sal_Int8 nRet = 0; return nRet; @@ -184,10 +184,10 @@ sal_Int8 SAL_CALL OResultSet::getByte( sal_Int32 columnIndex ) throw(SQLExceptio Sequence< sal_Int8 > SAL_CALL OResultSet::getBytes( sal_Int32 columnIndex ) throw(SQLException, RuntimeException) { - + checkDisposed(OResultSet_BASE::rBHelper.bDisposed); ::osl::MutexGuard aGuard( m_aMutex ); - + return Sequence< sal_Int8 >(); } // ------------------------------------------------------------------------- @@ -196,7 +196,7 @@ Date SAL_CALL OResultSet::getDate( sal_Int32 columnIndex ) throw(SQLException, R { ::osl::MutexGuard aGuard( m_aMutex ); checkDisposed(OResultSet_BASE::rBHelper.bDisposed); - + Date nRet; return nRet; @@ -207,7 +207,7 @@ double SAL_CALL OResultSet::getDouble( sal_Int32 columnIndex ) throw(SQLExceptio { ::osl::MutexGuard aGuard( m_aMutex ); checkDisposed(OResultSet_BASE::rBHelper.bDisposed); - + double nRet = 0; return nRet; @@ -218,7 +218,7 @@ float SAL_CALL OResultSet::getFloat( sal_Int32 columnIndex ) throw(SQLException, { ::osl::MutexGuard aGuard( m_aMutex ); checkDisposed(OResultSet_BASE::rBHelper.bDisposed); - + float nVal(0); return nVal; @@ -229,7 +229,7 @@ sal_Int32 SAL_CALL OResultSet::getInt( sal_Int32 columnIndex ) throw(SQLExceptio { ::osl::MutexGuard aGuard( m_aMutex ); checkDisposed(OResultSet_BASE::rBHelper.bDisposed); - + sal_Int32 nRet=0; return nRet; } @@ -239,7 +239,7 @@ sal_Int32 SAL_CALL OResultSet::getRow( ) throw(SQLException, RuntimeException) { ::osl::MutexGuard aGuard( m_aMutex ); checkDisposed(OResultSet_BASE::rBHelper.bDisposed); - + sal_Int32 nValue = 0; return nValue; } @@ -249,7 +249,7 @@ sal_Int64 SAL_CALL OResultSet::getLong( sal_Int32 columnIndex ) throw(SQLExcepti { ::osl::MutexGuard aGuard( m_aMutex ); checkDisposed(OResultSet_BASE::rBHelper.bDisposed); - + return sal_Int64(); } // ------------------------------------------------------------------------- @@ -258,7 +258,7 @@ Reference< XResultSetMetaData > SAL_CALL OResultSet::getMetaData( ) throw(SQLEx { ::osl::MutexGuard aGuard( m_aMutex ); checkDisposed(OResultSet_BASE::rBHelper.bDisposed); - + if(!m_xMetaData.is()) m_xMetaData = new OResultSetMetaData(m_pStatement->getOwnConnection()); @@ -269,7 +269,7 @@ Reference< XArray > SAL_CALL OResultSet::getArray( sal_Int32 columnIndex ) throw { ::osl::MutexGuard aGuard( m_aMutex ); checkDisposed(OResultSet_BASE::rBHelper.bDisposed); - + return NULL; } @@ -279,7 +279,7 @@ Reference< XClob > SAL_CALL OResultSet::getClob( sal_Int32 columnIndex ) throw(S { ::osl::MutexGuard aGuard( m_aMutex ); checkDisposed(OResultSet_BASE::rBHelper.bDisposed); - + return NULL; } // ------------------------------------------------------------------------- @@ -287,7 +287,7 @@ Reference< XBlob > SAL_CALL OResultSet::getBlob( sal_Int32 columnIndex ) throw(S { ::osl::MutexGuard aGuard( m_aMutex ); checkDisposed(OResultSet_BASE::rBHelper.bDisposed); - + return NULL; } // ------------------------------------------------------------------------- @@ -296,7 +296,7 @@ Reference< XRef > SAL_CALL OResultSet::getRef( sal_Int32 columnIndex ) throw(SQL { ::osl::MutexGuard aGuard( m_aMutex ); checkDisposed(OResultSet_BASE::rBHelper.bDisposed); - + return NULL; } // ------------------------------------------------------------------------- @@ -305,7 +305,7 @@ Any SAL_CALL OResultSet::getObject( sal_Int32 columnIndex, const Reference< ::co { ::osl::MutexGuard aGuard( m_aMutex ); checkDisposed(OResultSet_BASE::rBHelper.bDisposed); - + return Any(); } // ------------------------------------------------------------------------- @@ -314,7 +314,7 @@ sal_Int16 SAL_CALL OResultSet::getShort( sal_Int32 columnIndex ) throw(SQLExcept { ::osl::MutexGuard aGuard( m_aMutex ); checkDisposed(OResultSet_BASE::rBHelper.bDisposed); - + sal_Int16 nRet=0; return nRet; @@ -326,8 +326,8 @@ sal_Int16 SAL_CALL OResultSet::getShort( sal_Int32 columnIndex ) throw(SQLExcept { ::osl::MutexGuard aGuard( m_aMutex ); checkDisposed(OResultSet_BASE::rBHelper.bDisposed); - - + + ::rtl::OUString nRet; return nRet; } @@ -348,7 +348,7 @@ Time SAL_CALL OResultSet::getTime( sal_Int32 columnIndex ) throw(SQLException, R DateTime SAL_CALL OResultSet::getTimestamp( sal_Int32 columnIndex ) throw(SQLException, RuntimeException) { checkDisposed(OResultSet_BASE::rBHelper.bDisposed); - + ::osl::MutexGuard aGuard( m_aMutex ); @@ -361,7 +361,7 @@ sal_Bool SAL_CALL OResultSet::isBeforeFirst( ) throw(SQLException, RuntimeExcep { ::osl::MutexGuard aGuard( m_aMutex ); checkDisposed(OResultSet_BASE::rBHelper.bDisposed); - + // here you have to implement your movements // return true means there is no data @@ -372,7 +372,7 @@ sal_Bool SAL_CALL OResultSet::isAfterLast( ) throw(SQLException, RuntimeExcepti { ::osl::MutexGuard aGuard( m_aMutex ); checkDisposed(OResultSet_BASE::rBHelper.bDisposed); - + return sal_True; } // ------------------------------------------------------------------------- @@ -380,7 +380,7 @@ sal_Bool SAL_CALL OResultSet::isFirst( ) throw(SQLException, RuntimeException) { ::osl::MutexGuard aGuard( m_aMutex ); checkDisposed(OResultSet_BASE::rBHelper.bDisposed); - + return sal_False; } @@ -389,7 +389,7 @@ sal_Bool SAL_CALL OResultSet::isLast( ) throw(SQLException, RuntimeException) { ::osl::MutexGuard aGuard( m_aMutex ); checkDisposed(OResultSet_BASE::rBHelper.bDisposed); - + return sal_False; } @@ -398,7 +398,7 @@ void SAL_CALL OResultSet::beforeFirst( ) throw(SQLException, RuntimeException) { ::osl::MutexGuard aGuard( m_aMutex ); checkDisposed(OResultSet_BASE::rBHelper.bDisposed); - + // move before the first row so that isBeforeFirst returns false // the smae for other movement methods } @@ -415,7 +415,7 @@ void SAL_CALL OResultSet::close( ) throw(SQLException, RuntimeException) { ::osl::MutexGuard aGuard( m_aMutex ); checkDisposed(OResultSet_BASE::rBHelper.bDisposed); - + } dispose(); } @@ -425,7 +425,7 @@ sal_Bool SAL_CALL OResultSet::first( ) throw(SQLException, RuntimeException) { ::osl::MutexGuard aGuard( m_aMutex ); checkDisposed(OResultSet_BASE::rBHelper.bDisposed); - + return sal_False; } // ------------------------------------------------------------------------- @@ -442,7 +442,7 @@ sal_Bool SAL_CALL OResultSet::absolute( sal_Int32 row ) throw(SQLException, Runt { ::osl::MutexGuard aGuard( m_aMutex ); checkDisposed(OResultSet_BASE::rBHelper.bDisposed); - + return sal_False; } // ------------------------------------------------------------------------- @@ -466,7 +466,7 @@ Reference< XInterface > SAL_CALL OResultSet::getStatement( ) throw(SQLException { ::osl::MutexGuard aGuard( m_aMutex ); checkDisposed(OResultSet_BASE::rBHelper.bDisposed); - + return m_aStatement.get(); } @@ -476,16 +476,16 @@ sal_Bool SAL_CALL OResultSet::rowDeleted( ) throw(SQLException, RuntimeExceptio { ::osl::MutexGuard aGuard( m_aMutex ); checkDisposed(OResultSet_BASE::rBHelper.bDisposed); - + return sal_False; } // ------------------------------------------------------------------------- sal_Bool SAL_CALL OResultSet::rowInserted( ) throw(SQLException, RuntimeException) -{ +{ ::osl::MutexGuard aGuard( m_aMutex ); checkDisposed(OResultSet_BASE::rBHelper.bDisposed); - + return sal_False; } @@ -494,7 +494,7 @@ sal_Bool SAL_CALL OResultSet::rowUpdated( ) throw(SQLException, RuntimeExceptio { ::osl::MutexGuard aGuard( m_aMutex ); checkDisposed(OResultSet_BASE::rBHelper.bDisposed); - + return sal_False; } @@ -504,7 +504,7 @@ sal_Bool SAL_CALL OResultSet::next( ) throw(SQLException, RuntimeException) { ::osl::MutexGuard aGuard( m_aMutex ); checkDisposed(OResultSet_BASE::rBHelper.bDisposed); - + return sal_False; } @@ -514,7 +514,7 @@ sal_Bool SAL_CALL OResultSet::wasNull( ) throw(SQLException, RuntimeException) { ::osl::MutexGuard aGuard( m_aMutex ); checkDisposed(OResultSet_BASE::rBHelper.bDisposed); - + return m_bWasNull; } @@ -524,7 +524,7 @@ void SAL_CALL OResultSet::cancel( ) throw(RuntimeException) { ::osl::MutexGuard aGuard( m_aMutex ); checkDisposed(OResultSet_BASE::rBHelper.bDisposed); - + } // ------------------------------------------------------------------------- void SAL_CALL OResultSet::clearWarnings( ) throw(SQLException, RuntimeException) @@ -548,7 +548,7 @@ void SAL_CALL OResultSet::updateRow( ) throw(SQLException, RuntimeException) { ::osl::MutexGuard aGuard( m_aMutex ); checkDisposed(OResultSet_BASE::rBHelper.bDisposed); - + // only when you allow updates } @@ -571,7 +571,7 @@ void SAL_CALL OResultSet::moveToInsertRow( ) throw(SQLException, RuntimeExcepti { ::osl::MutexGuard aGuard( m_aMutex ); checkDisposed(OResultSet_BASE::rBHelper.bDisposed); - + // only when you allow insert's } @@ -595,7 +595,7 @@ void SAL_CALL OResultSet::updateBoolean( sal_Int32 columnIndex, sal_Bool x ) thr { ::osl::MutexGuard aGuard( m_aMutex ); checkDisposed(OResultSet_BASE::rBHelper.bDisposed); - + } // ------------------------------------------------------------------------- void SAL_CALL OResultSet::updateByte( sal_Int32 columnIndex, sal_Int8 x ) throw(SQLException, RuntimeException) @@ -610,7 +610,7 @@ void SAL_CALL OResultSet::updateShort( sal_Int32 columnIndex, sal_Int16 x ) thro { ::osl::MutexGuard aGuard( m_aMutex ); checkDisposed(OResultSet_BASE::rBHelper.bDisposed); - + } // ------------------------------------------------------------------------- void SAL_CALL OResultSet::updateInt( sal_Int32 columnIndex, sal_Int32 x ) throw(SQLException, RuntimeException) @@ -624,14 +624,14 @@ void SAL_CALL OResultSet::updateLong( sal_Int32 columnIndex, sal_Int64 x ) throw { ::osl::MutexGuard aGuard( m_aMutex ); checkDisposed(OResultSet_BASE::rBHelper.bDisposed); - + } // ----------------------------------------------------------------------- void SAL_CALL OResultSet::updateFloat( sal_Int32 columnIndex, float x ) throw(SQLException, RuntimeException) { ::osl::MutexGuard aGuard( m_aMutex ); checkDisposed(OResultSet_BASE::rBHelper.bDisposed); - + } // ------------------------------------------------------------------------- @@ -639,28 +639,28 @@ void SAL_CALL OResultSet::updateDouble( sal_Int32 columnIndex, double x ) throw( { ::osl::MutexGuard aGuard( m_aMutex ); checkDisposed(OResultSet_BASE::rBHelper.bDisposed); - + } // ------------------------------------------------------------------------- void SAL_CALL OResultSet::updateString( sal_Int32 columnIndex, const ::rtl::OUString& x ) throw(SQLException, RuntimeException) { ::osl::MutexGuard aGuard( m_aMutex ); checkDisposed(OResultSet_BASE::rBHelper.bDisposed); - + } // ------------------------------------------------------------------------- void SAL_CALL OResultSet::updateBytes( sal_Int32 columnIndex, const Sequence< sal_Int8 >& x ) throw(SQLException, RuntimeException) { ::osl::MutexGuard aGuard( m_aMutex ); checkDisposed(OResultSet_BASE::rBHelper.bDisposed); - + } // ------------------------------------------------------------------------- void SAL_CALL OResultSet::updateDate( sal_Int32 columnIndex, const Date& x ) throw(SQLException, RuntimeException) { ::osl::MutexGuard aGuard( m_aMutex ); checkDisposed(OResultSet_BASE::rBHelper.bDisposed); - + } // ------------------------------------------------------------------------- @@ -668,7 +668,7 @@ void SAL_CALL OResultSet::updateTime( sal_Int32 columnIndex, const Time& x ) thr { ::osl::MutexGuard aGuard( m_aMutex ); checkDisposed(OResultSet_BASE::rBHelper.bDisposed); - + } // ------------------------------------------------------------------------- @@ -676,7 +676,7 @@ void SAL_CALL OResultSet::updateTimestamp( sal_Int32 columnIndex, const DateTime { ::osl::MutexGuard aGuard( m_aMutex ); checkDisposed(OResultSet_BASE::rBHelper.bDisposed); - + } // ------------------------------------------------------------------------- @@ -684,28 +684,28 @@ void SAL_CALL OResultSet::updateBinaryStream( sal_Int32 columnIndex, const Refer { ::osl::MutexGuard aGuard( m_aMutex ); checkDisposed(OResultSet_BASE::rBHelper.bDisposed); - + } // ------------------------------------------------------------------------- void SAL_CALL OResultSet::updateCharacterStream( sal_Int32 columnIndex, const Reference< XInputStream >& x, sal_Int32 length ) throw(SQLException, RuntimeException) { ::osl::MutexGuard aGuard( m_aMutex ); checkDisposed(OResultSet_BASE::rBHelper.bDisposed); - + } // ------------------------------------------------------------------------- void SAL_CALL OResultSet::refreshRow( ) throw(SQLException, RuntimeException) { ::osl::MutexGuard aGuard( m_aMutex ); checkDisposed(OResultSet_BASE::rBHelper.bDisposed); - + } // ------------------------------------------------------------------------- void SAL_CALL OResultSet::updateObject( sal_Int32 columnIndex, const Any& x ) throw(SQLException, RuntimeException) { ::osl::MutexGuard aGuard( m_aMutex ); checkDisposed(OResultSet_BASE::rBHelper.bDisposed); - + } // ------------------------------------------------------------------------- @@ -713,7 +713,7 @@ void SAL_CALL OResultSet::updateNumericObject( sal_Int32 columnIndex, const Any& { ::osl::MutexGuard aGuard( m_aMutex ); checkDisposed(OResultSet_BASE::rBHelper.bDisposed); - + } // ------------------------------------------------------------------------- // XRowLocate @@ -747,7 +747,7 @@ sal_Int32 SAL_CALL OResultSet::compareBookmarks( const Any& first, const Any& { ::osl::MutexGuard aGuard( m_aMutex ); checkDisposed(OResultSet_BASE::rBHelper.bDisposed); - + return CompareBookmark::NOT_EQUAL; } @@ -767,7 +767,7 @@ Sequence< sal_Int32 > SAL_CALL OResultSet::deleteRows( const Sequence< Any >& { ::osl::MutexGuard aGuard( m_aMutex ); checkDisposed(OResultSet_BASE::rBHelper.bDisposed); - + return Sequence< sal_Int32 >(); } // ------------------------------------------------------------------------- @@ -776,12 +776,12 @@ IPropertyArrayHelper* OResultSet::createArrayHelper( ) const Sequence< Property > aProps(6); Property* pProperties = aProps.getArray(); sal_Int32 nPos = 0; - DECL_PROP1IMPL(CURSORNAME, ::rtl::OUString) PropertyAttribute::READONLY); - DECL_PROP0(FETCHDIRECTION, sal_Int32); - DECL_PROP0(FETCHSIZE, sal_Int32); + DECL_PROP1IMPL(CURSORNAME, ::rtl::OUString) PropertyAttribute::READONLY); + DECL_PROP0(FETCHDIRECTION, sal_Int32); + DECL_PROP0(FETCHSIZE, sal_Int32); DECL_BOOL_PROP1IMPL(ISBOOKMARKABLE) PropertyAttribute::READONLY); DECL_PROP1IMPL(RESULTSETCONCURRENCY,sal_Int32) PropertyAttribute::READONLY); - DECL_PROP1IMPL(RESULTSETTYPE, sal_Int32) PropertyAttribute::READONLY); + DECL_PROP1IMPL(RESULTSETTYPE, sal_Int32) PropertyAttribute::READONLY); return new OPropertyArrayHelper(aProps); } diff --git a/odk/examples/DevelopersGuide/Database/DriverSkeleton/SResultSet.hxx b/odk/examples/DevelopersGuide/Database/DriverSkeleton/SResultSet.hxx index 9a102418bd99..b626a56a60df 100644 --- a/odk/examples/DevelopersGuide/Database/DriverSkeleton/SResultSet.hxx +++ b/odk/examples/DevelopersGuide/Database/DriverSkeleton/SResultSet.hxx @@ -3,7 +3,7 @@ * * The Contents of this file are made available subject to the terms of * the BSD license. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * All rights reserved. * @@ -30,7 +30,7 @@ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * + * *************************************************************************/ #ifndef CONNECTIVITY_SRESULTSET_HXX @@ -57,7 +57,7 @@ namespace connectivity { /* - ** OResultSet + ** OResultSet */ typedef ::cppu::WeakComponentImplHelper12< ::com::sun::star::sdbc::XResultSet, ::com::sun::star::sdbc::XRow, @@ -72,17 +72,17 @@ namespace connectivity ::com::sun::star::sdbc::XColumnLocate, ::com::sun::star::lang::XServiceInfo> OResultSet_BASE; - class OResultSet : public OBase_Mutex, - public OResultSet_BASE, - public ::cppu::OPropertySetHelper, - public OPropertyArrayUsageHelper<OResultSet> + class OResultSet : public OBase_Mutex, + public OResultSet_BASE, + public ::cppu::OPropertySetHelper, + public OPropertyArrayUsageHelper<OResultSet> { protected: - OStatement_Base* m_pStatement; - ::com::sun::star::uno::WeakReferenceHelper m_aStatement; + OStatement_Base* m_pStatement; + ::com::sun::star::uno::WeakReferenceHelper m_aStatement; ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSetMetaData> m_xMetaData; - rtl_TextEncoding m_nTextEncoding; - sal_Bool m_bWasNull; + rtl_TextEncoding m_nTextEncoding; + sal_Bool m_bWasNull; // OPropertyArrayUsageHelper virtual ::cppu::IPropertyArrayHelper* createArrayHelper( ) const; @@ -109,9 +109,9 @@ namespace connectivity virtual ~OResultSet(); public: DECLARE_SERVICE_INFO(); - + OResultSet( OStatement_Base* pStmt); - + ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > operator *() { diff --git a/odk/examples/DevelopersGuide/Database/DriverSkeleton/SResultSetMetaData.cxx b/odk/examples/DevelopersGuide/Database/DriverSkeleton/SResultSetMetaData.cxx index 86ec005351ae..0f7af1fc60c3 100644 --- a/odk/examples/DevelopersGuide/Database/DriverSkeleton/SResultSetMetaData.cxx +++ b/odk/examples/DevelopersGuide/Database/DriverSkeleton/SResultSetMetaData.cxx @@ -3,7 +3,7 @@ * * The Contents of this file are made available subject to the terms of * the BSD license. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * All rights reserved. * @@ -30,7 +30,7 @@ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * + * *************************************************************************/ #include "SResultSetMetaData.hxx" diff --git a/odk/examples/DevelopersGuide/Database/DriverSkeleton/SResultSetMetaData.hxx b/odk/examples/DevelopersGuide/Database/DriverSkeleton/SResultSetMetaData.hxx index 1560801b4391..92418de6f96d 100644 --- a/odk/examples/DevelopersGuide/Database/DriverSkeleton/SResultSetMetaData.hxx +++ b/odk/examples/DevelopersGuide/Database/DriverSkeleton/SResultSetMetaData.hxx @@ -3,7 +3,7 @@ * * The Contents of this file are made available subject to the terms of * the BSD license. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * All rights reserved. * @@ -30,7 +30,7 @@ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * + * *************************************************************************/ #ifndef CONNECTIVITY_SRESULSETMETADATA_HXX @@ -49,15 +49,15 @@ namespace connectivity //************************************************************** typedef ::cppu::WeakImplHelper1< ::com::sun::star::sdbc::XResultSetMetaData> OResultSetMetaData_BASE; - class OResultSetMetaData : public OResultSetMetaData_BASE + class OResultSetMetaData : public OResultSetMetaData_BASE { - OConnection* m_pConnection; + OConnection* m_pConnection; protected: virtual ~OResultSetMetaData(); public: // ein Konstruktor, der fuer das Returnen des Objektes benoetigt wird: - OResultSetMetaData(OConnection* _pConnection) : m_pConnection(_pConnection){} + OResultSetMetaData(OConnection* _pConnection) : m_pConnection(_pConnection){} /// Avoid ambigous cast error from the compiler. inline operator ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSetMetaData > () throw() diff --git a/odk/examples/DevelopersGuide/Database/DriverSkeleton/SServices.cxx b/odk/examples/DevelopersGuide/Database/DriverSkeleton/SServices.cxx index fdfedd684766..2de009ddb86d 100644 --- a/odk/examples/DevelopersGuide/Database/DriverSkeleton/SServices.cxx +++ b/odk/examples/DevelopersGuide/Database/DriverSkeleton/SServices.cxx @@ -3,7 +3,7 @@ * * The Contents of this file are made available subject to the terms of * the BSD license. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * All rights reserved. * @@ -30,7 +30,7 @@ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * + * *************************************************************************/ #include "SDriver.hxx" @@ -48,7 +48,7 @@ using ::com::sun::star::lang::XMultiServiceFactory; typedef Reference< XSingleServiceFactory > (SAL_CALL *createFactoryFunc) ( const Reference< XMultiServiceFactory > & rServiceManager, - const OUString & rComponentName, + const OUString & rComponentName, ::cppu::ComponentInstantiation pCreateFunction, const Sequence< OUString > & rServiceNames, rtl_ModuleCount* _pTemp @@ -62,8 +62,8 @@ typedef Reference< XSingleServiceFactory > (SAL_CALL *createFactoryFunc) //--------------------------------------------------------------------------------------- void REGISTER_PROVIDER( - const OUString& aServiceImplName, - const Sequence< OUString>& Services, + const OUString& aServiceImplName, + const Sequence< OUString>& Services, const Reference< ::com::sun::star::registry::XRegistryKey > & xKey) { OUString aMainKeyName; @@ -97,31 +97,31 @@ struct ProviderRequest inline sal_Bool CREATE_PROVIDER( - const OUString& Implname, - const Sequence< OUString > & Services, + const OUString& Implname, + const Sequence< OUString > & Services, ::cppu::ComponentInstantiation Factory, createFactoryFunc creator ) { if (!xRet.is() && (Implname == sImplementationName)) - try - { - xRet = creator( xServiceManager, sImplementationName,Factory, Services,0); + try + { + xRet = creator( xServiceManager, sImplementationName,Factory, Services,0); } catch(...) { } return xRet.is(); } - + void* getProvider() const { return xRet.get(); } }; //--------------------------------------------------------------------------------------- extern "C" void SAL_CALL component_getImplementationEnvironment( - const sal_Char **ppEnvTypeName, - uno_Environment **ppEnv + const sal_Char **ppEnvTypeName, + uno_Environment **ppEnv ) { *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME; @@ -133,14 +133,14 @@ extern "C" sal_Bool SAL_CALL component_writeInfo( void* pRegistryKey ) { - if (pRegistryKey) - try + if (pRegistryKey) + try { Reference< ::com::sun::star::registry::XRegistryKey > xKey(reinterpret_cast< ::com::sun::star::registry::XRegistryKey*>(pRegistryKey)); REGISTER_PROVIDER( - SkeletonDriver::getImplementationName_Static(), - SkeletonDriver::getSupportedServiceNames_Static(), xKey); + SkeletonDriver::getImplementationName_Static(), + SkeletonDriver::getSupportedServiceNames_Static(), xKey); return sal_True; } @@ -164,9 +164,9 @@ extern "C" void* SAL_CALL component_getFactory( ProviderRequest aReq(pServiceManager,pImplementationName); aReq.CREATE_PROVIDER( - SkeletonDriver::getImplementationName_Static(), + SkeletonDriver::getImplementationName_Static(), SkeletonDriver::getSupportedServiceNames_Static(), - SkeletonDriver_CreateInstance, ::cppu::createSingleFactory) + SkeletonDriver_CreateInstance, ::cppu::createSingleFactory) ; if(aReq.xRet.is()) diff --git a/odk/examples/DevelopersGuide/Database/DriverSkeleton/SStatement.cxx b/odk/examples/DevelopersGuide/Database/DriverSkeleton/SStatement.cxx index ea1bf91b644e..5e1bee3d5d32 100644 --- a/odk/examples/DevelopersGuide/Database/DriverSkeleton/SStatement.cxx +++ b/odk/examples/DevelopersGuide/Database/DriverSkeleton/SStatement.cxx @@ -3,7 +3,7 @@ * * The Contents of this file are made available subject to the terms of * the BSD license. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * All rights reserved. * @@ -30,7 +30,7 @@ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * + * *************************************************************************/ #include <stdio.h> @@ -57,7 +57,7 @@ using namespace com::sun::star::container; using namespace com::sun::star::io; using namespace com::sun::star::util; //------------------------------------------------------------------------------ -OStatement_Base::OStatement_Base(OConnection* _pConnection ) +OStatement_Base::OStatement_Base(OConnection* _pConnection ) : OStatement_BASE(m_aMutex), OPropertySetHelper(OStatement_BASE::rBHelper), rBHelper(OStatement_BASE::rBHelper), @@ -130,7 +130,7 @@ void SAL_CALL OStatement_Base::close( ) throw(SQLException, RuntimeException) { ::osl::MutexGuard aGuard( m_aMutex ); checkDisposed(OStatement_BASE::rBHelper.bDisposed); - + } dispose(); } @@ -145,7 +145,7 @@ sal_Bool SAL_CALL OStatement_Base::execute( const ::rtl::OUString& sql ) throw(S { ::osl::MutexGuard aGuard( m_aMutex ); checkDisposed(OStatement_BASE::rBHelper.bDisposed); - + // returns true when a resultset is available return sal_False; } @@ -155,7 +155,7 @@ Reference< XResultSet > SAL_CALL OStatement_Base::executeQuery( const ::rtl::OUS { ::osl::MutexGuard aGuard( m_aMutex ); checkDisposed(OStatement_BASE::rBHelper.bDisposed); - + Reference< XResultSet > xRS = NULL; // create a resultset as result of executing the sql statement @@ -169,7 +169,7 @@ Reference< XConnection > SAL_CALL OStatement_Base::getConnection( ) throw(SQLEx { ::osl::MutexGuard aGuard( m_aMutex ); checkDisposed(OStatement_BASE::rBHelper.bDisposed); - + // just return our connection here return (Reference< XConnection >)m_pConnection; } @@ -193,7 +193,7 @@ void SAL_CALL OStatement::addBatch( const ::rtl::OUString& sql ) throw(SQLExcept { ::osl::MutexGuard aGuard( m_aMutex ); checkDisposed(OStatement_BASE::rBHelper.bDisposed); - + m_aBatchList.push_back(sql); } @@ -202,7 +202,7 @@ Sequence< sal_Int32 > SAL_CALL OStatement::executeBatch( ) throw(SQLException, { ::osl::MutexGuard aGuard( m_aMutex ); checkDisposed(OStatement_BASE::rBHelper.bDisposed); - + return Sequence< sal_Int32 >(); } // ------------------------------------------------------------------------- @@ -212,8 +212,8 @@ sal_Int32 SAL_CALL OStatement_Base::executeUpdate( const ::rtl::OUString& sql ) { ::osl::MutexGuard aGuard( m_aMutex ); checkDisposed(OStatement_BASE::rBHelper.bDisposed); - - // the return values gives information about how many rows are affected by executing the sql statement + + // the return values gives information about how many rows are affected by executing the sql statement return 0; } @@ -223,8 +223,8 @@ Reference< XResultSet > SAL_CALL OStatement_Base::getResultSet( ) throw(SQLExce { ::osl::MutexGuard aGuard( m_aMutex ); checkDisposed(OStatement_BASE::rBHelper.bDisposed); - -// return our save resultset here + +// return our save resultset here return m_xResultSet; } // ------------------------------------------------------------------------- @@ -234,7 +234,7 @@ sal_Bool SAL_CALL OStatement_Base::getMoreResults( ) throw(SQLException, Runtim ::osl::MutexGuard aGuard( m_aMutex ); checkDisposed(OStatement_BASE::rBHelper.bDisposed); - // if your driver supports more than only one resultset + // if your driver supports more than only one resultset // and has one more at this moment return true return sal_False; } @@ -245,7 +245,7 @@ Any SAL_CALL OStatement_Base::getWarnings( ) throw(SQLException, RuntimeExcepti { ::osl::MutexGuard aGuard( m_aMutex ); checkDisposed(OStatement_BASE::rBHelper.bDisposed); - + return makeAny(m_aLastWarning); } @@ -256,7 +256,7 @@ void SAL_CALL OStatement_Base::clearWarnings( ) throw(SQLException, RuntimeExce { ::osl::MutexGuard aGuard( m_aMutex ); checkDisposed(OStatement_BASE::rBHelper.bDisposed); - + m_aLastWarning = SQLWarning(); } @@ -268,12 +268,12 @@ void SAL_CALL OStatement_Base::clearWarnings( ) throw(SQLException, RuntimeExce Sequence< Property > aProps(10); Property* pProperties = aProps.getArray(); sal_Int32 nPos = 0; - DECL_PROP0(CURSORNAME, ::rtl::OUString); + DECL_PROP0(CURSORNAME, ::rtl::OUString); DECL_BOOL_PROP0(ESCAPEPROCESSING); DECL_PROP0(FETCHDIRECTION,sal_Int32); - DECL_PROP0(FETCHSIZE, sal_Int32); + DECL_PROP0(FETCHSIZE, sal_Int32); DECL_PROP0(MAXFIELDSIZE,sal_Int32); - DECL_PROP0(MAXROWS, sal_Int32); + DECL_PROP0(MAXROWS, sal_Int32); DECL_PROP0(QUERYTIMEOUT,sal_Int32); DECL_PROP0(RESULTSETCONCURRENCY,sal_Int32); DECL_PROP0(RESULTSETTYPE,sal_Int32); @@ -296,7 +296,7 @@ sal_Bool OStatement_Base::convertFastPropertyValue( throw (::com::sun::star::lang::IllegalArgumentException) { sal_Bool bConverted = sal_False; - // here we have to try to convert + // here we have to try to convert return bConverted; } // ------------------------------------------------------------------------- diff --git a/odk/examples/DevelopersGuide/Database/DriverSkeleton/SStatement.hxx b/odk/examples/DevelopersGuide/Database/DriverSkeleton/SStatement.hxx index 7dc260c32b6b..d8d32a4aa5b5 100644 --- a/odk/examples/DevelopersGuide/Database/DriverSkeleton/SStatement.hxx +++ b/odk/examples/DevelopersGuide/Database/DriverSkeleton/SStatement.hxx @@ -3,7 +3,7 @@ * * The Contents of this file are made available subject to the terms of * the BSD license. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * All rights reserved. * @@ -30,7 +30,7 @@ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * + * *************************************************************************/ #ifndef CONNECTIVITY_SSTATEMENT_HXX @@ -54,7 +54,7 @@ namespace connectivity namespace skeleton { - typedef ::cppu::WeakComponentImplHelper5< ::com::sun::star::sdbc::XStatement, + typedef ::cppu::WeakComponentImplHelper5< ::com::sun::star::sdbc::XStatement, ::com::sun::star::sdbc::XWarningsSupplier, ::com::sun::star::util::XCancellable, ::com::sun::star::sdbc::XCloseable, @@ -64,10 +64,10 @@ namespace connectivity //************ Class: OStatement_Base // is a base class for the normal statement and for the prepared statement //************************************************************** - class OStatement_Base : public OBase_Mutex, - public OStatement_BASE, - public ::cppu::OPropertySetHelper, - public OPropertyArrayUsageHelper<OStatement_Base> + class OStatement_Base : public OBase_Mutex, + public OStatement_BASE, + public ::cppu::OPropertySetHelper, + public OPropertyArrayUsageHelper<OStatement_Base> { ::com::sun::star::sdbc::SQLWarning m_aLastWarning; @@ -75,9 +75,9 @@ namespace connectivity ::com::sun::star::uno::WeakReference< ::com::sun::star::sdbc::XResultSet> m_xResultSet; // The last ResultSet created // for this Statement - ::std::list< ::rtl::OUString> m_aBatchList; + ::std::list< ::rtl::OUString> m_aBatchList; - OConnection* m_pConnection; // The owning Connection object + OConnection* m_pConnection; // The owning Connection object protected: void disposeResultSet(); @@ -94,7 +94,7 @@ namespace connectivity throw (::com::sun::star::lang::IllegalArgumentException); virtual void SAL_CALL setFastPropertyValue_NoBroadcast( sal_Int32 nHandle, - const ::com::sun::star::uno::Any& rValue) throw (::com::sun::star::uno::Exception); + const ::com::sun::star::uno::Any& rValue) throw (::com::sun::star::uno::Exception); virtual void SAL_CALL getFastPropertyValue( ::com::sun::star::uno::Any& rValue, sal_Int32 nHandle) const; @@ -138,7 +138,7 @@ namespace connectivity OConnection* getOwnConnection() const { return m_pConnection;} }; - class OStatement_BASE2 :public OStatement_Base + class OStatement_BASE2 :public OStatement_Base ,public OSubComponent<OStatement_BASE2, OStatement_BASE> { @@ -152,7 +152,7 @@ namespace connectivity virtual void SAL_CALL release() throw(); }; - class OStatement : public OStatement_BASE2, + class OStatement : public OStatement_BASE2, public ::com::sun::star::sdbc::XBatchExecution, public ::com::sun::star::lang::XServiceInfo { diff --git a/odk/examples/DevelopersGuide/Database/DriverSkeleton/propertyids.cxx b/odk/examples/DevelopersGuide/Database/DriverSkeleton/propertyids.cxx index 832f59757f34..9cd66a47a34b 100644 --- a/odk/examples/DevelopersGuide/Database/DriverSkeleton/propertyids.cxx +++ b/odk/examples/DevelopersGuide/Database/DriverSkeleton/propertyids.cxx @@ -3,7 +3,7 @@ * * The Contents of this file are made available subject to the terms of * the BSD license. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * All rights reserved. * @@ -30,7 +30,7 @@ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * + * *************************************************************************/ #include <osl/diagnose.h> @@ -39,64 +39,64 @@ namespace connectivity { namespace skeleton { - const sal_Char* getPROPERTY_QUERYTIMEOUT() { return "QueryTimeOut"; } - const sal_Char* getPROPERTY_MAXFIELDSIZE() { return "MaxFieldSize"; } - const sal_Char* getPROPERTY_MAXROWS() { return "MaxRows"; } - const sal_Char* getPROPERTY_CURSORNAME() { return "CursorName"; } - const sal_Char* getPROPERTY_RESULTSETCONCURRENCY() { return "ResultSetConcurrency"; } - const sal_Char* getPROPERTY_RESULTSETTYPE() { return "ResultSetType"; } - const sal_Char* getPROPERTY_FETCHDIRECTION() { return "FetchDirection"; } - const sal_Char* getPROPERTY_FETCHSIZE() { return "FetchSize"; } - const sal_Char* getPROPERTY_ESCAPEPROCESSING() { return "EscapeProcessing"; } - const sal_Char* getPROPERTY_USEBOOKMARKS() { return "UseBookmarks"; } - - const sal_Char* getPROPERTY_NAME() { return "Name"; } - const sal_Char* getPROPERTY_TYPE() { return "Type"; } - const sal_Char* getPROPERTY_TYPENAME() { return "TypeName"; } - const sal_Char* getPROPERTY_PRECISION() { return "Precision"; } - const sal_Char* getPROPERTY_SCALE() { return "Scale"; } - const sal_Char* getPROPERTY_ISNULLABLE() { return "IsNullable"; } - const sal_Char* getPROPERTY_ISAUTOINCREMENT() { return "IsAutoIncrement"; } - const sal_Char* getPROPERTY_ISROWVERSION() { return "IsRowVersion"; } - const sal_Char* getPROPERTY_DESCRIPTION() { return "Description"; } - const sal_Char* getPROPERTY_DEFAULTVALUE() { return "DefaultValue"; } - - const sal_Char* getPROPERTY_REFERENCEDTABLE() { return "ReferencedTable"; } - const sal_Char* getPROPERTY_UPDATERULE() { return "UpdateRule"; } - const sal_Char* getPROPERTY_DELETERULE() { return "DeleteRule"; } - const sal_Char* getPROPERTY_CATALOG() { return "Catalog"; } - const sal_Char* getPROPERTY_ISUNIQUE() { return "IsUnique"; } - const sal_Char* getPROPERTY_ISPRIMARYKEYINDEX() { return "IsPrimaryKeyIndex"; } - const sal_Char* getPROPERTY_ISCLUSTERED() { return "IsClustered"; } - const sal_Char* getPROPERTY_ISASCENDING() { return "IsAscending"; } - const sal_Char* getPROPERTY_SCHEMANAME() { return "SchemaName"; } - const sal_Char* getPROPERTY_CATALOGNAME() { return "CatalogName"; } - const sal_Char* getPROPERTY_COMMAND() { return "Command"; } - const sal_Char* getPROPERTY_CHECKOPTION() { return "CheckOption"; } - const sal_Char* getPROPERTY_PASSWORD() { return "Password"; } - const sal_Char* getPROPERTY_RELATEDCOLUMN() { return "RelatedColumn"; } - - const sal_Char* getSTAT_INVALID_INDEX() { return "Invalid descriptor index"; } + const sal_Char* getPROPERTY_QUERYTIMEOUT() { return "QueryTimeOut"; } + const sal_Char* getPROPERTY_MAXFIELDSIZE() { return "MaxFieldSize"; } + const sal_Char* getPROPERTY_MAXROWS() { return "MaxRows"; } + const sal_Char* getPROPERTY_CURSORNAME() { return "CursorName"; } + const sal_Char* getPROPERTY_RESULTSETCONCURRENCY() { return "ResultSetConcurrency"; } + const sal_Char* getPROPERTY_RESULTSETTYPE() { return "ResultSetType"; } + const sal_Char* getPROPERTY_FETCHDIRECTION() { return "FetchDirection"; } + const sal_Char* getPROPERTY_FETCHSIZE() { return "FetchSize"; } + const sal_Char* getPROPERTY_ESCAPEPROCESSING() { return "EscapeProcessing"; } + const sal_Char* getPROPERTY_USEBOOKMARKS() { return "UseBookmarks"; } + + const sal_Char* getPROPERTY_NAME() { return "Name"; } + const sal_Char* getPROPERTY_TYPE() { return "Type"; } + const sal_Char* getPROPERTY_TYPENAME() { return "TypeName"; } + const sal_Char* getPROPERTY_PRECISION() { return "Precision"; } + const sal_Char* getPROPERTY_SCALE() { return "Scale"; } + const sal_Char* getPROPERTY_ISNULLABLE() { return "IsNullable"; } + const sal_Char* getPROPERTY_ISAUTOINCREMENT() { return "IsAutoIncrement"; } + const sal_Char* getPROPERTY_ISROWVERSION() { return "IsRowVersion"; } + const sal_Char* getPROPERTY_DESCRIPTION() { return "Description"; } + const sal_Char* getPROPERTY_DEFAULTVALUE() { return "DefaultValue"; } + + const sal_Char* getPROPERTY_REFERENCEDTABLE() { return "ReferencedTable"; } + const sal_Char* getPROPERTY_UPDATERULE() { return "UpdateRule"; } + const sal_Char* getPROPERTY_DELETERULE() { return "DeleteRule"; } + const sal_Char* getPROPERTY_CATALOG() { return "Catalog"; } + const sal_Char* getPROPERTY_ISUNIQUE() { return "IsUnique"; } + const sal_Char* getPROPERTY_ISPRIMARYKEYINDEX() { return "IsPrimaryKeyIndex"; } + const sal_Char* getPROPERTY_ISCLUSTERED() { return "IsClustered"; } + const sal_Char* getPROPERTY_ISASCENDING() { return "IsAscending"; } + const sal_Char* getPROPERTY_SCHEMANAME() { return "SchemaName"; } + const sal_Char* getPROPERTY_CATALOGNAME() { return "CatalogName"; } + const sal_Char* getPROPERTY_COMMAND() { return "Command"; } + const sal_Char* getPROPERTY_CHECKOPTION() { return "CheckOption"; } + const sal_Char* getPROPERTY_PASSWORD() { return "Password"; } + const sal_Char* getPROPERTY_RELATEDCOLUMN() { return "RelatedColumn"; } + + const sal_Char* getSTAT_INVALID_INDEX() { return "Invalid descriptor index"; } + + const sal_Char* getPROPERTY_FUNCTION() { return "Function"; } + const sal_Char* getPROPERTY_TABLENAME() { return "TableName"; } + const sal_Char* getPROPERTY_REALNAME() { return "RealName"; } + const sal_Char* getPROPERTY_DBASEPRECISIONCHANGED() { return "DbasePrecisionChanged"; } + const sal_Char* getPROPERTY_ISCURRENCY() { return "IsCurrency"; } + const sal_Char* getPROPERTY_ISBOOKMARKABLE() { return "IsBookmarkable"; } - const sal_Char* getPROPERTY_FUNCTION() { return "Function"; } - const sal_Char* getPROPERTY_TABLENAME() { return "TableName"; } - const sal_Char* getPROPERTY_REALNAME() { return "RealName"; } - const sal_Char* getPROPERTY_DBASEPRECISIONCHANGED() { return "DbasePrecisionChanged"; } - const sal_Char* getPROPERTY_ISCURRENCY() { return "IsCurrency"; } - const sal_Char* getPROPERTY_ISBOOKMARKABLE() { return "IsBookmarkable"; } + const sal_Char* getPROPERTY_FORMATKEY() { return "FormatKey"; } + const sal_Char* getPROPERTY_LOCALE() { return "Locale"; } - const sal_Char* getPROPERTY_FORMATKEY() { return "FormatKey"; } - const sal_Char* getPROPERTY_LOCALE() { return "Locale"; } - - const sal_Char* getPROPERTY_AUTOINCREMENTCREATION() { return "AutoIncrementCreation"; } - const sal_Char* getPROPERTY_PRIVILEGES() { return "Privileges"; } + const sal_Char* getPROPERTY_AUTOINCREMENTCREATION() { return "AutoIncrementCreation"; } + const sal_Char* getPROPERTY_PRIVILEGES() { return "Privileges"; } //============================================================ //= error messages //============================================================ - const sal_Char* getERRORMSG_SEQUENCE() { return "Function sequence error"; } - const sal_Char* getSQLSTATE_SEQUENCE() { return "HY010"; } - const sal_Char* getSQLSTATE_GENERAL() { return "HY0000"; } - const sal_Char* getSTR_DELIMITER() { return "/"; } + const sal_Char* getERRORMSG_SEQUENCE() { return "Function sequence error"; } + const sal_Char* getSQLSTATE_SEQUENCE() { return "HY010"; } + const sal_Char* getSQLSTATE_GENERAL() { return "HY0000"; } + const sal_Char* getSTR_DELIMITER() { return "/"; } OPropertyMap::~OPropertyMap() { @@ -122,59 +122,59 @@ namespace skeleton rtl_uString* pStr = NULL; switch(_nIndex) { - case PROPERTY_ID_QUERYTIMEOUT: { rtl_uString_newFromAscii(&pStr,getPROPERTY_QUERYTIMEOUT() ); break; } - case PROPERTY_ID_MAXFIELDSIZE: { rtl_uString_newFromAscii(&pStr,getPROPERTY_MAXFIELDSIZE() ); break; } - case PROPERTY_ID_MAXROWS: { rtl_uString_newFromAscii(&pStr,getPROPERTY_MAXROWS() ); break; } - case PROPERTY_ID_CURSORNAME: { rtl_uString_newFromAscii(&pStr,getPROPERTY_CURSORNAME() ); break; } - case PROPERTY_ID_RESULTSETCONCURRENCY: { rtl_uString_newFromAscii(&pStr,getPROPERTY_RESULTSETCONCURRENCY() ); break; } - case PROPERTY_ID_RESULTSETTYPE: { rtl_uString_newFromAscii(&pStr,getPROPERTY_RESULTSETTYPE() ); break; } - case PROPERTY_ID_FETCHDIRECTION: { rtl_uString_newFromAscii(&pStr,getPROPERTY_FETCHDIRECTION() ); break; } - case PROPERTY_ID_FETCHSIZE: { rtl_uString_newFromAscii(&pStr,getPROPERTY_FETCHSIZE() ); break; } - case PROPERTY_ID_ESCAPEPROCESSING: { rtl_uString_newFromAscii(&pStr,getPROPERTY_ESCAPEPROCESSING() ); break; } - case PROPERTY_ID_USEBOOKMARKS: { rtl_uString_newFromAscii(&pStr,getPROPERTY_USEBOOKMARKS() ); break; } - // Column - case PROPERTY_ID_NAME: { rtl_uString_newFromAscii(&pStr,getPROPERTY_NAME() ); break; } - case PROPERTY_ID_TYPE: { rtl_uString_newFromAscii(&pStr,getPROPERTY_TYPE() ); break; } - case PROPERTY_ID_TYPENAME: { rtl_uString_newFromAscii(&pStr,getPROPERTY_TYPENAME() ); break; } - case PROPERTY_ID_PRECISION: { rtl_uString_newFromAscii(&pStr,getPROPERTY_PRECISION() ); break; } - case PROPERTY_ID_SCALE: { rtl_uString_newFromAscii(&pStr,getPROPERTY_SCALE() ); break; } - case PROPERTY_ID_ISNULLABLE: { rtl_uString_newFromAscii(&pStr,getPROPERTY_ISNULLABLE() ); break; } - case PROPERTY_ID_ISAUTOINCREMENT: { rtl_uString_newFromAscii(&pStr,getPROPERTY_ISAUTOINCREMENT() ); break; } - case PROPERTY_ID_ISROWVERSION: { rtl_uString_newFromAscii(&pStr,getPROPERTY_ISROWVERSION() ); break; } - case PROPERTY_ID_DESCRIPTION: { rtl_uString_newFromAscii(&pStr,getPROPERTY_DESCRIPTION() ); break; } - case PROPERTY_ID_DEFAULTVALUE: { rtl_uString_newFromAscii(&pStr,getPROPERTY_DEFAULTVALUE() ); break; } - - case PROPERTY_ID_REFERENCEDTABLE: { rtl_uString_newFromAscii(&pStr,getPROPERTY_REFERENCEDTABLE() ); break; } - case PROPERTY_ID_UPDATERULE: { rtl_uString_newFromAscii(&pStr,getPROPERTY_UPDATERULE() ); break; } - case PROPERTY_ID_DELETERULE: { rtl_uString_newFromAscii(&pStr,getPROPERTY_DELETERULE() ); break; } - case PROPERTY_ID_CATALOG: { rtl_uString_newFromAscii(&pStr,getPROPERTY_CATALOG() ); break; } - case PROPERTY_ID_ISUNIQUE: { rtl_uString_newFromAscii(&pStr,getPROPERTY_ISUNIQUE() ); break; } - case PROPERTY_ID_ISPRIMARYKEYINDEX: { rtl_uString_newFromAscii(&pStr,getPROPERTY_ISPRIMARYKEYINDEX() ); break; } - case PROPERTY_ID_ISCLUSTERED: { rtl_uString_newFromAscii(&pStr,getPROPERTY_ISCLUSTERED() ); break; } - case PROPERTY_ID_ISASCENDING: { rtl_uString_newFromAscii(&pStr,getPROPERTY_ISASCENDING() ); break; } - case PROPERTY_ID_SCHEMANAME: { rtl_uString_newFromAscii(&pStr,getPROPERTY_SCHEMANAME() ); break; } - case PROPERTY_ID_CATALOGNAME: { rtl_uString_newFromAscii(&pStr,getPROPERTY_CATALOGNAME() ); break; } - - case PROPERTY_ID_COMMAND: { rtl_uString_newFromAscii(&pStr,getPROPERTY_COMMAND() ); break; } - case PROPERTY_ID_CHECKOPTION: { rtl_uString_newFromAscii(&pStr,getPROPERTY_CHECKOPTION() ); break; } - case PROPERTY_ID_PASSWORD: { rtl_uString_newFromAscii(&pStr,getPROPERTY_PASSWORD() ); break; } - case PROPERTY_ID_RELATEDCOLUMN: { rtl_uString_newFromAscii(&pStr,getPROPERTY_RELATEDCOLUMN() ); break; } - - case PROPERTY_ID_FUNCTION: { rtl_uString_newFromAscii(&pStr,getPROPERTY_FUNCTION() ); break; } - case PROPERTY_ID_TABLENAME: { rtl_uString_newFromAscii(&pStr,getPROPERTY_TABLENAME() ); break; } - case PROPERTY_ID_REALNAME: { rtl_uString_newFromAscii(&pStr,getPROPERTY_REALNAME() ); break; } - case PROPERTY_ID_DBASEPRECISIONCHANGED: { rtl_uString_newFromAscii(&pStr,getPROPERTY_DBASEPRECISIONCHANGED() ); break; } - case PROPERTY_ID_ISCURRENCY: { rtl_uString_newFromAscii(&pStr,getPROPERTY_ISCURRENCY() ); break; } - case PROPERTY_ID_ISBOOKMARKABLE: { rtl_uString_newFromAscii(&pStr,getPROPERTY_ISBOOKMARKABLE() ); break; } - case PROPERTY_ID_INVALID_INDEX: { rtl_uString_newFromAscii(&pStr,getSTAT_INVALID_INDEX() ); break; } - case PROPERTY_ID_ERRORMSG_SEQUENCE: { rtl_uString_newFromAscii(&pStr,getERRORMSG_SEQUENCE() ); break; } - case PROPERTY_ID_HY010: { rtl_uString_newFromAscii(&pStr,getSQLSTATE_SEQUENCE() ); break; } - case PROPERTY_ID_HY0000: { rtl_uString_newFromAscii(&pStr,getSQLSTATE_GENERAL() ); break; } - case PROPERTY_ID_DELIMITER: { rtl_uString_newFromAscii(&pStr,getSTR_DELIMITER() ); break; } - case PROPERTY_ID_FORMATKEY: { rtl_uString_newFromAscii(&pStr,getPROPERTY_FORMATKEY() ); break; } - case PROPERTY_ID_LOCALE: { rtl_uString_newFromAscii(&pStr,getPROPERTY_LOCALE() ); break; } - case PROPERTY_ID_AUTOINCREMENTCREATION: { rtl_uString_newFromAscii(&pStr,getPROPERTY_AUTOINCREMENTCREATION() ); break; } - case PROPERTY_ID_PRIVILEGES: { rtl_uString_newFromAscii(&pStr,getPROPERTY_PRIVILEGES() ); break; } + case PROPERTY_ID_QUERYTIMEOUT: { rtl_uString_newFromAscii(&pStr,getPROPERTY_QUERYTIMEOUT() ); break; } + case PROPERTY_ID_MAXFIELDSIZE: { rtl_uString_newFromAscii(&pStr,getPROPERTY_MAXFIELDSIZE() ); break; } + case PROPERTY_ID_MAXROWS: { rtl_uString_newFromAscii(&pStr,getPROPERTY_MAXROWS() ); break; } + case PROPERTY_ID_CURSORNAME: { rtl_uString_newFromAscii(&pStr,getPROPERTY_CURSORNAME() ); break; } + case PROPERTY_ID_RESULTSETCONCURRENCY: { rtl_uString_newFromAscii(&pStr,getPROPERTY_RESULTSETCONCURRENCY() ); break; } + case PROPERTY_ID_RESULTSETTYPE: { rtl_uString_newFromAscii(&pStr,getPROPERTY_RESULTSETTYPE() ); break; } + case PROPERTY_ID_FETCHDIRECTION: { rtl_uString_newFromAscii(&pStr,getPROPERTY_FETCHDIRECTION() ); break; } + case PROPERTY_ID_FETCHSIZE: { rtl_uString_newFromAscii(&pStr,getPROPERTY_FETCHSIZE() ); break; } + case PROPERTY_ID_ESCAPEPROCESSING: { rtl_uString_newFromAscii(&pStr,getPROPERTY_ESCAPEPROCESSING() ); break; } + case PROPERTY_ID_USEBOOKMARKS: { rtl_uString_newFromAscii(&pStr,getPROPERTY_USEBOOKMARKS() ); break; } + // Column + case PROPERTY_ID_NAME: { rtl_uString_newFromAscii(&pStr,getPROPERTY_NAME() ); break; } + case PROPERTY_ID_TYPE: { rtl_uString_newFromAscii(&pStr,getPROPERTY_TYPE() ); break; } + case PROPERTY_ID_TYPENAME: { rtl_uString_newFromAscii(&pStr,getPROPERTY_TYPENAME() ); break; } + case PROPERTY_ID_PRECISION: { rtl_uString_newFromAscii(&pStr,getPROPERTY_PRECISION() ); break; } + case PROPERTY_ID_SCALE: { rtl_uString_newFromAscii(&pStr,getPROPERTY_SCALE() ); break; } + case PROPERTY_ID_ISNULLABLE: { rtl_uString_newFromAscii(&pStr,getPROPERTY_ISNULLABLE() ); break; } + case PROPERTY_ID_ISAUTOINCREMENT: { rtl_uString_newFromAscii(&pStr,getPROPERTY_ISAUTOINCREMENT() ); break; } + case PROPERTY_ID_ISROWVERSION: { rtl_uString_newFromAscii(&pStr,getPROPERTY_ISROWVERSION() ); break; } + case PROPERTY_ID_DESCRIPTION: { rtl_uString_newFromAscii(&pStr,getPROPERTY_DESCRIPTION() ); break; } + case PROPERTY_ID_DEFAULTVALUE: { rtl_uString_newFromAscii(&pStr,getPROPERTY_DEFAULTVALUE() ); break; } + + case PROPERTY_ID_REFERENCEDTABLE: { rtl_uString_newFromAscii(&pStr,getPROPERTY_REFERENCEDTABLE() ); break; } + case PROPERTY_ID_UPDATERULE: { rtl_uString_newFromAscii(&pStr,getPROPERTY_UPDATERULE() ); break; } + case PROPERTY_ID_DELETERULE: { rtl_uString_newFromAscii(&pStr,getPROPERTY_DELETERULE() ); break; } + case PROPERTY_ID_CATALOG: { rtl_uString_newFromAscii(&pStr,getPROPERTY_CATALOG() ); break; } + case PROPERTY_ID_ISUNIQUE: { rtl_uString_newFromAscii(&pStr,getPROPERTY_ISUNIQUE() ); break; } + case PROPERTY_ID_ISPRIMARYKEYINDEX: { rtl_uString_newFromAscii(&pStr,getPROPERTY_ISPRIMARYKEYINDEX() ); break; } + case PROPERTY_ID_ISCLUSTERED: { rtl_uString_newFromAscii(&pStr,getPROPERTY_ISCLUSTERED() ); break; } + case PROPERTY_ID_ISASCENDING: { rtl_uString_newFromAscii(&pStr,getPROPERTY_ISASCENDING() ); break; } + case PROPERTY_ID_SCHEMANAME: { rtl_uString_newFromAscii(&pStr,getPROPERTY_SCHEMANAME() ); break; } + case PROPERTY_ID_CATALOGNAME: { rtl_uString_newFromAscii(&pStr,getPROPERTY_CATALOGNAME() ); break; } + + case PROPERTY_ID_COMMAND: { rtl_uString_newFromAscii(&pStr,getPROPERTY_COMMAND() ); break; } + case PROPERTY_ID_CHECKOPTION: { rtl_uString_newFromAscii(&pStr,getPROPERTY_CHECKOPTION() ); break; } + case PROPERTY_ID_PASSWORD: { rtl_uString_newFromAscii(&pStr,getPROPERTY_PASSWORD() ); break; } + case PROPERTY_ID_RELATEDCOLUMN: { rtl_uString_newFromAscii(&pStr,getPROPERTY_RELATEDCOLUMN() ); break; } + + case PROPERTY_ID_FUNCTION: { rtl_uString_newFromAscii(&pStr,getPROPERTY_FUNCTION() ); break; } + case PROPERTY_ID_TABLENAME: { rtl_uString_newFromAscii(&pStr,getPROPERTY_TABLENAME() ); break; } + case PROPERTY_ID_REALNAME: { rtl_uString_newFromAscii(&pStr,getPROPERTY_REALNAME() ); break; } + case PROPERTY_ID_DBASEPRECISIONCHANGED: { rtl_uString_newFromAscii(&pStr,getPROPERTY_DBASEPRECISIONCHANGED() ); break; } + case PROPERTY_ID_ISCURRENCY: { rtl_uString_newFromAscii(&pStr,getPROPERTY_ISCURRENCY() ); break; } + case PROPERTY_ID_ISBOOKMARKABLE: { rtl_uString_newFromAscii(&pStr,getPROPERTY_ISBOOKMARKABLE() ); break; } + case PROPERTY_ID_INVALID_INDEX: { rtl_uString_newFromAscii(&pStr,getSTAT_INVALID_INDEX() ); break; } + case PROPERTY_ID_ERRORMSG_SEQUENCE: { rtl_uString_newFromAscii(&pStr,getERRORMSG_SEQUENCE() ); break; } + case PROPERTY_ID_HY010: { rtl_uString_newFromAscii(&pStr,getSQLSTATE_SEQUENCE() ); break; } + case PROPERTY_ID_HY0000: { rtl_uString_newFromAscii(&pStr,getSQLSTATE_GENERAL() ); break; } + case PROPERTY_ID_DELIMITER: { rtl_uString_newFromAscii(&pStr,getSTR_DELIMITER() ); break; } + case PROPERTY_ID_FORMATKEY: { rtl_uString_newFromAscii(&pStr,getPROPERTY_FORMATKEY() ); break; } + case PROPERTY_ID_LOCALE: { rtl_uString_newFromAscii(&pStr,getPROPERTY_LOCALE() ); break; } + case PROPERTY_ID_AUTOINCREMENTCREATION: { rtl_uString_newFromAscii(&pStr,getPROPERTY_AUTOINCREMENTCREATION() ); break; } + case PROPERTY_ID_PRIVILEGES: { rtl_uString_newFromAscii(&pStr,getPROPERTY_PRIVILEGES() ); break; } } m_aPropertyMap[_nIndex] = pStr; return pStr; diff --git a/odk/examples/DevelopersGuide/Database/DriverSkeleton/propertyids.hxx b/odk/examples/DevelopersGuide/Database/DriverSkeleton/propertyids.hxx index c10aa5dc7db6..ca0d5bf27633 100644 --- a/odk/examples/DevelopersGuide/Database/DriverSkeleton/propertyids.hxx +++ b/odk/examples/DevelopersGuide/Database/DriverSkeleton/propertyids.hxx @@ -3,7 +3,7 @@ * * The Contents of this file are made available subject to the terms of * the BSD license. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * All rights reserved. * @@ -30,7 +30,7 @@ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * + * *************************************************************************/ #ifndef _CONNECTIVITY_PROPERTYIDS_HXX_ @@ -49,7 +49,7 @@ namespace skeleton { class OPropertyMap { - ::std::map<sal_Int32 , rtl_uString*> m_aPropertyMap; + ::std::map<sal_Int32 , rtl_uString*> m_aPropertyMap; ::rtl::OUString fillValue(sal_Int32 _nIndex); public: @@ -67,15 +67,15 @@ namespace skeleton }; - + typedef const sal_Char* (*PVFN)(); struct UStringDescription { - const sal_Char* pZeroTerminatedName; + const sal_Char* pZeroTerminatedName; sal_Int32 nLength; - UStringDescription(PVFN _fCharFkt); + UStringDescription(PVFN _fCharFkt); operator ::rtl::OUString() const { return ::rtl::OUString(pZeroTerminatedName,nLength,RTL_TEXTENCODING_ASCII_US); } ~UStringDescription(); private: @@ -89,73 +89,73 @@ namespace skeleton #define DECL_PROP1IMPL(varname, type) \ pProperties[nPos++] = ::com::sun::star::beans::Property(OPropertyMap::getPropMap().getNameByIndex(PROPERTY_ID_##varname), PROPERTY_ID_##varname, ::cppu::UnoType< type >::get(), //------------------------------------------------------------------------------ -#define DECL_PROP0(varname, type) \ +#define DECL_PROP0(varname, type) \ DECL_PROP1IMPL(varname, type) 0) //------------------------------------------------------------------------------ #define DECL_BOOL_PROP1IMPL(varname) \ pProperties[nPos++] = ::com::sun::star::beans::Property(OPropertyMap::getPropMap().getNameByIndex(PROPERTY_ID_##varname), PROPERTY_ID_##varname, ::getBooleanCppuType(), //------------------------------------------------------------------------------ -#define DECL_BOOL_PROP0(varname) \ +#define DECL_BOOL_PROP0(varname) \ DECL_BOOL_PROP1IMPL(varname) 0) -#define PROPERTY_ID_QUERYTIMEOUT 1 -#define PROPERTY_ID_MAXFIELDSIZE 2 -#define PROPERTY_ID_MAXROWS 3 -#define PROPERTY_ID_CURSORNAME 4 -#define PROPERTY_ID_RESULTSETCONCURRENCY 5 -#define PROPERTY_ID_RESULTSETTYPE 6 -#define PROPERTY_ID_FETCHDIRECTION 7 -#define PROPERTY_ID_FETCHSIZE 8 -#define PROPERTY_ID_ESCAPEPROCESSING 9 -#define PROPERTY_ID_USEBOOKMARKS 10 +#define PROPERTY_ID_QUERYTIMEOUT 1 +#define PROPERTY_ID_MAXFIELDSIZE 2 +#define PROPERTY_ID_MAXROWS 3 +#define PROPERTY_ID_CURSORNAME 4 +#define PROPERTY_ID_RESULTSETCONCURRENCY 5 +#define PROPERTY_ID_RESULTSETTYPE 6 +#define PROPERTY_ID_FETCHDIRECTION 7 +#define PROPERTY_ID_FETCHSIZE 8 +#define PROPERTY_ID_ESCAPEPROCESSING 9 +#define PROPERTY_ID_USEBOOKMARKS 10 // Column -#define PROPERTY_ID_NAME 11 -#define PROPERTY_ID_TYPE 12 -#define PROPERTY_ID_TYPENAME 13 -#define PROPERTY_ID_PRECISION 14 -#define PROPERTY_ID_SCALE 15 -#define PROPERTY_ID_ISNULLABLE 16 -#define PROPERTY_ID_ISAUTOINCREMENT 17 -#define PROPERTY_ID_ISROWVERSION 18 -#define PROPERTY_ID_DESCRIPTION 19 -#define PROPERTY_ID_DEFAULTVALUE 20 - -#define PROPERTY_ID_REFERENCEDTABLE 21 -#define PROPERTY_ID_UPDATERULE 22 -#define PROPERTY_ID_DELETERULE 23 -#define PROPERTY_ID_CATALOG 24 -#define PROPERTY_ID_ISUNIQUE 25 -#define PROPERTY_ID_ISPRIMARYKEYINDEX 26 -#define PROPERTY_ID_ISCLUSTERED 27 -#define PROPERTY_ID_ISASCENDING 28 -#define PROPERTY_ID_SCHEMANAME 29 -#define PROPERTY_ID_CATALOGNAME 30 - -#define PROPERTY_ID_COMMAND 31 -#define PROPERTY_ID_CHECKOPTION 32 -#define PROPERTY_ID_PASSWORD 33 -#define PROPERTY_ID_RELATEDCOLUMN 34 - -#define PROPERTY_ID_FUNCTION 35 -#define PROPERTY_ID_TABLENAME 36 -#define PROPERTY_ID_REALNAME 37 -#define PROPERTY_ID_DBASEPRECISIONCHANGED 38 -#define PROPERTY_ID_ISCURRENCY 39 -#define PROPERTY_ID_ISBOOKMARKABLE 40 - -#define PROPERTY_ID_INVALID_INDEX 41 -#define PROPERTY_ID_ERRORMSG_SEQUENCE 42 -#define PROPERTY_ID_HY010 43 -#define PROPERTY_ID_HY0000 44 -#define PROPERTY_ID_DELIMITER 45 -#define PROPERTY_ID_FORMATKEY 46 -#define PROPERTY_ID_LOCALE 47 -#define PROPERTY_ID_IM001 48 - -#define PROPERTY_ID_AUTOINCREMENTCREATION 49 - -#define PROPERTY_ID_PRIVILEGES 50 +#define PROPERTY_ID_NAME 11 +#define PROPERTY_ID_TYPE 12 +#define PROPERTY_ID_TYPENAME 13 +#define PROPERTY_ID_PRECISION 14 +#define PROPERTY_ID_SCALE 15 +#define PROPERTY_ID_ISNULLABLE 16 +#define PROPERTY_ID_ISAUTOINCREMENT 17 +#define PROPERTY_ID_ISROWVERSION 18 +#define PROPERTY_ID_DESCRIPTION 19 +#define PROPERTY_ID_DEFAULTVALUE 20 + +#define PROPERTY_ID_REFERENCEDTABLE 21 +#define PROPERTY_ID_UPDATERULE 22 +#define PROPERTY_ID_DELETERULE 23 +#define PROPERTY_ID_CATALOG 24 +#define PROPERTY_ID_ISUNIQUE 25 +#define PROPERTY_ID_ISPRIMARYKEYINDEX 26 +#define PROPERTY_ID_ISCLUSTERED 27 +#define PROPERTY_ID_ISASCENDING 28 +#define PROPERTY_ID_SCHEMANAME 29 +#define PROPERTY_ID_CATALOGNAME 30 + +#define PROPERTY_ID_COMMAND 31 +#define PROPERTY_ID_CHECKOPTION 32 +#define PROPERTY_ID_PASSWORD 33 +#define PROPERTY_ID_RELATEDCOLUMN 34 + +#define PROPERTY_ID_FUNCTION 35 +#define PROPERTY_ID_TABLENAME 36 +#define PROPERTY_ID_REALNAME 37 +#define PROPERTY_ID_DBASEPRECISIONCHANGED 38 +#define PROPERTY_ID_ISCURRENCY 39 +#define PROPERTY_ID_ISBOOKMARKABLE 40 + +#define PROPERTY_ID_INVALID_INDEX 41 +#define PROPERTY_ID_ERRORMSG_SEQUENCE 42 +#define PROPERTY_ID_HY010 43 +#define PROPERTY_ID_HY0000 44 +#define PROPERTY_ID_DELIMITER 45 +#define PROPERTY_ID_FORMATKEY 46 +#define PROPERTY_ID_LOCALE 47 +#define PROPERTY_ID_IM001 48 + +#define PROPERTY_ID_AUTOINCREMENTCREATION 49 + +#define PROPERTY_ID_PRIVILEGES 50 #endif // _CONNECTIVITY_PROPERTYIDS_HXX_ |