trim excessive leading whitespace in connectivity

Change-Id: I5629ca3ac7503c1cab848f65fcd25d15a1e3dcaa
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/182580
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
Tested-by: Jenkins
Reviewed-by: Lionel Mamane <lionel@mamane.lu>
This commit is contained in:
Noel Grandin
2025-03-07 16:14:01 +01:00
parent b1b6f4f706
commit f4ba2e1c5a
177 changed files with 10564 additions and 10564 deletions
+62 -62
View File
@@ -36,80 +36,80 @@ namespace com::sun::star::sdbc { class XResultSet; }
namespace com::sun::star::sdbc { class XRow; }
namespace connectivity::sdbcx
{
class OCollection;
// OCatalog is a general catalog class
// other drivers can be derived their catalog from this class when they want to support sdbcx
// it holds already tables, views, groups and users
typedef ::cppu::WeakComponentImplHelper< css::sdbcx::XTablesSupplier,
css::sdbcx::XViewsSupplier,
css::sdbcx::XUsersSupplier,
css::sdbcx::XGroupsSupplier,
css::lang::XServiceInfo> OCatalog_BASE;
class OOO_DLLPUBLIC_DBTOOLS SAL_NO_VTABLE OCatalog :
public OCatalog_BASE,
public IRefreshableGroups,
public IRefreshableUsers
{
protected:
class OCollection;
// OCatalog is a general catalog class
// other drivers can be derived their catalog from this class when they want to support sdbcx
// it holds already tables, views, groups and users
::osl::Mutex m_aMutex;
typedef ::cppu::WeakComponentImplHelper< css::sdbcx::XTablesSupplier,
css::sdbcx::XViewsSupplier,
css::sdbcx::XUsersSupplier,
css::sdbcx::XGroupsSupplier,
css::lang::XServiceInfo> OCatalog_BASE;
// this members are deleted when the dtor is called
// they are hold weak
std::unique_ptr<OCollection> m_pTables;
std::unique_ptr<OCollection> m_pViews;
std::unique_ptr<OCollection> m_pGroups;
std::unique_ptr<OCollection> m_pUsers;
css::uno::Reference< css::sdbc::XDatabaseMetaData > m_xMetaData; // just to make things easier
class OOO_DLLPUBLIC_DBTOOLS SAL_NO_VTABLE OCatalog :
public OCatalog_BASE,
public IRefreshableGroups,
public IRefreshableUsers
{
protected:
/** builds the name which should be used to access the object later on in the collection.
Will only be called in fillNames.
@param _xRow
The current row from the resultset given to fillNames.
*/
virtual OUString buildName( const css::uno::Reference< css::sdbc::XRow >& _xRow);
::osl::Mutex m_aMutex;
/** fills a vector with the necessary names which can be used in combination with the collections.
For each row buildName will be called.
@param _xResult
The resultset which should be used to fill the names. Will be disposed after return and set to NULL.
@param _rNames
The vector who will be filled.
*/
void fillNames(css::uno::Reference< css::sdbc::XResultSet >& _xResult,::std::vector< OUString>& _rNames);
// this members are deleted when the dtor is called
// they are hold weak
std::unique_ptr<OCollection> m_pTables;
std::unique_ptr<OCollection> m_pViews;
std::unique_ptr<OCollection> m_pGroups;
std::unique_ptr<OCollection> m_pUsers;
public:
OCatalog(const css::uno::Reference< css::sdbc::XConnection> &_xConnection);
virtual ~OCatalog() override;
css::uno::Reference< css::sdbc::XDatabaseMetaData > m_xMetaData; // just to make things easier
DECLARE_SERVICE_INFO();
/** builds the name which should be used to access the object later on in the collection.
Will only be called in fillNames.
@param _xRow
The current row from the resultset given to fillNames.
*/
virtual OUString buildName( const css::uno::Reference< css::sdbc::XRow >& _xRow);
// refreshTables is called when the method getTables had been called
// the member m_pTables has to be created
virtual void refreshTables() = 0;
// refreshViews is called when the method getViews had been called
virtual void refreshViews() = 0;
/** fills a vector with the necessary names which can be used in combination with the collections.
For each row buildName will be called.
@param _xResult
The resultset which should be used to fill the names. Will be disposed after return and set to NULL.
@param _rNames
The vector who will be filled.
*/
void fillNames(css::uno::Reference< css::sdbc::XResultSet >& _xResult,::std::vector< OUString>& _rNames);
// the other refresh methods come from base classes IRefreshableGroups and IRefreshableUsers
public:
OCatalog(const css::uno::Reference< css::sdbc::XConnection> &_xConnection);
virtual ~OCatalog() override;
// ::cppu::OComponentHelper
virtual void SAL_CALL disposing() override;
// XTablesSupplier
virtual css::uno::Reference< css::container::XNameAccess > SAL_CALL getTables( ) override;
// XViewsSupplier
virtual css::uno::Reference< css::container::XNameAccess > SAL_CALL getViews( ) override;
// XUsersSupplier
virtual css::uno::Reference< css::container::XNameAccess > SAL_CALL getUsers( ) override;
// XGroupsSupplier
virtual css::uno::Reference< css::container::XNameAccess > SAL_CALL getGroups( ) override;
DECLARE_SERVICE_INFO();
// refreshTables is called when the method getTables had been called
// the member m_pTables has to be created
virtual void refreshTables() = 0;
// refreshViews is called when the method getViews had been called
virtual void refreshViews() = 0;
// the other refresh methods come from base classes IRefreshableGroups and IRefreshableUsers
// ::cppu::OComponentHelper
virtual void SAL_CALL disposing() override;
// XTablesSupplier
virtual css::uno::Reference< css::container::XNameAccess > SAL_CALL getTables( ) override;
// XViewsSupplier
virtual css::uno::Reference< css::container::XNameAccess > SAL_CALL getViews( ) override;
// XUsersSupplier
virtual css::uno::Reference< css::container::XNameAccess > SAL_CALL getUsers( ) override;
// XGroupsSupplier
virtual css::uno::Reference< css::container::XNameAccess > SAL_CALL getGroups( ) override;
};
};
}
+49 -49
View File
@@ -32,62 +32,62 @@
#include <com/sun/star/lang/XServiceInfo.hpp>
namespace connectivity::sdbcx
{
typedef OCollection OUsers;
typedef ::cppu::WeakComponentImplHelper< css::sdbcx::XUsersSupplier,
css::sdbcx::XAuthorizable,
css::container::XNamed,
css::lang::XServiceInfo> OGroup_BASE;
class OOO_DLLPUBLIC_DBTOOLS OGroup :
public cppu::BaseMutex,
public OGroup_BASE,
public IRefreshableUsers,
public ::comphelper::OPropertyArrayUsageHelper<OGroup>,
public ODescriptor
{
typedef OCollection OUsers;
protected:
// no Reference! see OCollection::acquire
std::unique_ptr<OUsers> m_pUsers;
typedef ::cppu::WeakComponentImplHelper< css::sdbcx::XUsersSupplier,
css::sdbcx::XAuthorizable,
css::container::XNamed,
css::lang::XServiceInfo> OGroup_BASE;
using OGroup_BASE::rBHelper;
class OOO_DLLPUBLIC_DBTOOLS OGroup :
public cppu::BaseMutex,
public OGroup_BASE,
public IRefreshableUsers,
public ::comphelper::OPropertyArrayUsageHelper<OGroup>,
public ODescriptor
{
protected:
// no Reference! see OCollection::acquire
std::unique_ptr<OUsers> m_pUsers;
// OPropertyArrayUsageHelper
virtual ::cppu::IPropertyArrayHelper* createArrayHelper( ) const override;
// OPropertySetHelper
virtual ::cppu::IPropertyArrayHelper & SAL_CALL getInfoHelper() override;
public:
OGroup(bool _bCase);
OGroup( const OUString& Name, bool _bCase);
virtual ~OGroup() override;
DECLARE_SERVICE_INFO();
using OGroup_BASE::rBHelper;
// XInterface
virtual void SAL_CALL acquire() noexcept override;
virtual void SAL_CALL release() noexcept override;
// OPropertyArrayUsageHelper
virtual ::cppu::IPropertyArrayHelper* createArrayHelper( ) const override;
// OPropertySetHelper
virtual ::cppu::IPropertyArrayHelper & SAL_CALL getInfoHelper() override;
public:
OGroup(bool _bCase);
OGroup( const OUString& Name, bool _bCase);
virtual ~OGroup() override;
DECLARE_SERVICE_INFO();
//XInterface
virtual css::uno::Any SAL_CALL queryInterface( const css::uno::Type & rType ) override;
//XTypeProvider
virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes( ) override;
// XInterface
virtual void SAL_CALL acquire() noexcept override;
virtual void SAL_CALL release() noexcept override;
// ::cppu::OComponentHelper
virtual void SAL_CALL disposing() override;
// XPropertySet
virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) override;
// XUsersSupplier
virtual css::uno::Reference< css::container::XNameAccess > SAL_CALL getUsers( ) override;
// XAuthorizable
virtual sal_Int32 SAL_CALL getPrivileges( const OUString& objName, sal_Int32 objType ) override;
virtual sal_Int32 SAL_CALL getGrantablePrivileges( const OUString& objName, sal_Int32 objType ) override;
virtual void SAL_CALL grantPrivileges( const OUString& objName, sal_Int32 objType, sal_Int32 objPrivileges ) override;
virtual void SAL_CALL revokePrivileges( const OUString& objName, sal_Int32 objType, sal_Int32 objPrivileges ) override;
//XInterface
virtual css::uno::Any SAL_CALL queryInterface( const css::uno::Type & rType ) override;
//XTypeProvider
virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes( ) override;
// ::cppu::OComponentHelper
virtual void SAL_CALL disposing() override;
// XPropertySet
virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) override;
// XUsersSupplier
virtual css::uno::Reference< css::container::XNameAccess > SAL_CALL getUsers( ) override;
// XAuthorizable
virtual sal_Int32 SAL_CALL getPrivileges( const OUString& objName, sal_Int32 objType ) override;
virtual sal_Int32 SAL_CALL getGrantablePrivileges( const OUString& objName, sal_Int32 objType ) override;
virtual void SAL_CALL grantPrivileges( const OUString& objName, sal_Int32 objType, sal_Int32 objPrivileges ) override;
virtual void SAL_CALL revokePrivileges( const OUString& objName, sal_Int32 objType, sal_Int32 objPrivileges ) override;
// XNamed
virtual OUString SAL_CALL getName( ) override;
virtual void SAL_CALL setName( const OUString& aName ) override;
};
// XNamed
virtual OUString SAL_CALL getName( ) override;
virtual void SAL_CALL setName( const OUString& aName ) override;
};
}
+55 -55
View File
@@ -31,68 +31,68 @@
#include <cppuhelper/implbase1.hxx>
namespace connectivity::sdbcx
{
class OCollection;
class OIndex;
typedef ::cppu::ImplHelper1< css::sdbcx::XDataDescriptorFactory > OIndex_BASE;
typedef ::comphelper::OIdPropertyArrayUsageHelper<OIndex> OIndex_PROP;
class UNLESS_MERGELIBS_MORE(OOO_DLLPUBLIC_DBTOOLS) OIndex :
public cppu::BaseMutex,
public ODescriptor_BASE,
public IRefreshableColumns,
public OIndex_PROP,
public ODescriptor,
public OIndex_BASE
{
class OCollection;
class OIndex;
typedef ::cppu::ImplHelper1< css::sdbcx::XDataDescriptorFactory > OIndex_BASE;
typedef ::comphelper::OIdPropertyArrayUsageHelper<OIndex> OIndex_PROP;
protected:
OUString m_Catalog;
bool m_IsUnique;
bool m_IsPrimaryKeyIndex;
bool m_IsClustered;
class UNLESS_MERGELIBS_MORE(OOO_DLLPUBLIC_DBTOOLS) OIndex :
public cppu::BaseMutex,
public ODescriptor_BASE,
public IRefreshableColumns,
public OIndex_PROP,
public ODescriptor,
public OIndex_BASE
{
protected:
OUString m_Catalog;
bool m_IsUnique;
bool m_IsPrimaryKeyIndex;
bool m_IsClustered;
// no Reference! see OCollection::acquire
std::unique_ptr<OCollection> m_pColumns;
// no Reference! see OCollection::acquire
std::unique_ptr<OCollection> m_pColumns;
using ODescriptor_BASE::rBHelper;
virtual void refreshColumns() override;
// OPropertyArrayUsageHelper
virtual ::cppu::IPropertyArrayHelper* createArrayHelper( sal_Int32 _nId) const override;
virtual ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper() override;
public:
OIndex(bool _bCase);
OIndex( const OUString& Name,
OUString Catalog,
bool _isUnique,
bool _isPrimaryKeyIndex,
bool _isClustered,
bool _bCase);
using ODescriptor_BASE::rBHelper;
virtual void refreshColumns() override;
// OPropertyArrayUsageHelper
virtual ::cppu::IPropertyArrayHelper* createArrayHelper( sal_Int32 _nId) const override;
virtual ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper() override;
public:
OIndex(bool _bCase);
OIndex( const OUString& Name,
OUString Catalog,
bool _isUnique,
bool _isPrimaryKeyIndex,
bool _isClustered,
bool _bCase);
virtual ~OIndex( ) override;
virtual ~OIndex( ) override;
DECLARE_SERVICE_INFO();
DECLARE_SERVICE_INFO();
//XInterface
virtual css::uno::Any SAL_CALL queryInterface( const css::uno::Type & rType ) override;
virtual void SAL_CALL acquire() noexcept override;
virtual void SAL_CALL release() noexcept override;
//XTypeProvider
virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes( ) override;
// ODescriptor
virtual void construct() override;
// ::cppu::OComponentHelper
virtual void SAL_CALL disposing() override;
// XPropertySet
virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) override;
// XColumnsSupplier
virtual css::uno::Reference< css::container::XNameAccess > SAL_CALL getColumns( ) override;
//XInterface
virtual css::uno::Any SAL_CALL queryInterface( const css::uno::Type & rType ) override;
virtual void SAL_CALL acquire() noexcept override;
virtual void SAL_CALL release() noexcept override;
//XTypeProvider
virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes( ) override;
// ODescriptor
virtual void construct() override;
// ::cppu::OComponentHelper
virtual void SAL_CALL disposing() override;
// XPropertySet
virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) override;
// XColumnsSupplier
virtual css::uno::Reference< css::container::XNameAccess > SAL_CALL getColumns( ) override;
// XNamed
virtual OUString SAL_CALL getName( ) override;
virtual void SAL_CALL setName( const OUString& aName ) override;
// XDataDescriptorFactory
virtual css::uno::Reference< css::beans::XPropertySet > SAL_CALL createDataDescriptor( ) override;
};
// XNamed
virtual OUString SAL_CALL getName( ) override;
virtual void SAL_CALL setName( const OUString& aName ) override;
// XDataDescriptorFactory
virtual css::uno::Reference< css::beans::XPropertySet > SAL_CALL createDataDescriptor( ) override;
};
}
+27 -27
View File
@@ -24,35 +24,35 @@
#include <connectivity/sdbcx/VColumn.hxx>
namespace connectivity::sdbcx
{
class OIndexColumn;
typedef ::comphelper::OIdPropertyArrayUsageHelper<OIndexColumn> OIndexColumn_PROP;
class UNLESS_MERGELIBS_MORE(OOO_DLLPUBLIC_DBTOOLS) OIndexColumn :
public OColumn, public OIndexColumn_PROP
{
class OIndexColumn;
typedef ::comphelper::OIdPropertyArrayUsageHelper<OIndexColumn> OIndexColumn_PROP;
bool m_IsAscending;
protected:
virtual ::cppu::IPropertyArrayHelper* createArrayHelper( sal_Int32 _nId) const override;
virtual ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper() override;
public:
OIndexColumn( bool _bCase);
OIndexColumn( bool IsAscending,
const OUString& Name,
const OUString& TypeName,
const OUString& DefaultValue,
sal_Int32 IsNullable,
sal_Int32 Precision,
sal_Int32 Scale,
sal_Int32 Type,
bool _bCase,
const OUString& CatalogName,
const OUString& SchemaName,
const OUString& TableName);
class UNLESS_MERGELIBS_MORE(OOO_DLLPUBLIC_DBTOOLS) OIndexColumn :
public OColumn, public OIndexColumn_PROP
{
bool m_IsAscending;
protected:
virtual ::cppu::IPropertyArrayHelper* createArrayHelper( sal_Int32 _nId) const override;
virtual ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper() override;
public:
OIndexColumn( bool _bCase);
OIndexColumn( bool IsAscending,
const OUString& Name,
const OUString& TypeName,
const OUString& DefaultValue,
sal_Int32 IsNullable,
sal_Int32 Precision,
sal_Int32 Scale,
sal_Int32 Type,
bool _bCase,
const OUString& CatalogName,
const OUString& SchemaName,
const OUString& TableName);
virtual void construct() override;
DECLARE_SERVICE_INFO();
};
virtual void construct() override;
DECLARE_SERVICE_INFO();
};
}
+63 -63
View File
@@ -33,76 +33,76 @@
#include <utility>
namespace connectivity::sdbcx
{
struct OOO_DLLPUBLIC_DBTOOLS KeyProperties
{
::std::vector< OUString> m_aKeyColumnNames;
OUString m_ReferencedTable;
sal_Int32 m_Type;
sal_Int32 m_UpdateRule;
sal_Int32 m_DeleteRule;
KeyProperties(OUString ReferencedTable,
sal_Int32 Type,
sal_Int32 UpdateRule,
sal_Int32 DeleteRule)
:m_ReferencedTable(std::move(ReferencedTable)),
m_Type(Type),
m_UpdateRule(UpdateRule),
m_DeleteRule(DeleteRule)
{}
KeyProperties():m_Type(0),m_UpdateRule(0),m_DeleteRule(0){}
};
typedef ::cppu::ImplHelper1< css::sdbcx::XDataDescriptorFactory > OKey_BASE;
class OCollection;
struct OOO_DLLPUBLIC_DBTOOLS KeyProperties
{
::std::vector< OUString> m_aKeyColumnNames;
OUString m_ReferencedTable;
sal_Int32 m_Type;
sal_Int32 m_UpdateRule;
sal_Int32 m_DeleteRule;
KeyProperties(OUString ReferencedTable,
sal_Int32 Type,
sal_Int32 UpdateRule,
sal_Int32 DeleteRule)
:m_ReferencedTable(std::move(ReferencedTable)),
m_Type(Type),
m_UpdateRule(UpdateRule),
m_DeleteRule(DeleteRule)
{}
KeyProperties():m_Type(0),m_UpdateRule(0),m_DeleteRule(0){}
};
typedef ::cppu::ImplHelper1< css::sdbcx::XDataDescriptorFactory > OKey_BASE;
class OCollection;
class OOO_DLLPUBLIC_DBTOOLS OKey :
public cppu::BaseMutex,
public ODescriptor_BASE,
public IRefreshableColumns,
public ::comphelper::OIdPropertyArrayUsageHelper<OKey>,
public ODescriptor,
public OKey_BASE
{
protected:
std::shared_ptr<KeyProperties> m_aProps;
// no Reference! see OCollection::acquire
std::unique_ptr<OCollection> m_pColumns;
class OOO_DLLPUBLIC_DBTOOLS OKey :
public cppu::BaseMutex,
public ODescriptor_BASE,
public IRefreshableColumns,
public ::comphelper::OIdPropertyArrayUsageHelper<OKey>,
public ODescriptor,
public OKey_BASE
{
protected:
std::shared_ptr<KeyProperties> m_aProps;
// no Reference! see OCollection::acquire
std::unique_ptr<OCollection> m_pColumns;
using ODescriptor_BASE::rBHelper;
// OPropertyArrayUsageHelper
virtual ::cppu::IPropertyArrayHelper* createArrayHelper( sal_Int32 _nId) const override;
// OPropertySetHelper
virtual ::cppu::IPropertyArrayHelper & SAL_CALL getInfoHelper() override;
public:
OKey(bool _bCase);
OKey(const OUString& Name,std::shared_ptr<KeyProperties> _xProps,bool _bCase);
using ODescriptor_BASE::rBHelper;
// OPropertyArrayUsageHelper
virtual ::cppu::IPropertyArrayHelper* createArrayHelper( sal_Int32 _nId) const override;
// OPropertySetHelper
virtual ::cppu::IPropertyArrayHelper & SAL_CALL getInfoHelper() override;
public:
OKey(bool _bCase);
OKey(const OUString& Name,std::shared_ptr<KeyProperties> _xProps,bool _bCase);
virtual ~OKey( ) override;
virtual ~OKey( ) override;
DECLARE_SERVICE_INFO();
//XInterface
virtual css::uno::Any SAL_CALL queryInterface( const css::uno::Type & rType ) override;
virtual void SAL_CALL acquire() noexcept override;
virtual void SAL_CALL release() noexcept override;
//XTypeProvider
virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes( ) override;
// ODescriptor
virtual void construct() override;
DECLARE_SERVICE_INFO();
//XInterface
virtual css::uno::Any SAL_CALL queryInterface( const css::uno::Type & rType ) override;
virtual void SAL_CALL acquire() noexcept override;
virtual void SAL_CALL release() noexcept override;
//XTypeProvider
virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes( ) override;
// ODescriptor
virtual void construct() override;
// ::cppu::OComponentHelper
virtual void SAL_CALL disposing() override;
// XPropertySet
virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) override;
// XColumnsSupplier
virtual css::uno::Reference< css::container::XNameAccess > SAL_CALL getColumns( ) override;
// ::cppu::OComponentHelper
virtual void SAL_CALL disposing() override;
// XPropertySet
virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) override;
// XColumnsSupplier
virtual css::uno::Reference< css::container::XNameAccess > SAL_CALL getColumns( ) override;
// XNamed
virtual OUString SAL_CALL getName( ) override;
virtual void SAL_CALL setName( const OUString& aName ) override;
// XDataDescriptorFactory
virtual css::uno::Reference< css::beans::XPropertySet > SAL_CALL createDataDescriptor( ) override;
};
// XNamed
virtual OUString SAL_CALL getName( ) override;
virtual void SAL_CALL setName( const OUString& aName ) override;
// XDataDescriptorFactory
virtual css::uno::Reference< css::beans::XPropertySet > SAL_CALL createDataDescriptor( ) override;
};
}
+29 -29
View File
@@ -22,37 +22,37 @@
#include <connectivity/sdbcx/VColumn.hxx>
namespace connectivity::sdbcx
{
class OKeyColumn;
typedef ::comphelper::OIdPropertyArrayUsageHelper<OKeyColumn> OKeyColumn_PROP;
class OKeyColumn :
public OColumn, public OKeyColumn_PROP
{
class OKeyColumn;
typedef ::comphelper::OIdPropertyArrayUsageHelper<OKeyColumn> OKeyColumn_PROP;
OUString m_ReferencedColumn;
protected:
virtual ::cppu::IPropertyArrayHelper* createArrayHelper( sal_Int32 _nId) const override;
virtual ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper() override;
public:
OKeyColumn(bool _bCase);
OKeyColumn( OUString ReferencedColumn,
const OUString& Name,
const OUString& TypeName,
const OUString& DefaultValue,
sal_Int32 IsNullable,
sal_Int32 Precision,
sal_Int32 Scale,
sal_Int32 Type,
bool _bCase,
const OUString& CatalogName,
const OUString& SchemaName,
const OUString& TableName);
// just to make it not inline
virtual ~OKeyColumn() override;
class OKeyColumn :
public OColumn, public OKeyColumn_PROP
{
OUString m_ReferencedColumn;
protected:
virtual ::cppu::IPropertyArrayHelper* createArrayHelper( sal_Int32 _nId) const override;
virtual ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper() override;
public:
OKeyColumn(bool _bCase);
OKeyColumn( OUString ReferencedColumn,
const OUString& Name,
const OUString& TypeName,
const OUString& DefaultValue,
sal_Int32 IsNullable,
sal_Int32 Precision,
sal_Int32 Scale,
sal_Int32 Type,
bool _bCase,
const OUString& CatalogName,
const OUString& SchemaName,
const OUString& TableName);
// just to make it not inline
virtual ~OKeyColumn() override;
virtual void construct() override;
DECLARE_SERVICE_INFO();
};
virtual void construct() override;
DECLARE_SERVICE_INFO();
};
}
+3 -3
View File
@@ -26,9 +26,9 @@
namespace connectivity::sdbcx
{
typedef cppu::WeakComponentImplHelper< css::sdbcx::XColumnsSupplier,
css::container::XNamed,
css::lang::XServiceInfo> ODescriptor_BASE;
typedef cppu::WeakComponentImplHelper< css::sdbcx::XColumnsSupplier,
css::container::XNamed,
css::lang::XServiceInfo> ODescriptor_BASE;
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+48 -48
View File
@@ -33,62 +33,62 @@
namespace connectivity::sdbcx
{
typedef OCollection OGroups;
typedef OCollection OGroups;
typedef ::cppu::WeakComponentImplHelper< css::sdbcx::XUser,
css::sdbcx::XGroupsSupplier,
css::container::XNamed,
css::lang::XServiceInfo> OUser_BASE;
typedef ::cppu::WeakComponentImplHelper< css::sdbcx::XUser,
css::sdbcx::XGroupsSupplier,
css::container::XNamed,
css::lang::XServiceInfo> OUser_BASE;
class OOO_DLLPUBLIC_DBTOOLS OUser :
public cppu::BaseMutex,
public OUser_BASE,
public IRefreshableGroups,
public ::comphelper::OPropertyArrayUsageHelper<OUser>,
public ODescriptor
{
protected:
// no Reference! see OCollection::acquire
std::unique_ptr<OGroups> m_pGroups;
class OOO_DLLPUBLIC_DBTOOLS OUser :
public cppu::BaseMutex,
public OUser_BASE,
public IRefreshableGroups,
public ::comphelper::OPropertyArrayUsageHelper<OUser>,
public ODescriptor
{
protected:
// no Reference! see OCollection::acquire
std::unique_ptr<OGroups> m_pGroups;
using OUser_BASE::rBHelper;
using OUser_BASE::rBHelper;
// OPropertyArrayUsageHelper
virtual ::cppu::IPropertyArrayHelper* createArrayHelper( ) const override;
// OPropertySetHelper
virtual ::cppu::IPropertyArrayHelper & SAL_CALL getInfoHelper() override;
public:
OUser(bool _bCase);
OUser(const OUString& Name,bool _bCase);
// OPropertyArrayUsageHelper
virtual ::cppu::IPropertyArrayHelper* createArrayHelper( ) const override;
// OPropertySetHelper
virtual ::cppu::IPropertyArrayHelper & SAL_CALL getInfoHelper() override;
public:
OUser(bool _bCase);
OUser(const OUString& Name,bool _bCase);
virtual ~OUser( ) override;
virtual ~OUser( ) override;
DECLARE_SERVICE_INFO();
DECLARE_SERVICE_INFO();
// ::cppu::OComponentHelper
virtual void SAL_CALL disposing() override;
//XInterface
virtual css::uno::Any SAL_CALL queryInterface( const css::uno::Type & rType ) override;
virtual void SAL_CALL acquire() noexcept override;
virtual void SAL_CALL release() noexcept override;
//XTypeProvider
virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes( ) override;
// XPropertySet
virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) override;
// XUser
virtual void SAL_CALL changePassword( const OUString& objPassword, const OUString& newPassword ) override;
// XAuthorizable
virtual sal_Int32 SAL_CALL getPrivileges( const OUString& objName, sal_Int32 objType ) override;
virtual sal_Int32 SAL_CALL getGrantablePrivileges( const OUString& objName, sal_Int32 objType ) override;
virtual void SAL_CALL grantPrivileges( const OUString& objName, sal_Int32 objType, sal_Int32 objPrivileges ) override;
virtual void SAL_CALL revokePrivileges( const OUString& objName, sal_Int32 objType, sal_Int32 objPrivileges ) override;
// XGroupsSupplier
virtual css::uno::Reference< css::container::XNameAccess > SAL_CALL getGroups( ) override;
// ::cppu::OComponentHelper
virtual void SAL_CALL disposing() override;
//XInterface
virtual css::uno::Any SAL_CALL queryInterface( const css::uno::Type & rType ) override;
virtual void SAL_CALL acquire() noexcept override;
virtual void SAL_CALL release() noexcept override;
//XTypeProvider
virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes( ) override;
// XPropertySet
virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) override;
// XUser
virtual void SAL_CALL changePassword( const OUString& objPassword, const OUString& newPassword ) override;
// XAuthorizable
virtual sal_Int32 SAL_CALL getPrivileges( const OUString& objName, sal_Int32 objType ) override;
virtual sal_Int32 SAL_CALL getGrantablePrivileges( const OUString& objName, sal_Int32 objType ) override;
virtual void SAL_CALL grantPrivileges( const OUString& objName, sal_Int32 objType, sal_Int32 objPrivileges ) override;
virtual void SAL_CALL revokePrivileges( const OUString& objName, sal_Int32 objType, sal_Int32 objPrivileges ) override;
// XGroupsSupplier
virtual css::uno::Reference< css::container::XNameAccess > SAL_CALL getGroups( ) override;
// XNamed
virtual OUString SAL_CALL getName( ) override;
virtual void SAL_CALL setName( const OUString& aName ) override;
};
// XNamed
virtual OUString SAL_CALL getName( ) override;
virtual void SAL_CALL setName( const OUString& aName ) override;
};
}
+15 -15
View File
@@ -23,21 +23,21 @@
namespace connectivity::evoab
{
class OEvoabConnection;
class OEvoabCatalog : public connectivity::sdbcx::OCatalog
{
OEvoabConnection *m_pConnection;
public:
explicit OEvoabCatalog(OEvoabConnection *_pCon);
OEvoabConnection* getConnection() const { return m_pConnection; }
virtual void refreshTables() override;
virtual void refreshViews() override {}
virtual void refreshGroups() override {}
virtual void refreshUsers() override {}
// XTablesSupplier
virtual css::uno::Reference< css::container::XNameAccess > SAL_CALL getTables(
) override;
};
class OEvoabConnection;
class OEvoabCatalog : public connectivity::sdbcx::OCatalog
{
OEvoabConnection *m_pConnection;
public:
explicit OEvoabCatalog(OEvoabConnection *_pCon);
OEvoabConnection* getConnection() const { return m_pConnection; }
virtual void refreshTables() override;
virtual void refreshViews() override {}
virtual void refreshGroups() override {}
virtual void refreshUsers() override {}
// XTablesSupplier
virtual css::uno::Reference< css::container::XNameAccess > SAL_CALL getTables(
) override;
};
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+13 -13
View File
@@ -24,21 +24,21 @@
namespace connectivity::evoab
{
class OEvoabColumns final : public sdbcx::OCollection
{
OEvoabTable* m_pTable;
class OEvoabColumns final : public sdbcx::OCollection
{
OEvoabTable* m_pTable;
virtual css::uno::Reference< css::beans::XPropertySet > createObject(const OUString& _rName) override;
virtual void impl_refresh() override;
virtual css::uno::Reference< css::beans::XPropertySet > createObject(const OUString& _rName) override;
virtual void impl_refresh() override;
public:
OEvoabColumns( OEvoabTable* _pTable,
::osl::Mutex& _rMutex,
const ::std::vector< OUString> &_rVector
) : sdbcx::OCollection(*_pTable,true,_rMutex,_rVector),
m_pTable(_pTable)
{ }
};
public:
OEvoabColumns( OEvoabTable* _pTable,
::osl::Mutex& _rMutex,
const ::std::vector< OUString> &_rVector
) : sdbcx::OCollection(*_pTable,true,_rMutex,_rVector),
m_pTable(_pTable)
{ }
};
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
@@ -32,74 +32,74 @@
namespace connectivity::evoab {
namespace SDBCAddress {
typedef enum {
Unknown = 0,
EVO_LOCAL = 1,
EVO_LDAP = 2,
EVO_GWISE = 3
} sdbc_address_type;
}
namespace SDBCAddress {
typedef enum {
Unknown = 0,
EVO_LOCAL = 1,
EVO_LDAP = 2,
EVO_GWISE = 3
} sdbc_address_type;
}
typedef connectivity::OMetaConnection OConnection_BASE; // implements basics and text encoding
typedef connectivity::OMetaConnection OConnection_BASE; // implements basics and text encoding
class OEvoabConnection final :public OConnection_BASE
{
private:
const OEvoabDriver& m_rDriver;
SDBCAddress::sdbc_address_type m_eSDBCAddressType;
css::uno::Reference< css::sdbcx::XTablesSupplier >
m_xCatalog;
OString m_aPassword;
::dbtools::WarningsContainer m_aWarnings;
class OEvoabConnection final :public OConnection_BASE
{
private:
const OEvoabDriver& m_rDriver;
SDBCAddress::sdbc_address_type m_eSDBCAddressType;
css::uno::Reference< css::sdbcx::XTablesSupplier >
m_xCatalog;
OString m_aPassword;
::dbtools::WarningsContainer m_aWarnings;
virtual ~OEvoabConnection() override;
virtual ~OEvoabConnection() override;
public:
explicit OEvoabConnection( OEvoabDriver const & _rDriver );
/// @throws css::sdbc::SQLException
void construct(const OUString& _rUrl,const css::uno::Sequence< css::beans::PropertyValue >& _rInfo );
public:
explicit OEvoabConnection( OEvoabDriver const & _rDriver );
/// @throws css::sdbc::SQLException
void construct(const OUString& _rUrl,const css::uno::Sequence< css::beans::PropertyValue >& _rInfo );
void setPassword( OString const & aStr ) { m_aPassword = aStr; }
// own methods
const OEvoabDriver& getDriver() const { return m_rDriver; }
void setPassword( OString const & aStr ) { m_aPassword = aStr; }
// own methods
const OEvoabDriver& getDriver() const { return m_rDriver; }
SDBCAddress::sdbc_address_type getSDBCAddressType() const { return m_eSDBCAddressType;}
void setSDBCAddressType(SDBCAddress::sdbc_address_type _eSDBCAddressType) {m_eSDBCAddressType = _eSDBCAddressType;}
SDBCAddress::sdbc_address_type getSDBCAddressType() const { return m_eSDBCAddressType;}
void setSDBCAddressType(SDBCAddress::sdbc_address_type _eSDBCAddressType) {m_eSDBCAddressType = _eSDBCAddressType;}
// OComponentHelper
virtual void SAL_CALL disposing() override;
// OComponentHelper
virtual void SAL_CALL disposing() override;
// XServiceInfo
DECLARE_SERVICE_INFO();
// XServiceInfo
DECLARE_SERVICE_INFO();
// XConnection
css::uno::Reference< css::sdbcx::XTablesSupplier > createCatalog();
virtual css::uno::Reference< css::sdbc::XStatement > SAL_CALL createStatement( ) override;
virtual css::uno::Reference< css::sdbc::XPreparedStatement > SAL_CALL prepareStatement( const OUString& sql ) override;
virtual css::uno::Reference< css::sdbc::XPreparedStatement > SAL_CALL prepareCall( const OUString& sql ) override;
virtual OUString SAL_CALL nativeSQL( const OUString& sql ) override;
virtual void SAL_CALL setAutoCommit( sal_Bool autoCommit ) override;
virtual sal_Bool SAL_CALL getAutoCommit( ) override;
virtual void SAL_CALL commit( ) override;
virtual void SAL_CALL rollback( ) override;
virtual sal_Bool SAL_CALL isClosed( ) override;
virtual css::uno::Reference< css::sdbc::XDatabaseMetaData > SAL_CALL getMetaData( ) override;
virtual void SAL_CALL setReadOnly( sal_Bool readOnly ) override;
virtual sal_Bool SAL_CALL isReadOnly( ) override;
virtual void SAL_CALL setCatalog( const OUString& catalog ) override;
virtual OUString SAL_CALL getCatalog( ) override;
virtual void SAL_CALL setTransactionIsolation( sal_Int32 level ) override;
virtual sal_Int32 SAL_CALL getTransactionIsolation( ) override;
virtual css::uno::Reference< css::container::XNameAccess > SAL_CALL getTypeMap( ) override;
virtual void SAL_CALL setTypeMap( const css::uno::Reference< css::container::XNameAccess >& typeMap ) override;
// XConnection
css::uno::Reference< css::sdbcx::XTablesSupplier > createCatalog();
virtual css::uno::Reference< css::sdbc::XStatement > SAL_CALL createStatement( ) override;
virtual css::uno::Reference< css::sdbc::XPreparedStatement > SAL_CALL prepareStatement( const OUString& sql ) override;
virtual css::uno::Reference< css::sdbc::XPreparedStatement > SAL_CALL prepareCall( const OUString& sql ) override;
virtual OUString SAL_CALL nativeSQL( const OUString& sql ) override;
virtual void SAL_CALL setAutoCommit( sal_Bool autoCommit ) override;
virtual sal_Bool SAL_CALL getAutoCommit( ) override;
virtual void SAL_CALL commit( ) override;
virtual void SAL_CALL rollback( ) override;
virtual sal_Bool SAL_CALL isClosed( ) override;
virtual css::uno::Reference< css::sdbc::XDatabaseMetaData > SAL_CALL getMetaData( ) override;
virtual void SAL_CALL setReadOnly( sal_Bool readOnly ) override;
virtual sal_Bool SAL_CALL isReadOnly( ) override;
virtual void SAL_CALL setCatalog( const OUString& catalog ) override;
virtual OUString SAL_CALL getCatalog( ) override;
virtual void SAL_CALL setTransactionIsolation( sal_Int32 level ) override;
virtual sal_Int32 SAL_CALL getTransactionIsolation( ) override;
virtual css::uno::Reference< css::container::XNameAccess > SAL_CALL getTypeMap( ) override;
virtual void SAL_CALL setTypeMap( const css::uno::Reference< css::container::XNameAccess >& typeMap ) override;
// XCloseable
virtual void SAL_CALL close( ) override;
// XWarningsSupplier
virtual css::uno::Any SAL_CALL getWarnings( ) override;
virtual void SAL_CALL clearWarnings( ) override;
};
// XCloseable
virtual void SAL_CALL close( ) override;
// XWarningsSupplier
virtual css::uno::Any SAL_CALL getWarnings( ) override;
virtual void SAL_CALL clearWarnings( ) override;
};
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
@@ -31,187 +31,187 @@
namespace connectivity::evoab
{
//************ Class: OEvoabDatabaseMetaData
//************ Class: OEvoabDatabaseMetaData
typedef struct{
gboolean bIsSplittedValue;
GParamSpec *pField;
}ColumnProperty;
typedef struct{
gboolean bIsSplittedValue;
GParamSpec *pField;
}ColumnProperty;
typedef enum {
DEFAULT_ADDR_LINE1=1,DEFAULT_ADDR_LINE2,DEFAULT_CITY,DEFAULT_STATE,DEFAULT_COUNTRY,DEFAULT_ZIP,
WORK_ADDR_LINE1,WORK_ADDR_LINE2,WORK_CITY,WORK_STATE,WORK_COUNTRY,WORK_ZIP,
HOME_ADDR_LINE1,HOME_ADDR_LINE2,HOME_CITY,HOME_STATE,HOME_COUNTRY,HOME_ZIP,
OTHER_ADDR_LINE1,OTHER_ADDR_LINE2,OTHER_CITY,OTHER_STATE,OTHER_COUNTRY,OTHER_ZIP
}ColumnNumber;
typedef enum {
DEFAULT_ADDR_LINE1=1,DEFAULT_ADDR_LINE2,DEFAULT_CITY,DEFAULT_STATE,DEFAULT_COUNTRY,DEFAULT_ZIP,
WORK_ADDR_LINE1,WORK_ADDR_LINE2,WORK_CITY,WORK_STATE,WORK_COUNTRY,WORK_ZIP,
HOME_ADDR_LINE1,HOME_ADDR_LINE2,HOME_CITY,HOME_STATE,HOME_COUNTRY,HOME_ZIP,
OTHER_ADDR_LINE1,OTHER_ADDR_LINE2,OTHER_CITY,OTHER_STATE,OTHER_COUNTRY,OTHER_ZIP
}ColumnNumber;
typedef struct {
const gchar *pColumnName;
ColumnNumber value;
}SplitEvoColumns;
typedef struct {
const gchar *pColumnName;
ColumnNumber value;
}SplitEvoColumns;
const SplitEvoColumns* get_evo_addr();
const SplitEvoColumns* get_evo_addr();
const ColumnProperty *getField(guint n);
GType getGFieldType(guint nCol) ;
sal_Int32 getFieldType(guint nCol) ;
OUString getFieldTypeName(guint nCol) ;
OUString getFieldName(guint nCol) ;
guint findEvoabField(std::u16string_view aColName);
const ColumnProperty *getField(guint n);
GType getGFieldType(guint nCol) ;
sal_Int32 getFieldType(guint nCol) ;
OUString getFieldTypeName(guint nCol) ;
OUString getFieldName(guint nCol) ;
guint findEvoabField(std::u16string_view aColName);
void free_column_resources();
void free_column_resources();
class OEvoabDatabaseMetaData : public ODatabaseMetaDataBase
{
OEvoabConnection* m_pConnection;
class OEvoabDatabaseMetaData : public ODatabaseMetaDataBase
{
OEvoabConnection* m_pConnection;
protected:
virtual css::uno::Reference< css::sdbc::XResultSet > impl_getTypeInfo_throw() override;
// cached database information
virtual OUString impl_getIdentifierQuoteString_throw( ) override;
virtual bool impl_isCatalogAtStart_throw( ) override;
virtual OUString impl_getCatalogSeparator_throw( ) override;
virtual bool impl_supportsCatalogsInTableDefinitions_throw( ) override;
virtual bool impl_supportsSchemasInTableDefinitions_throw( ) override ;
virtual bool impl_supportsCatalogsInDataManipulation_throw( ) override;
virtual bool impl_supportsSchemasInDataManipulation_throw( ) override ;
virtual bool impl_supportsMixedCaseQuotedIdentifiers_throw( ) override ;
virtual bool impl_supportsAlterTableWithAddColumn_throw( ) override;
virtual bool impl_supportsAlterTableWithDropColumn_throw( ) override;
virtual sal_Int32 impl_getMaxStatements_throw( ) override;
virtual sal_Int32 impl_getMaxTablesInSelect_throw( ) override;
virtual bool impl_storesMixedCaseQuotedIdentifiers_throw( ) override;
protected:
virtual css::uno::Reference< css::sdbc::XResultSet > impl_getTypeInfo_throw() override;
// cached database information
virtual OUString impl_getIdentifierQuoteString_throw( ) override;
virtual bool impl_isCatalogAtStart_throw( ) override;
virtual OUString impl_getCatalogSeparator_throw( ) override;
virtual bool impl_supportsCatalogsInTableDefinitions_throw( ) override;
virtual bool impl_supportsSchemasInTableDefinitions_throw( ) override ;
virtual bool impl_supportsCatalogsInDataManipulation_throw( ) override;
virtual bool impl_supportsSchemasInDataManipulation_throw( ) override ;
virtual bool impl_supportsMixedCaseQuotedIdentifiers_throw( ) override ;
virtual bool impl_supportsAlterTableWithAddColumn_throw( ) override;
virtual bool impl_supportsAlterTableWithDropColumn_throw( ) override;
virtual sal_Int32 impl_getMaxStatements_throw( ) override;
virtual sal_Int32 impl_getMaxTablesInSelect_throw( ) override;
virtual bool impl_storesMixedCaseQuotedIdentifiers_throw( ) override;
virtual ~OEvoabDatabaseMetaData() override;
public:
explicit OEvoabDatabaseMetaData(OEvoabConnection* _pCon);
virtual ~OEvoabDatabaseMetaData() override;
public:
explicit OEvoabDatabaseMetaData(OEvoabConnection* _pCon);
// as I mentioned before this interface is really BIG
// XDatabaseMetaData
virtual sal_Bool SAL_CALL allProceduresAreCallable( ) override;
virtual sal_Bool SAL_CALL allTablesAreSelectable( ) override;
virtual OUString SAL_CALL getURL( ) override;
virtual OUString SAL_CALL getUserName( ) override;
virtual sal_Bool SAL_CALL isReadOnly( ) override;
virtual sal_Bool SAL_CALL nullsAreSortedHigh( ) override;
virtual sal_Bool SAL_CALL nullsAreSortedLow( ) override;
virtual sal_Bool SAL_CALL nullsAreSortedAtStart( ) override;
virtual sal_Bool SAL_CALL nullsAreSortedAtEnd( ) override;
virtual OUString SAL_CALL getDatabaseProductName( ) override;
virtual OUString SAL_CALL getDatabaseProductVersion( ) override;
virtual OUString SAL_CALL getDriverName( ) override;
virtual OUString SAL_CALL getDriverVersion( ) override;
virtual sal_Int32 SAL_CALL getDriverMajorVersion( ) override;
virtual sal_Int32 SAL_CALL getDriverMinorVersion( ) override;
virtual sal_Bool SAL_CALL usesLocalFiles( ) override;
virtual sal_Bool SAL_CALL usesLocalFilePerTable( ) override;
virtual sal_Bool SAL_CALL supportsMixedCaseIdentifiers( ) override;
virtual sal_Bool SAL_CALL storesUpperCaseIdentifiers( ) override;
virtual sal_Bool SAL_CALL storesLowerCaseIdentifiers( ) override;
virtual sal_Bool SAL_CALL storesMixedCaseIdentifiers( ) override;
// as I mentioned before this interface is really BIG
// XDatabaseMetaData
virtual sal_Bool SAL_CALL allProceduresAreCallable( ) override;
virtual sal_Bool SAL_CALL allTablesAreSelectable( ) override;
virtual OUString SAL_CALL getURL( ) override;
virtual OUString SAL_CALL getUserName( ) override;
virtual sal_Bool SAL_CALL isReadOnly( ) override;
virtual sal_Bool SAL_CALL nullsAreSortedHigh( ) override;
virtual sal_Bool SAL_CALL nullsAreSortedLow( ) override;
virtual sal_Bool SAL_CALL nullsAreSortedAtStart( ) override;
virtual sal_Bool SAL_CALL nullsAreSortedAtEnd( ) override;
virtual OUString SAL_CALL getDatabaseProductName( ) override;
virtual OUString SAL_CALL getDatabaseProductVersion( ) override;
virtual OUString SAL_CALL getDriverName( ) override;
virtual OUString SAL_CALL getDriverVersion( ) override;
virtual sal_Int32 SAL_CALL getDriverMajorVersion( ) override;
virtual sal_Int32 SAL_CALL getDriverMinorVersion( ) override;
virtual sal_Bool SAL_CALL usesLocalFiles( ) override;
virtual sal_Bool SAL_CALL usesLocalFilePerTable( ) override;
virtual sal_Bool SAL_CALL supportsMixedCaseIdentifiers( ) override;
virtual sal_Bool SAL_CALL storesUpperCaseIdentifiers( ) override;
virtual sal_Bool SAL_CALL storesLowerCaseIdentifiers( ) override;
virtual sal_Bool SAL_CALL storesMixedCaseIdentifiers( ) override;
virtual sal_Bool SAL_CALL storesUpperCaseQuotedIdentifiers( ) override;
virtual sal_Bool SAL_CALL storesLowerCaseQuotedIdentifiers( ) override;
virtual sal_Bool SAL_CALL storesUpperCaseQuotedIdentifiers( ) override;
virtual sal_Bool SAL_CALL storesLowerCaseQuotedIdentifiers( ) override;
virtual OUString SAL_CALL getSQLKeywords( ) override;
virtual OUString SAL_CALL getNumericFunctions( ) override;
virtual OUString SAL_CALL getStringFunctions( ) override;
virtual OUString SAL_CALL getSystemFunctions( ) override;
virtual OUString SAL_CALL getTimeDateFunctions( ) override;
virtual OUString SAL_CALL getSearchStringEscape( ) override;
virtual OUString SAL_CALL getExtraNameCharacters( ) override;
virtual sal_Bool SAL_CALL supportsColumnAliasing( ) override;
virtual sal_Bool SAL_CALL nullPlusNonNullIsNull( ) override;
virtual sal_Bool SAL_CALL supportsTypeConversion( ) override;
virtual sal_Bool SAL_CALL supportsConvert( sal_Int32 fromType, sal_Int32 toType ) override;
virtual sal_Bool SAL_CALL supportsTableCorrelationNames( ) override;
virtual sal_Bool SAL_CALL supportsDifferentTableCorrelationNames( ) override;
virtual sal_Bool SAL_CALL supportsExpressionsInOrderBy( ) override;
virtual sal_Bool SAL_CALL supportsOrderByUnrelated( ) override;
virtual sal_Bool SAL_CALL supportsGroupBy( ) override;
virtual sal_Bool SAL_CALL supportsGroupByUnrelated( ) override;
virtual sal_Bool SAL_CALL supportsGroupByBeyondSelect( ) override;
virtual sal_Bool SAL_CALL supportsLikeEscapeClause( ) override;
virtual sal_Bool SAL_CALL supportsMultipleResultSets( ) override;
virtual sal_Bool SAL_CALL supportsMultipleTransactions( ) override;
virtual sal_Bool SAL_CALL supportsNonNullableColumns( ) override;
virtual sal_Bool SAL_CALL supportsMinimumSQLGrammar( ) override;
virtual sal_Bool SAL_CALL supportsCoreSQLGrammar( ) override;
virtual sal_Bool SAL_CALL supportsExtendedSQLGrammar( ) override;
virtual sal_Bool SAL_CALL supportsANSI92EntryLevelSQL( ) override;
virtual sal_Bool SAL_CALL supportsANSI92IntermediateSQL( ) override;
virtual sal_Bool SAL_CALL supportsANSI92FullSQL( ) override;
virtual sal_Bool SAL_CALL supportsIntegrityEnhancementFacility( ) override;
virtual sal_Bool SAL_CALL supportsOuterJoins( ) override;
virtual sal_Bool SAL_CALL supportsFullOuterJoins( ) override;
virtual sal_Bool SAL_CALL supportsLimitedOuterJoins( ) override;
virtual OUString SAL_CALL getSchemaTerm( ) override;
virtual OUString SAL_CALL getProcedureTerm( ) override;
virtual OUString SAL_CALL getCatalogTerm( ) override;
virtual sal_Bool SAL_CALL supportsSchemasInProcedureCalls( ) override;
virtual sal_Bool SAL_CALL supportsSchemasInIndexDefinitions( ) override;
virtual sal_Bool SAL_CALL supportsSchemasInPrivilegeDefinitions( ) override;
virtual sal_Bool SAL_CALL supportsCatalogsInProcedureCalls( ) override;
virtual sal_Bool SAL_CALL supportsCatalogsInIndexDefinitions( ) override;
virtual sal_Bool SAL_CALL supportsCatalogsInPrivilegeDefinitions( ) override;
virtual sal_Bool SAL_CALL supportsPositionedDelete( ) override;
virtual sal_Bool SAL_CALL supportsPositionedUpdate( ) override;
virtual sal_Bool SAL_CALL supportsSelectForUpdate( ) override;
virtual sal_Bool SAL_CALL supportsStoredProcedures( ) override;
virtual sal_Bool SAL_CALL supportsSubqueriesInComparisons( ) override;
virtual sal_Bool SAL_CALL supportsSubqueriesInExists( ) override;
virtual sal_Bool SAL_CALL supportsSubqueriesInIns( ) override;
virtual sal_Bool SAL_CALL supportsSubqueriesInQuantifieds( ) override;
virtual sal_Bool SAL_CALL supportsCorrelatedSubqueries( ) override;
virtual sal_Bool SAL_CALL supportsUnion( ) override;
virtual sal_Bool SAL_CALL supportsUnionAll( ) override;
virtual sal_Bool SAL_CALL supportsOpenCursorsAcrossCommit( ) override;
virtual sal_Bool SAL_CALL supportsOpenCursorsAcrossRollback( ) override;
virtual sal_Bool SAL_CALL supportsOpenStatementsAcrossCommit( ) override;
virtual sal_Bool SAL_CALL supportsOpenStatementsAcrossRollback( ) override;
virtual sal_Int32 SAL_CALL getMaxBinaryLiteralLength( ) override;
virtual sal_Int32 SAL_CALL getMaxCharLiteralLength( ) override;
virtual sal_Int32 SAL_CALL getMaxColumnNameLength( ) override;
virtual sal_Int32 SAL_CALL getMaxColumnsInGroupBy( ) override;
virtual sal_Int32 SAL_CALL getMaxColumnsInIndex( ) override;
virtual sal_Int32 SAL_CALL getMaxColumnsInOrderBy( ) override;
virtual sal_Int32 SAL_CALL getMaxColumnsInSelect( ) override;
virtual sal_Int32 SAL_CALL getMaxColumnsInTable( ) override;
virtual sal_Int32 SAL_CALL getMaxConnections( ) override;
virtual sal_Int32 SAL_CALL getMaxCursorNameLength( ) override;
virtual sal_Int32 SAL_CALL getMaxIndexLength( ) override;
virtual sal_Int32 SAL_CALL getMaxSchemaNameLength( ) override;
virtual sal_Int32 SAL_CALL getMaxProcedureNameLength( ) override;
virtual sal_Int32 SAL_CALL getMaxCatalogNameLength( ) override;
virtual sal_Int32 SAL_CALL getMaxRowSize( ) override;
virtual sal_Bool SAL_CALL doesMaxRowSizeIncludeBlobs( ) override;
virtual sal_Int32 SAL_CALL getMaxStatementLength( ) override;
virtual sal_Int32 SAL_CALL getMaxTableNameLength( ) override;
virtual sal_Int32 SAL_CALL getMaxUserNameLength( ) override;
virtual sal_Int32 SAL_CALL getDefaultTransactionIsolation( ) override;
virtual sal_Bool SAL_CALL supportsTransactions( ) override;
virtual sal_Bool SAL_CALL supportsTransactionIsolationLevel( sal_Int32 level ) override;
virtual sal_Bool SAL_CALL supportsDataDefinitionAndDataManipulationTransactions( ) override;
virtual sal_Bool SAL_CALL supportsDataManipulationTransactionsOnly( ) override;
virtual sal_Bool SAL_CALL dataDefinitionCausesTransactionCommit( ) override;
virtual sal_Bool SAL_CALL dataDefinitionIgnoredInTransactions( ) override;
virtual css::uno::Reference< css::sdbc::XResultSet > SAL_CALL getTables( const css::uno::Any& catalog, const OUString& schemaPattern, const OUString& tableNamePattern, const css::uno::Sequence< OUString >& types ) override;
virtual css::uno::Reference< css::sdbc::XResultSet > SAL_CALL getTableTypes( ) override;
virtual css::uno::Reference< css::sdbc::XResultSet > SAL_CALL getColumns( const css::uno::Any& catalog, const OUString& schemaPattern, const OUString& tableNamePattern, const OUString& columnNamePattern ) override;
virtual sal_Bool SAL_CALL supportsResultSetType( sal_Int32 setType ) override;
virtual sal_Bool SAL_CALL supportsResultSetConcurrency( sal_Int32 setType, sal_Int32 concurrency ) override;
virtual sal_Bool SAL_CALL ownUpdatesAreVisible( sal_Int32 setType ) override;
virtual sal_Bool SAL_CALL ownDeletesAreVisible( sal_Int32 setType ) override;
virtual sal_Bool SAL_CALL ownInsertsAreVisible( sal_Int32 setType ) override;
virtual sal_Bool SAL_CALL othersUpdatesAreVisible( sal_Int32 setType ) override;
virtual sal_Bool SAL_CALL othersDeletesAreVisible( sal_Int32 setType ) override;
virtual sal_Bool SAL_CALL othersInsertsAreVisible( sal_Int32 setType ) override;
virtual sal_Bool SAL_CALL updatesAreDetected( sal_Int32 setType ) override;
virtual sal_Bool SAL_CALL deletesAreDetected( sal_Int32 setType ) override;
virtual sal_Bool SAL_CALL insertsAreDetected( sal_Int32 setType ) override;
virtual sal_Bool SAL_CALL supportsBatchUpdates( ) override;
virtual css::uno::Reference< css::sdbc::XResultSet > SAL_CALL getUDTs( const css::uno::Any& catalog, const OUString& schemaPattern, const OUString& typeNamePattern, const css::uno::Sequence< sal_Int32 >& types ) override;
};
virtual OUString SAL_CALL getSQLKeywords( ) override;
virtual OUString SAL_CALL getNumericFunctions( ) override;
virtual OUString SAL_CALL getStringFunctions( ) override;
virtual OUString SAL_CALL getSystemFunctions( ) override;
virtual OUString SAL_CALL getTimeDateFunctions( ) override;
virtual OUString SAL_CALL getSearchStringEscape( ) override;
virtual OUString SAL_CALL getExtraNameCharacters( ) override;
virtual sal_Bool SAL_CALL supportsColumnAliasing( ) override;
virtual sal_Bool SAL_CALL nullPlusNonNullIsNull( ) override;
virtual sal_Bool SAL_CALL supportsTypeConversion( ) override;
virtual sal_Bool SAL_CALL supportsConvert( sal_Int32 fromType, sal_Int32 toType ) override;
virtual sal_Bool SAL_CALL supportsTableCorrelationNames( ) override;
virtual sal_Bool SAL_CALL supportsDifferentTableCorrelationNames( ) override;
virtual sal_Bool SAL_CALL supportsExpressionsInOrderBy( ) override;
virtual sal_Bool SAL_CALL supportsOrderByUnrelated( ) override;
virtual sal_Bool SAL_CALL supportsGroupBy( ) override;
virtual sal_Bool SAL_CALL supportsGroupByUnrelated( ) override;
virtual sal_Bool SAL_CALL supportsGroupByBeyondSelect( ) override;
virtual sal_Bool SAL_CALL supportsLikeEscapeClause( ) override;
virtual sal_Bool SAL_CALL supportsMultipleResultSets( ) override;
virtual sal_Bool SAL_CALL supportsMultipleTransactions( ) override;
virtual sal_Bool SAL_CALL supportsNonNullableColumns( ) override;
virtual sal_Bool SAL_CALL supportsMinimumSQLGrammar( ) override;
virtual sal_Bool SAL_CALL supportsCoreSQLGrammar( ) override;
virtual sal_Bool SAL_CALL supportsExtendedSQLGrammar( ) override;
virtual sal_Bool SAL_CALL supportsANSI92EntryLevelSQL( ) override;
virtual sal_Bool SAL_CALL supportsANSI92IntermediateSQL( ) override;
virtual sal_Bool SAL_CALL supportsANSI92FullSQL( ) override;
virtual sal_Bool SAL_CALL supportsIntegrityEnhancementFacility( ) override;
virtual sal_Bool SAL_CALL supportsOuterJoins( ) override;
virtual sal_Bool SAL_CALL supportsFullOuterJoins( ) override;
virtual sal_Bool SAL_CALL supportsLimitedOuterJoins( ) override;
virtual OUString SAL_CALL getSchemaTerm( ) override;
virtual OUString SAL_CALL getProcedureTerm( ) override;
virtual OUString SAL_CALL getCatalogTerm( ) override;
virtual sal_Bool SAL_CALL supportsSchemasInProcedureCalls( ) override;
virtual sal_Bool SAL_CALL supportsSchemasInIndexDefinitions( ) override;
virtual sal_Bool SAL_CALL supportsSchemasInPrivilegeDefinitions( ) override;
virtual sal_Bool SAL_CALL supportsCatalogsInProcedureCalls( ) override;
virtual sal_Bool SAL_CALL supportsCatalogsInIndexDefinitions( ) override;
virtual sal_Bool SAL_CALL supportsCatalogsInPrivilegeDefinitions( ) override;
virtual sal_Bool SAL_CALL supportsPositionedDelete( ) override;
virtual sal_Bool SAL_CALL supportsPositionedUpdate( ) override;
virtual sal_Bool SAL_CALL supportsSelectForUpdate( ) override;
virtual sal_Bool SAL_CALL supportsStoredProcedures( ) override;
virtual sal_Bool SAL_CALL supportsSubqueriesInComparisons( ) override;
virtual sal_Bool SAL_CALL supportsSubqueriesInExists( ) override;
virtual sal_Bool SAL_CALL supportsSubqueriesInIns( ) override;
virtual sal_Bool SAL_CALL supportsSubqueriesInQuantifieds( ) override;
virtual sal_Bool SAL_CALL supportsCorrelatedSubqueries( ) override;
virtual sal_Bool SAL_CALL supportsUnion( ) override;
virtual sal_Bool SAL_CALL supportsUnionAll( ) override;
virtual sal_Bool SAL_CALL supportsOpenCursorsAcrossCommit( ) override;
virtual sal_Bool SAL_CALL supportsOpenCursorsAcrossRollback( ) override;
virtual sal_Bool SAL_CALL supportsOpenStatementsAcrossCommit( ) override;
virtual sal_Bool SAL_CALL supportsOpenStatementsAcrossRollback( ) override;
virtual sal_Int32 SAL_CALL getMaxBinaryLiteralLength( ) override;
virtual sal_Int32 SAL_CALL getMaxCharLiteralLength( ) override;
virtual sal_Int32 SAL_CALL getMaxColumnNameLength( ) override;
virtual sal_Int32 SAL_CALL getMaxColumnsInGroupBy( ) override;
virtual sal_Int32 SAL_CALL getMaxColumnsInIndex( ) override;
virtual sal_Int32 SAL_CALL getMaxColumnsInOrderBy( ) override;
virtual sal_Int32 SAL_CALL getMaxColumnsInSelect( ) override;
virtual sal_Int32 SAL_CALL getMaxColumnsInTable( ) override;
virtual sal_Int32 SAL_CALL getMaxConnections( ) override;
virtual sal_Int32 SAL_CALL getMaxCursorNameLength( ) override;
virtual sal_Int32 SAL_CALL getMaxIndexLength( ) override;
virtual sal_Int32 SAL_CALL getMaxSchemaNameLength( ) override;
virtual sal_Int32 SAL_CALL getMaxProcedureNameLength( ) override;
virtual sal_Int32 SAL_CALL getMaxCatalogNameLength( ) override;
virtual sal_Int32 SAL_CALL getMaxRowSize( ) override;
virtual sal_Bool SAL_CALL doesMaxRowSizeIncludeBlobs( ) override;
virtual sal_Int32 SAL_CALL getMaxStatementLength( ) override;
virtual sal_Int32 SAL_CALL getMaxTableNameLength( ) override;
virtual sal_Int32 SAL_CALL getMaxUserNameLength( ) override;
virtual sal_Int32 SAL_CALL getDefaultTransactionIsolation( ) override;
virtual sal_Bool SAL_CALL supportsTransactions( ) override;
virtual sal_Bool SAL_CALL supportsTransactionIsolationLevel( sal_Int32 level ) override;
virtual sal_Bool SAL_CALL supportsDataDefinitionAndDataManipulationTransactions( ) override;
virtual sal_Bool SAL_CALL supportsDataManipulationTransactionsOnly( ) override;
virtual sal_Bool SAL_CALL dataDefinitionCausesTransactionCommit( ) override;
virtual sal_Bool SAL_CALL dataDefinitionIgnoredInTransactions( ) override;
virtual css::uno::Reference< css::sdbc::XResultSet > SAL_CALL getTables( const css::uno::Any& catalog, const OUString& schemaPattern, const OUString& tableNamePattern, const css::uno::Sequence< OUString >& types ) override;
virtual css::uno::Reference< css::sdbc::XResultSet > SAL_CALL getTableTypes( ) override;
virtual css::uno::Reference< css::sdbc::XResultSet > SAL_CALL getColumns( const css::uno::Any& catalog, const OUString& schemaPattern, const OUString& tableNamePattern, const OUString& columnNamePattern ) override;
virtual sal_Bool SAL_CALL supportsResultSetType( sal_Int32 setType ) override;
virtual sal_Bool SAL_CALL supportsResultSetConcurrency( sal_Int32 setType, sal_Int32 concurrency ) override;
virtual sal_Bool SAL_CALL ownUpdatesAreVisible( sal_Int32 setType ) override;
virtual sal_Bool SAL_CALL ownDeletesAreVisible( sal_Int32 setType ) override;
virtual sal_Bool SAL_CALL ownInsertsAreVisible( sal_Int32 setType ) override;
virtual sal_Bool SAL_CALL othersUpdatesAreVisible( sal_Int32 setType ) override;
virtual sal_Bool SAL_CALL othersDeletesAreVisible( sal_Int32 setType ) override;
virtual sal_Bool SAL_CALL othersInsertsAreVisible( sal_Int32 setType ) override;
virtual sal_Bool SAL_CALL updatesAreDetected( sal_Int32 setType ) override;
virtual sal_Bool SAL_CALL deletesAreDetected( sal_Int32 setType ) override;
virtual sal_Bool SAL_CALL insertsAreDetected( sal_Int32 setType ) override;
virtual sal_Bool SAL_CALL supportsBatchUpdates( ) override;
virtual css::uno::Reference< css::sdbc::XResultSet > SAL_CALL getUDTs( const css::uno::Any& catalog, const OUString& schemaPattern, const OUString& typeNamePattern, const css::uno::Sequence< sal_Int32 >& types ) override;
};
}
+33 -33
View File
@@ -32,45 +32,45 @@
inline constexpr OUString EVOAB_DRIVER_IMPL_NAME = u"com.sun.star.comp.sdbc.evoab.OEvoabDriver"_ustr;
namespace connectivity::evoab
{
class OEvoabConnection;
typedef ::cppu::WeakComponentImplHelper< css::sdbc::XDriver,
css::lang::XServiceInfo > ODriver_BASE;
class OEvoabDriver final : public ODriver_BASE
{
class OEvoabConnection;
::osl::Mutex m_aMutex;
std::vector<unotools::WeakReference<OEvoabConnection>> m_xConnections;
css::uno::Reference< css::uno::XComponentContext > m_xContext;
typedef ::cppu::WeakComponentImplHelper< css::sdbc::XDriver,
css::lang::XServiceInfo > ODriver_BASE;
public:
explicit OEvoabDriver(const css::uno::Reference< css::uno::XComponentContext >& );
virtual ~OEvoabDriver() override;
// OComponentHelper
virtual void SAL_CALL disposing() override;
// XServiceInfo
virtual OUString SAL_CALL getImplementationName( ) override;
virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) override;
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames( ) override;
class OEvoabDriver final : public ODriver_BASE
{
::osl::Mutex m_aMutex;
std::vector<unotools::WeakReference<OEvoabConnection>> m_xConnections;
css::uno::Reference< css::uno::XComponentContext > m_xContext;
// XDriver
virtual css::uno::Reference< css::sdbc::XConnection > SAL_CALL connect( const OUString& url, const css::uno::Sequence< css::beans::PropertyValue >& info ) override;
virtual sal_Bool SAL_CALL acceptsURL( const OUString& url ) override;
virtual css::uno::Sequence< css::sdbc::DriverPropertyInfo > SAL_CALL getPropertyInfo( const OUString& url, const css::uno::Sequence< css::beans::PropertyValue >& info ) override;
virtual sal_Int32 SAL_CALL getMajorVersion( ) override;
virtual sal_Int32 SAL_CALL getMinorVersion( ) override;
public:
explicit OEvoabDriver(const css::uno::Reference< css::uno::XComponentContext >& );
virtual ~OEvoabDriver() override;
public:
const css::uno::Reference< css::uno::XComponentContext >& getComponentContext( ) const { return m_xContext; }
// OComponentHelper
virtual void SAL_CALL disposing() override;
// XServiceInfo
virtual OUString SAL_CALL getImplementationName( ) override;
virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) override;
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames( ) override;
// XDriver
virtual css::uno::Reference< css::sdbc::XConnection > SAL_CALL connect( const OUString& url, const css::uno::Sequence< css::beans::PropertyValue >& info ) override;
virtual sal_Bool SAL_CALL acceptsURL( const OUString& url ) override;
virtual css::uno::Sequence< css::sdbc::DriverPropertyInfo > SAL_CALL getPropertyInfo( const OUString& url, const css::uno::Sequence< css::beans::PropertyValue >& info ) override;
virtual sal_Int32 SAL_CALL getMajorVersion( ) override;
virtual sal_Int32 SAL_CALL getMinorVersion( ) override;
public:
const css::uno::Reference< css::uno::XComponentContext >& getComponentContext( ) const { return m_xContext; }
// static methods
static bool acceptsURL_Stat( std::u16string_view url );
};
// static methods
static bool acceptsURL_Stat( std::u16string_view url );
};
}
@@ -33,75 +33,75 @@
namespace connectivity::evoab
{
typedef ::cppu::ImplHelper5< css::sdbc::XPreparedStatement,
css::sdbc::XParameters,
css::sdbc::XResultSetMetaDataSupplier,
css::sdbc::XMultipleResults,
css::lang::XServiceInfo> OPreparedStatement_BASE;
typedef ::cppu::ImplHelper5< css::sdbc::XPreparedStatement,
css::sdbc::XParameters,
css::sdbc::XResultSetMetaDataSupplier,
css::sdbc::XMultipleResults,
css::lang::XServiceInfo> OPreparedStatement_BASE;
class OEvoabPreparedStatement final:public OCommonStatement
,public OPreparedStatement_BASE
{
// our SQL statement
OUString m_sSqlStatement;
// the EBookQuery we're working with
QueryData m_aQueryData;
// our meta data
rtl::Reference<OEvoabResultSetMetaData> m_xMetaData;
class OEvoabPreparedStatement final:public OCommonStatement
,public OPreparedStatement_BASE
{
// our SQL statement
OUString m_sSqlStatement;
// the EBookQuery we're working with
QueryData m_aQueryData;
// our meta data
rtl::Reference<OEvoabResultSetMetaData> m_xMetaData;
virtual ~OEvoabPreparedStatement() override;
virtual ~OEvoabPreparedStatement() override;
public:
explicit OEvoabPreparedStatement( OEvoabConnection* _pConnection );
public:
explicit OEvoabPreparedStatement( OEvoabConnection* _pConnection );
void construct( const OUString& _sql );
void construct( const OUString& _sql );
DECLARE_SERVICE_INFO();
//XInterface
virtual css::uno::Any SAL_CALL queryInterface( const css::uno::Type & rType ) override;
virtual void SAL_CALL acquire() noexcept override;
virtual void SAL_CALL release() noexcept override;
//XTypeProvider
virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes( ) override;
DECLARE_SERVICE_INFO();
//XInterface
virtual css::uno::Any SAL_CALL queryInterface( const css::uno::Type & rType ) override;
virtual void SAL_CALL acquire() noexcept override;
virtual void SAL_CALL release() noexcept override;
//XTypeProvider
virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes( ) override;
// XPreparedStatement
virtual css::uno::Reference< css::sdbc::XResultSet > SAL_CALL executeQuery( ) override;
virtual sal_Int32 SAL_CALL executeUpdate( ) override;
virtual sal_Bool SAL_CALL execute( ) override;
virtual css::uno::Reference< css::sdbc::XConnection > SAL_CALL getConnection( ) override;
// XParameters
virtual void SAL_CALL setNull( sal_Int32 parameterIndex, sal_Int32 sqlType ) override;
virtual void SAL_CALL setObjectNull( sal_Int32 parameterIndex, sal_Int32 sqlType, const OUString& typeName ) override;
virtual void SAL_CALL setBoolean( sal_Int32 parameterIndex, sal_Bool x ) override;
virtual void SAL_CALL setByte( sal_Int32 parameterIndex, sal_Int8 x ) override;
virtual void SAL_CALL setShort( sal_Int32 parameterIndex, sal_Int16 x ) override;
virtual void SAL_CALL setInt( sal_Int32 parameterIndex, sal_Int32 x ) override;
virtual void SAL_CALL setLong( sal_Int32 parameterIndex, sal_Int64 x ) override;
virtual void SAL_CALL setFloat( sal_Int32 parameterIndex, float x ) override;
virtual void SAL_CALL setDouble( sal_Int32 parameterIndex, double x ) override;
virtual void SAL_CALL setString( sal_Int32 parameterIndex, const OUString& x ) override;
virtual void SAL_CALL setBytes( sal_Int32 parameterIndex, const css::uno::Sequence< sal_Int8 >& x ) override;
virtual void SAL_CALL setDate( sal_Int32 parameterIndex, const css::util::Date& x ) override;
virtual void SAL_CALL setTime( sal_Int32 parameterIndex, const css::util::Time& x ) override;
virtual void SAL_CALL setTimestamp( sal_Int32 parameterIndex, const css::util::DateTime& x ) override;
virtual void SAL_CALL setBinaryStream( sal_Int32 parameterIndex, const css::uno::Reference< css::io::XInputStream >& x, sal_Int32 length ) override;
virtual void SAL_CALL setCharacterStream( sal_Int32 parameterIndex, const css::uno::Reference< css::io::XInputStream >& x, sal_Int32 length ) override;
virtual void SAL_CALL setObject( sal_Int32 parameterIndex, const css::uno::Any& x ) override;
virtual void SAL_CALL setObjectWithInfo( sal_Int32 parameterIndex, const css::uno::Any& x, sal_Int32 targetSqlType, sal_Int32 scale ) override;
virtual void SAL_CALL setRef( sal_Int32 parameterIndex, const css::uno::Reference< css::sdbc::XRef >& x ) override;
virtual void SAL_CALL setBlob( sal_Int32 parameterIndex, const css::uno::Reference< css::sdbc::XBlob >& x ) override;
virtual void SAL_CALL setClob( sal_Int32 parameterIndex, const css::uno::Reference< css::sdbc::XClob >& x ) override;
virtual void SAL_CALL setArray( sal_Int32 parameterIndex, const css::uno::Reference< css::sdbc::XArray >& x ) override;
virtual void SAL_CALL clearParameters( ) override;
// XCloseable
virtual void SAL_CALL close( ) override;
// XResultSetMetaDataSupplier
virtual css::uno::Reference< css::sdbc::XResultSetMetaData > SAL_CALL getMetaData( ) override;
// XMultipleResults
virtual css::uno::Reference< css::sdbc::XResultSet > SAL_CALL getResultSet( ) override;
virtual sal_Int32 SAL_CALL getUpdateCount( ) override;
virtual sal_Bool SAL_CALL getMoreResults( ) override;
};
// XPreparedStatement
virtual css::uno::Reference< css::sdbc::XResultSet > SAL_CALL executeQuery( ) override;
virtual sal_Int32 SAL_CALL executeUpdate( ) override;
virtual sal_Bool SAL_CALL execute( ) override;
virtual css::uno::Reference< css::sdbc::XConnection > SAL_CALL getConnection( ) override;
// XParameters
virtual void SAL_CALL setNull( sal_Int32 parameterIndex, sal_Int32 sqlType ) override;
virtual void SAL_CALL setObjectNull( sal_Int32 parameterIndex, sal_Int32 sqlType, const OUString& typeName ) override;
virtual void SAL_CALL setBoolean( sal_Int32 parameterIndex, sal_Bool x ) override;
virtual void SAL_CALL setByte( sal_Int32 parameterIndex, sal_Int8 x ) override;
virtual void SAL_CALL setShort( sal_Int32 parameterIndex, sal_Int16 x ) override;
virtual void SAL_CALL setInt( sal_Int32 parameterIndex, sal_Int32 x ) override;
virtual void SAL_CALL setLong( sal_Int32 parameterIndex, sal_Int64 x ) override;
virtual void SAL_CALL setFloat( sal_Int32 parameterIndex, float x ) override;
virtual void SAL_CALL setDouble( sal_Int32 parameterIndex, double x ) override;
virtual void SAL_CALL setString( sal_Int32 parameterIndex, const OUString& x ) override;
virtual void SAL_CALL setBytes( sal_Int32 parameterIndex, const css::uno::Sequence< sal_Int8 >& x ) override;
virtual void SAL_CALL setDate( sal_Int32 parameterIndex, const css::util::Date& x ) override;
virtual void SAL_CALL setTime( sal_Int32 parameterIndex, const css::util::Time& x ) override;
virtual void SAL_CALL setTimestamp( sal_Int32 parameterIndex, const css::util::DateTime& x ) override;
virtual void SAL_CALL setBinaryStream( sal_Int32 parameterIndex, const css::uno::Reference< css::io::XInputStream >& x, sal_Int32 length ) override;
virtual void SAL_CALL setCharacterStream( sal_Int32 parameterIndex, const css::uno::Reference< css::io::XInputStream >& x, sal_Int32 length ) override;
virtual void SAL_CALL setObject( sal_Int32 parameterIndex, const css::uno::Any& x ) override;
virtual void SAL_CALL setObjectWithInfo( sal_Int32 parameterIndex, const css::uno::Any& x, sal_Int32 targetSqlType, sal_Int32 scale ) override;
virtual void SAL_CALL setRef( sal_Int32 parameterIndex, const css::uno::Reference< css::sdbc::XRef >& x ) override;
virtual void SAL_CALL setBlob( sal_Int32 parameterIndex, const css::uno::Reference< css::sdbc::XBlob >& x ) override;
virtual void SAL_CALL setClob( sal_Int32 parameterIndex, const css::uno::Reference< css::sdbc::XClob >& x ) override;
virtual void SAL_CALL setArray( sal_Int32 parameterIndex, const css::uno::Reference< css::sdbc::XArray >& x ) override;
virtual void SAL_CALL clearParameters( ) override;
// XCloseable
virtual void SAL_CALL close( ) override;
// XResultSetMetaDataSupplier
virtual css::uno::Reference< css::sdbc::XResultSetMetaData > SAL_CALL getMetaData( ) override;
// XMultipleResults
virtual css::uno::Reference< css::sdbc::XResultSet > SAL_CALL getResultSet( ) override;
virtual sal_Int32 SAL_CALL getUpdateCount( ) override;
virtual sal_Bool SAL_CALL getMoreResults( ) override;
};
}
+127 -127
View File
@@ -43,139 +43,139 @@
namespace connectivity::evoab
{
struct ComparisonData;
struct ComparisonData;
class OEvoabVersionHelper
class OEvoabVersionHelper
{
public:
virtual EBook* openBook(const char *abname) = 0;
virtual void executeQuery (EBook* pBook, EBookQuery* pQuery) = 0;
virtual void freeContacts() = 0;
virtual bool isLDAP( EBook *pBook ) = 0;
virtual bool isLocal( EBook *pBook ) = 0;
virtual EContact *getContact(sal_Int32 nIndex) = 0;
virtual sal_Int32 getNumContacts() = 0;
virtual bool hasContacts() = 0;
virtual void sortContacts( const ComparisonData& _rCompData ) = 0;
OString getUserName( EBook *pBook );
virtual ~OEvoabVersionHelper() {}
};
typedef ::cppu::WeakComponentImplHelper< css::sdbc::XResultSet
, css::sdbc::XRow
, css::sdbc::XResultSetMetaDataSupplier
, css::util::XCancellable
, css::sdbc::XWarningsSupplier
, css::sdbc::XCloseable
, css::sdbc::XColumnLocate
, css::lang::XServiceInfo
> OResultSet_BASE;
class OEvoabResultSet final : public cppu::BaseMutex
,public OResultSet_BASE
,public ::comphelper::OPropertyContainer
,public ::comphelper::OPropertyArrayUsageHelper<OEvoabResultSet>
{
private:
std::unique_ptr<OEvoabVersionHelper> m_pVersionHelper;
OCommonStatement* m_pStatement;
OEvoabConnection* m_pConnection;
rtl::Reference<OEvoabResultSetMetaData> m_xMetaData;
::dbtools::WarningsContainer m_aWarnings;
bool m_bWasNull;
// <properties>
sal_Int32 m_nFetchSize;
sal_Int32 m_nResultSetType;
sal_Int32 m_nFetchDirection;
sal_Int32 m_nResultSetConcurrency;
// </properties>
// Data & iteration
sal_Int32 m_nIndex;
sal_Int32 m_nLength;
EContact *getCur()
{
public:
virtual EBook* openBook(const char *abname) = 0;
virtual void executeQuery (EBook* pBook, EBookQuery* pQuery) = 0;
virtual void freeContacts() = 0;
virtual bool isLDAP( EBook *pBook ) = 0;
virtual bool isLocal( EBook *pBook ) = 0;
virtual EContact *getContact(sal_Int32 nIndex) = 0;
virtual sal_Int32 getNumContacts() = 0;
virtual bool hasContacts() = 0;
virtual void sortContacts( const ComparisonData& _rCompData ) = 0;
OString getUserName( EBook *pBook );
virtual ~OEvoabVersionHelper() {}
};
return m_pVersionHelper->getContact(m_nIndex);
}
typedef ::cppu::WeakComponentImplHelper< css::sdbc::XResultSet
, css::sdbc::XRow
, css::sdbc::XResultSetMetaDataSupplier
, css::util::XCancellable
, css::sdbc::XWarningsSupplier
, css::sdbc::XCloseable
, css::sdbc::XColumnLocate
, css::lang::XServiceInfo
> OResultSet_BASE;
// OPropertyArrayUsageHelper
virtual ::cppu::IPropertyArrayHelper* createArrayHelper( ) const override;
// OPropertySetHelper
virtual ::cppu::IPropertyArrayHelper & SAL_CALL getInfoHelper() override;
// you can't delete objects of this type
virtual ~OEvoabResultSet() override;
public:
DECLARE_SERVICE_INFO();
class OEvoabResultSet final : public cppu::BaseMutex
,public OResultSet_BASE
,public ::comphelper::OPropertyContainer
,public ::comphelper::OPropertyArrayUsageHelper<OEvoabResultSet>
{
private:
std::unique_ptr<OEvoabVersionHelper> m_pVersionHelper;
OEvoabResultSet( OCommonStatement *pStmt, OEvoabConnection *pConnection );
void construct( const QueryData& _rData );
OCommonStatement* m_pStatement;
OEvoabConnection* m_pConnection;
rtl::Reference<OEvoabResultSetMetaData> m_xMetaData;
::dbtools::WarningsContainer m_aWarnings;
bool m_bWasNull;
// <properties>
sal_Int32 m_nFetchSize;
sal_Int32 m_nResultSetType;
sal_Int32 m_nFetchDirection;
sal_Int32 m_nResultSetConcurrency;
// </properties>
// Data & iteration
sal_Int32 m_nIndex;
sal_Int32 m_nLength;
EContact *getCur()
{
return m_pVersionHelper->getContact(m_nIndex);
}
// OPropertyArrayUsageHelper
virtual ::cppu::IPropertyArrayHelper* createArrayHelper( ) const override;
// OPropertySetHelper
virtual ::cppu::IPropertyArrayHelper & SAL_CALL getInfoHelper() override;
// you can't delete objects of this type
virtual ~OEvoabResultSet() override;
public:
DECLARE_SERVICE_INFO();
OEvoabResultSet( OCommonStatement *pStmt, OEvoabConnection *pConnection );
void construct( const QueryData& _rData );
// ::cppu::OComponentHelper
virtual void SAL_CALL disposing() override;
// XInterface
virtual css::uno::Any SAL_CALL queryInterface( const css::uno::Type & rType ) override;
virtual void SAL_CALL acquire() noexcept override;
virtual void SAL_CALL release() noexcept override;
//XTypeProvider
virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes( ) override;
// XPropertySet
virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) override;
// XResultSet
virtual sal_Bool SAL_CALL next( ) override;
virtual sal_Bool SAL_CALL isBeforeFirst( ) override;
virtual sal_Bool SAL_CALL isAfterLast( ) override;
virtual sal_Bool SAL_CALL isFirst( ) override;
virtual sal_Bool SAL_CALL isLast( ) override;
virtual void SAL_CALL beforeFirst( ) override;
virtual void SAL_CALL afterLast( ) override;
virtual sal_Bool SAL_CALL first( ) override;
virtual sal_Bool SAL_CALL last( ) override;
virtual sal_Int32 SAL_CALL getRow( ) override;
virtual sal_Bool SAL_CALL absolute( sal_Int32 row ) override;
virtual sal_Bool SAL_CALL relative( sal_Int32 rows ) override;
virtual sal_Bool SAL_CALL previous( ) override;
virtual void SAL_CALL refreshRow( ) override;
virtual sal_Bool SAL_CALL rowUpdated( ) override;
virtual sal_Bool SAL_CALL rowInserted( ) override;
virtual sal_Bool SAL_CALL rowDeleted( ) override;
virtual css::uno::Reference< css::uno::XInterface > SAL_CALL getStatement( ) override;
// XRow
virtual sal_Bool SAL_CALL wasNull( ) override;
virtual OUString SAL_CALL getString( sal_Int32 columnIndex ) override;
virtual sal_Bool SAL_CALL getBoolean( sal_Int32 columnIndex ) override;
virtual sal_Int8 SAL_CALL getByte( sal_Int32 columnIndex ) override;
virtual sal_Int16 SAL_CALL getShort( sal_Int32 columnIndex ) override;
virtual sal_Int32 SAL_CALL getInt( sal_Int32 columnIndex ) override;
virtual sal_Int64 SAL_CALL getLong( sal_Int32 columnIndex ) override;
virtual float SAL_CALL getFloat( sal_Int32 columnIndex ) override;
virtual double SAL_CALL getDouble( sal_Int32 columnIndex ) override;
virtual css::uno::Sequence< sal_Int8 > SAL_CALL getBytes( sal_Int32 columnIndex ) override;
virtual css::util::Date SAL_CALL getDate( sal_Int32 columnIndex ) override;
virtual css::util::Time SAL_CALL getTime( sal_Int32 columnIndex ) override;
virtual css::util::DateTime SAL_CALL getTimestamp( sal_Int32 columnIndex ) override;
virtual css::uno::Reference< css::io::XInputStream > SAL_CALL getBinaryStream( sal_Int32 columnIndex ) override;
virtual css::uno::Reference< css::io::XInputStream > SAL_CALL getCharacterStream( sal_Int32 columnIndex ) override;
virtual css::uno::Any SAL_CALL getObject( sal_Int32 columnIndex, const css::uno::Reference< css::container::XNameAccess >& typeMap ) override;
virtual css::uno::Reference< css::sdbc::XRef > SAL_CALL getRef( sal_Int32 columnIndex ) override;
virtual css::uno::Reference< css::sdbc::XBlob > SAL_CALL getBlob( sal_Int32 columnIndex ) override;
virtual css::uno::Reference< css::sdbc::XClob > SAL_CALL getClob( sal_Int32 columnIndex ) override;
virtual css::uno::Reference< css::sdbc::XArray > SAL_CALL getArray( sal_Int32 columnIndex ) override;
// XCancellable
virtual void SAL_CALL cancel( ) override;
// XCloseable
virtual void SAL_CALL close( ) override;
// XResultSetMetaDataSupplier
virtual css::uno::Reference< css::sdbc::XResultSetMetaData > SAL_CALL getMetaData( ) override;
// XWarningsSupplier
virtual css::uno::Any SAL_CALL getWarnings( ) override;
virtual void SAL_CALL clearWarnings( ) override;
// XColumnLocate
virtual sal_Int32 SAL_CALL findColumn( const OUString& columnName ) override;
};
// ::cppu::OComponentHelper
virtual void SAL_CALL disposing() override;
// XInterface
virtual css::uno::Any SAL_CALL queryInterface( const css::uno::Type & rType ) override;
virtual void SAL_CALL acquire() noexcept override;
virtual void SAL_CALL release() noexcept override;
//XTypeProvider
virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes( ) override;
// XPropertySet
virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) override;
// XResultSet
virtual sal_Bool SAL_CALL next( ) override;
virtual sal_Bool SAL_CALL isBeforeFirst( ) override;
virtual sal_Bool SAL_CALL isAfterLast( ) override;
virtual sal_Bool SAL_CALL isFirst( ) override;
virtual sal_Bool SAL_CALL isLast( ) override;
virtual void SAL_CALL beforeFirst( ) override;
virtual void SAL_CALL afterLast( ) override;
virtual sal_Bool SAL_CALL first( ) override;
virtual sal_Bool SAL_CALL last( ) override;
virtual sal_Int32 SAL_CALL getRow( ) override;
virtual sal_Bool SAL_CALL absolute( sal_Int32 row ) override;
virtual sal_Bool SAL_CALL relative( sal_Int32 rows ) override;
virtual sal_Bool SAL_CALL previous( ) override;
virtual void SAL_CALL refreshRow( ) override;
virtual sal_Bool SAL_CALL rowUpdated( ) override;
virtual sal_Bool SAL_CALL rowInserted( ) override;
virtual sal_Bool SAL_CALL rowDeleted( ) override;
virtual css::uno::Reference< css::uno::XInterface > SAL_CALL getStatement( ) override;
// XRow
virtual sal_Bool SAL_CALL wasNull( ) override;
virtual OUString SAL_CALL getString( sal_Int32 columnIndex ) override;
virtual sal_Bool SAL_CALL getBoolean( sal_Int32 columnIndex ) override;
virtual sal_Int8 SAL_CALL getByte( sal_Int32 columnIndex ) override;
virtual sal_Int16 SAL_CALL getShort( sal_Int32 columnIndex ) override;
virtual sal_Int32 SAL_CALL getInt( sal_Int32 columnIndex ) override;
virtual sal_Int64 SAL_CALL getLong( sal_Int32 columnIndex ) override;
virtual float SAL_CALL getFloat( sal_Int32 columnIndex ) override;
virtual double SAL_CALL getDouble( sal_Int32 columnIndex ) override;
virtual css::uno::Sequence< sal_Int8 > SAL_CALL getBytes( sal_Int32 columnIndex ) override;
virtual css::util::Date SAL_CALL getDate( sal_Int32 columnIndex ) override;
virtual css::util::Time SAL_CALL getTime( sal_Int32 columnIndex ) override;
virtual css::util::DateTime SAL_CALL getTimestamp( sal_Int32 columnIndex ) override;
virtual css::uno::Reference< css::io::XInputStream > SAL_CALL getBinaryStream( sal_Int32 columnIndex ) override;
virtual css::uno::Reference< css::io::XInputStream > SAL_CALL getCharacterStream( sal_Int32 columnIndex ) override;
virtual css::uno::Any SAL_CALL getObject( sal_Int32 columnIndex, const css::uno::Reference< css::container::XNameAccess >& typeMap ) override;
virtual css::uno::Reference< css::sdbc::XRef > SAL_CALL getRef( sal_Int32 columnIndex ) override;
virtual css::uno::Reference< css::sdbc::XBlob > SAL_CALL getBlob( sal_Int32 columnIndex ) override;
virtual css::uno::Reference< css::sdbc::XClob > SAL_CALL getClob( sal_Int32 columnIndex ) override;
virtual css::uno::Reference< css::sdbc::XArray > SAL_CALL getArray( sal_Int32 columnIndex ) override;
// XCancellable
virtual void SAL_CALL cancel( ) override;
// XCloseable
virtual void SAL_CALL close( ) override;
// XResultSetMetaDataSupplier
virtual css::uno::Reference< css::sdbc::XResultSetMetaData > SAL_CALL getMetaData( ) override;
// XWarningsSupplier
virtual css::uno::Any SAL_CALL getWarnings( ) override;
virtual void SAL_CALL clearWarnings( ) override;
// XColumnLocate
virtual sal_Int32 SAL_CALL findColumn( const OUString& columnName ) override;
};
}
+212 -212
View File
@@ -45,231 +45,231 @@
namespace connectivity::evoab
{
class OEvoabResultSet;
class OEvoabResultSet;
typedef ::cppu::WeakComponentImplHelper< css::sdbc::XWarningsSupplier
, css::sdbc::XCloseable
> OCommonStatement_IBase;
typedef ::cppu::WeakComponentImplHelper< css::sdbc::XWarningsSupplier
, css::sdbc::XCloseable
> OCommonStatement_IBase;
struct FieldSort
struct FieldSort
{
sal_Int32 nField;
bool bAscending;
FieldSort( const sal_Int32 _nField, const bool _bAscending ) : nField( _nField ), bAscending( _bAscending ) { }
};
typedef std::vector< FieldSort > SortDescriptor;
enum QueryFilterType
{
eFilterAlwaysFalse,
eFilterNone,
eFilterOther
};
class EBookQueryWrapper
{
private:
EBookQuery* mpQuery;
public:
EBookQueryWrapper()
: mpQuery(nullptr)
{
sal_Int32 nField;
bool bAscending;
FieldSort( const sal_Int32 _nField, const bool _bAscending ) : nField( _nField ), bAscending( _bAscending ) { }
};
typedef std::vector< FieldSort > SortDescriptor;
enum QueryFilterType
}
EBookQueryWrapper(const EBookQueryWrapper& rhs)
: mpQuery(rhs.mpQuery)
{
eFilterAlwaysFalse,
eFilterNone,
eFilterOther
};
class EBookQueryWrapper
if (mpQuery)
e_book_query_ref(mpQuery);
}
EBookQueryWrapper(EBookQueryWrapper&& rhs) noexcept
: mpQuery(rhs.mpQuery)
{
private:
EBookQuery* mpQuery;
public:
EBookQueryWrapper()
: mpQuery(nullptr)
{
}
EBookQueryWrapper(const EBookQueryWrapper& rhs)
: mpQuery(rhs.mpQuery)
{
if (mpQuery)
e_book_query_ref(mpQuery);
}
EBookQueryWrapper(EBookQueryWrapper&& rhs) noexcept
: mpQuery(rhs.mpQuery)
{
rhs.mpQuery = nullptr;
}
void reset(EBookQuery* pQuery)
{
if (mpQuery)
e_book_query_unref(mpQuery);
mpQuery = pQuery;
if (mpQuery)
e_book_query_ref(mpQuery);
}
EBookQueryWrapper& operator=(const EBookQueryWrapper& rhs)
{
if (this != &rhs)
reset(rhs.mpQuery);
return *this;
}
EBookQueryWrapper& operator=(EBookQueryWrapper&& rhs)
{
if (mpQuery)
e_book_query_unref(mpQuery);
mpQuery = rhs.mpQuery;
rhs.mpQuery = nullptr;
return *this;
}
~EBookQueryWrapper()
{
if (mpQuery)
e_book_query_unref(mpQuery);
}
EBookQuery* getQuery() const
{
return mpQuery;
}
};
struct QueryData
rhs.mpQuery = nullptr;
}
void reset(EBookQuery* pQuery)
{
private:
EBookQueryWrapper aQuery;
public:
OUString sTable;
QueryFilterType eFilterType;
rtl::Reference<connectivity::OSQLColumns> xSelectColumns;
SortDescriptor aSortOrder;
QueryData()
: sTable()
, eFilterType( eFilterOther )
, xSelectColumns()
, aSortOrder()
{
}
EBookQuery* getQuery() const { return aQuery.getQuery(); }
void setQuery(EBookQuery* pQuery) { aQuery.reset(pQuery); }
};
//************ Class: OCommonStatement
// is a base class for the normal statement and for the prepared statement
class OCommonStatement :public cppu::BaseMutex
,public OCommonStatement_IBase
,public ::comphelper::OPropertyContainer
,public ::comphelper::OPropertyArrayUsageHelper< OCommonStatement >
if (mpQuery)
e_book_query_unref(mpQuery);
mpQuery = pQuery;
if (mpQuery)
e_book_query_ref(mpQuery);
}
EBookQueryWrapper& operator=(const EBookQueryWrapper& rhs)
{
private:
unotools::WeakReference< OEvoabResultSet> m_xResultSet; // The last ResultSet created
rtl::Reference<OEvoabConnection> m_xConnection;
connectivity::OSQLParser m_aParser;
connectivity::OSQLParseTreeIterator m_aSQLIterator;
connectivity::OSQLParseNode *m_pParseTree;
// <properties>
OUString m_aCursorName;
sal_Int32 m_nMaxFieldSize;
sal_Int32 m_nMaxRows;
sal_Int32 m_nQueryTimeOut;
sal_Int32 m_nFetchSize;
sal_Int32 m_nResultSetType;
sal_Int32 m_nFetchDirection;
sal_Int32 m_nResultSetConcurrency;
bool m_bEscapeProcessing;
// </properties>
protected:
void disposeResultSet();
// OPropertyArrayUsageHelper
virtual ::cppu::IPropertyArrayHelper* createArrayHelper() const override;
// OPropertySetHelper
virtual ::cppu::IPropertyArrayHelper & SAL_CALL getInfoHelper() override;
virtual ~OCommonStatement() override;
protected:
void parseSql( const OUString& sql, QueryData& _out_rQueryData );
EBookQuery *whereAnalysis( const OSQLParseNode* parseTree );
void orderByAnalysis( const OSQLParseNode* _pOrderByClause, SortDescriptor& _out_rSort );
OUString getTableName() const;
public:
// other methods
OEvoabConnection* getOwnConnection() const { return m_xConnection.get(); }
using OCommonStatement_IBase::operator css::uno::Reference< css::uno::XInterface >;
protected:
explicit OCommonStatement( OEvoabConnection* _pConnection );
// OComponentHelper
virtual void SAL_CALL disposing() override;
// XInterface
virtual void SAL_CALL release() noexcept override;
virtual void SAL_CALL acquire() noexcept override;
// XInterface
virtual css::uno::Any SAL_CALL queryInterface( const css::uno::Type & rType ) override;
//XTypeProvider
virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes( ) override;
// XPropertySet
virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) override;
// XWarningsSupplier
virtual css::uno::Any SAL_CALL getWarnings( ) override;
virtual void SAL_CALL clearWarnings( ) override;
// XCloseable
virtual void SAL_CALL close( ) override;
protected:
/** will return the EBookQuery representing the statement WHERE condition, or throw
Also, all statement dependent members (such as the parser/iterator) will be inited afterwards.
*/
QueryData
impl_getEBookQuery_throw( const OUString& _rSql );
css::uno::Reference< css::sdbc::XResultSet >
impl_executeQuery_throw( const OUString& _rSql );
css::uno::Reference< css::sdbc::XResultSet >
impl_executeQuery_throw( const QueryData& _rData );
css::uno::Reference< css::sdbc::XConnection >
impl_getConnection() { return css::uno::Reference< css::sdbc::XConnection >( m_xConnection ); }
OUString
impl_getColumnRefColumnName_throw( const ::connectivity::OSQLParseNode& _rColumnRef );
};
typedef ::cppu::ImplHelper2 < css::lang::XServiceInfo
, css::sdbc::XStatement
> OStatement_IBase;
class OStatement :public OCommonStatement
,public OStatement_IBase
if (this != &rhs)
reset(rhs.mpQuery);
return *this;
}
EBookQueryWrapper& operator=(EBookQueryWrapper&& rhs)
{
protected:
virtual ~OStatement() override {}
if (mpQuery)
e_book_query_unref(mpQuery);
mpQuery = rhs.mpQuery;
rhs.mpQuery = nullptr;
return *this;
}
~EBookQueryWrapper()
{
if (mpQuery)
e_book_query_unref(mpQuery);
}
EBookQuery* getQuery() const
{
return mpQuery;
}
};
public:
explicit OStatement( OEvoabConnection* _pConnection)
:OCommonStatement( _pConnection)
{
}
struct QueryData
{
private:
EBookQueryWrapper aQuery;
// XInterface
virtual css::uno::Any SAL_CALL queryInterface( const css::uno::Type & rType ) override;
virtual void SAL_CALL acquire() noexcept override;
virtual void SAL_CALL release() noexcept override;
public:
OUString sTable;
QueryFilterType eFilterType;
rtl::Reference<connectivity::OSQLColumns> xSelectColumns;
SortDescriptor aSortOrder;
// XTypeProvider
DECLARE_XTYPEPROVIDER()
QueryData()
: sTable()
, eFilterType( eFilterOther )
, xSelectColumns()
, aSortOrder()
{
}
// XServiceInfo
DECLARE_SERVICE_INFO();
EBookQuery* getQuery() const { return aQuery.getQuery(); }
void setQuery(EBookQuery* pQuery) { aQuery.reset(pQuery); }
};
// XStatement
virtual css::uno::Reference< css::sdbc::XResultSet > SAL_CALL executeQuery( const OUString& sql ) override ;
virtual sal_Int32 SAL_CALL executeUpdate( const OUString& sql ) override ;
virtual sal_Bool SAL_CALL execute( const OUString& sql ) override ;
virtual css::uno::Reference< css::sdbc::XConnection > SAL_CALL getConnection( ) override ;
};
//************ Class: OCommonStatement
// is a base class for the normal statement and for the prepared statement
class OCommonStatement :public cppu::BaseMutex
,public OCommonStatement_IBase
,public ::comphelper::OPropertyContainer
,public ::comphelper::OPropertyArrayUsageHelper< OCommonStatement >
{
private:
unotools::WeakReference< OEvoabResultSet> m_xResultSet; // The last ResultSet created
rtl::Reference<OEvoabConnection> m_xConnection;
connectivity::OSQLParser m_aParser;
connectivity::OSQLParseTreeIterator m_aSQLIterator;
connectivity::OSQLParseNode *m_pParseTree;
// <properties>
OUString m_aCursorName;
sal_Int32 m_nMaxFieldSize;
sal_Int32 m_nMaxRows;
sal_Int32 m_nQueryTimeOut;
sal_Int32 m_nFetchSize;
sal_Int32 m_nResultSetType;
sal_Int32 m_nFetchDirection;
sal_Int32 m_nResultSetConcurrency;
bool m_bEscapeProcessing;
// </properties>
protected:
void disposeResultSet();
// OPropertyArrayUsageHelper
virtual ::cppu::IPropertyArrayHelper* createArrayHelper() const override;
// OPropertySetHelper
virtual ::cppu::IPropertyArrayHelper & SAL_CALL getInfoHelper() override;
virtual ~OCommonStatement() override;
protected:
void parseSql( const OUString& sql, QueryData& _out_rQueryData );
EBookQuery *whereAnalysis( const OSQLParseNode* parseTree );
void orderByAnalysis( const OSQLParseNode* _pOrderByClause, SortDescriptor& _out_rSort );
OUString getTableName() const;
public:
// other methods
OEvoabConnection* getOwnConnection() const { return m_xConnection.get(); }
using OCommonStatement_IBase::operator css::uno::Reference< css::uno::XInterface >;
protected:
explicit OCommonStatement( OEvoabConnection* _pConnection );
// OComponentHelper
virtual void SAL_CALL disposing() override;
// XInterface
virtual void SAL_CALL release() noexcept override;
virtual void SAL_CALL acquire() noexcept override;
// XInterface
virtual css::uno::Any SAL_CALL queryInterface( const css::uno::Type & rType ) override;
//XTypeProvider
virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes( ) override;
// XPropertySet
virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) override;
// XWarningsSupplier
virtual css::uno::Any SAL_CALL getWarnings( ) override;
virtual void SAL_CALL clearWarnings( ) override;
// XCloseable
virtual void SAL_CALL close( ) override;
protected:
/** will return the EBookQuery representing the statement WHERE condition, or throw
Also, all statement dependent members (such as the parser/iterator) will be inited afterwards.
*/
QueryData
impl_getEBookQuery_throw( const OUString& _rSql );
css::uno::Reference< css::sdbc::XResultSet >
impl_executeQuery_throw( const OUString& _rSql );
css::uno::Reference< css::sdbc::XResultSet >
impl_executeQuery_throw( const QueryData& _rData );
css::uno::Reference< css::sdbc::XConnection >
impl_getConnection() { return css::uno::Reference< css::sdbc::XConnection >( m_xConnection ); }
OUString
impl_getColumnRefColumnName_throw( const ::connectivity::OSQLParseNode& _rColumnRef );
};
typedef ::cppu::ImplHelper2 < css::lang::XServiceInfo
, css::sdbc::XStatement
> OStatement_IBase;
class OStatement :public OCommonStatement
,public OStatement_IBase
{
protected:
virtual ~OStatement() override {}
public:
explicit OStatement( OEvoabConnection* _pConnection)
:OCommonStatement( _pConnection)
{
}
// XInterface
virtual css::uno::Any SAL_CALL queryInterface( const css::uno::Type & rType ) override;
virtual void SAL_CALL acquire() noexcept override;
virtual void SAL_CALL release() noexcept override;
// XTypeProvider
DECLARE_XTYPEPROVIDER()
// XServiceInfo
DECLARE_SERVICE_INFO();
// XStatement
virtual css::uno::Reference< css::sdbc::XResultSet > SAL_CALL executeQuery( const OUString& sql ) override ;
virtual sal_Int32 SAL_CALL executeUpdate( const OUString& sql ) override ;
virtual sal_Bool SAL_CALL execute( const OUString& sql ) override ;
virtual css::uno::Reference< css::sdbc::XConnection > SAL_CALL getConnection( ) override ;
};
}
+18 -18
View File
@@ -24,29 +24,29 @@
namespace connectivity::evoab
{
typedef connectivity::sdbcx::OTable OEvoabTable_TYPEDEF;
typedef connectivity::sdbcx::OTable OEvoabTable_TYPEDEF;
class OEvoabTable : public OEvoabTable_TYPEDEF
{
OEvoabConnection* m_pConnection;
class OEvoabTable : public OEvoabTable_TYPEDEF
{
OEvoabConnection* m_pConnection;
public:
OEvoabTable( sdbcx::OCollection* _pTables,
OEvoabConnection* _pConnection,
const OUString& Name,
const OUString& Type,
const OUString& Description,
const OUString& SchemaName,
const OUString& CatalogName
);
public:
OEvoabTable( sdbcx::OCollection* _pTables,
OEvoabConnection* _pConnection,
const OUString& Name,
const OUString& Type,
const OUString& Description,
const OUString& SchemaName,
const OUString& CatalogName
);
OEvoabConnection* getConnection() { return m_pConnection;}
OEvoabConnection* getConnection() { return m_pConnection;}
virtual void refreshColumns() override;
virtual void refreshColumns() override;
OUString const & getTableName() const { return m_Name; }
OUString const & getSchema() const { return m_SchemaName; }
};
OUString const & getTableName() const { return m_Name; }
OUString const & getSchema() const { return m_SchemaName; }
};
}
+15 -15
View File
@@ -24,21 +24,21 @@
namespace connectivity::evoab
{
class OEvoabTables : public sdbcx::OCollection
{
css::uno::Reference< css::sdbc::XDatabaseMetaData > m_xMetaData;
protected:
virtual css::uno::Reference< css::beans::XPropertySet > createObject(const OUString& _rName) override;
virtual void impl_refresh() override;
public:
OEvoabTables(css::uno::Reference< css::sdbc::XDatabaseMetaData > _xMetaData,
::cppu::OWeakObject& _rParent, ::osl::Mutex& _rMutex,
const ::std::vector< OUString> &_rVector) :
sdbcx::OCollection(_rParent,true,_rMutex,_rVector),
m_xMetaData(std::move(_xMetaData))
{}
virtual void disposing() override;
};
class OEvoabTables : public sdbcx::OCollection
{
css::uno::Reference< css::sdbc::XDatabaseMetaData > m_xMetaData;
protected:
virtual css::uno::Reference< css::beans::XPropertySet > createObject(const OUString& _rName) override;
virtual void impl_refresh() override;
public:
OEvoabTables(css::uno::Reference< css::sdbc::XDatabaseMetaData > _xMetaData,
::cppu::OWeakObject& _rParent, ::osl::Mutex& _rMutex,
const ::std::vector< OUString> &_rVector) :
sdbcx::OCollection(_rParent,true,_rMutex,_rVector),
m_xMetaData(std::move(_xMetaData))
{}
virtual void disposing() override;
};
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+65 -65
View File
@@ -19,81 +19,81 @@
#include <vector>
namespace connectivity::firebird
{
typedef ::cppu::WeakComponentImplHelper< css::sdbc::XBlob,
css::io::XInputStream >
Blob_BASE;
class Blob :
public Blob_BASE
{
typedef ::cppu::WeakComponentImplHelper< css::sdbc::XBlob,
css::io::XInputStream >
Blob_BASE;
protected:
::osl::Mutex m_aMutex;
class Blob :
public Blob_BASE
{
protected:
::osl::Mutex m_aMutex;
isc_db_handle* m_pDatabaseHandle;
isc_tr_handle* m_pTransactionHandle;
// We store our own copy of the blob id as typically the statement
// manages its own blob id, and blobs are independent of a statement
// in firebird.
ISC_QUAD m_blobID;
isc_blob_handle m_blobHandle;
isc_db_handle* m_pDatabaseHandle;
isc_tr_handle* m_pTransactionHandle;
// We store our own copy of the blob id as typically the statement
// manages its own blob id, and blobs are independent of a statement
// in firebird.
ISC_QUAD m_blobID;
isc_blob_handle m_blobHandle;
bool m_bBlobOpened;
sal_Int64 m_nBlobLength;
sal_uInt16 m_nMaxSegmentSize;
sal_Int64 m_nBlobPosition;
bool m_bBlobOpened;
sal_Int64 m_nBlobLength;
sal_uInt16 m_nMaxSegmentSize;
sal_Int64 m_nBlobPosition;
ISC_STATUS_ARRAY m_statusVector;
ISC_STATUS_ARRAY m_statusVector;
/// @throws css::sdbc::SQLException
void ensureBlobIsOpened();
/**
* Closes the blob and cleans up resources -- can be used to reset
* the blob if we e.g. want to read from the beginning again.
*
* @throws css::sdbc::SQLException
*/
void closeBlob();
sal_uInt16 getMaximumSegmentSize();
/// @throws css::sdbc::SQLException
void ensureBlobIsOpened();
/**
* Closes the blob and cleans up resources -- can be used to reset
* the blob if we e.g. want to read from the beginning again.
*
* @throws css::sdbc::SQLException
*/
void closeBlob();
sal_uInt16 getMaximumSegmentSize();
public:
Blob(isc_db_handle* pDatabaseHandle,
isc_tr_handle* pTransactionHandle,
ISC_QUAD const & aBlobID);
public:
Blob(isc_db_handle* pDatabaseHandle,
isc_tr_handle* pTransactionHandle,
ISC_QUAD const & aBlobID);
bool readOneSegment(std::vector<char>& rDataOut);
bool readOneSegment(std::vector<char>& rDataOut);
// ---- XBlob ----------------------------------------------------
virtual sal_Int64 SAL_CALL
length() override;
virtual css::uno::Sequence< sal_Int8 > SAL_CALL
getBytes(sal_Int64 aPosition, sal_Int32 aLength) override;
virtual css::uno::Reference< css::io::XInputStream > SAL_CALL
getBinaryStream() override;
virtual sal_Int64 SAL_CALL
position(const css::uno::Sequence< sal_Int8 >& rPattern,
sal_Int64 aStart) override;
virtual sal_Int64 SAL_CALL
positionOfBlob(const css::uno::Reference< css::sdbc::XBlob >& rPattern,
sal_Int64 aStart) override;
// ---- XBlob ----------------------------------------------------
virtual sal_Int64 SAL_CALL
length() override;
virtual css::uno::Sequence< sal_Int8 > SAL_CALL
getBytes(sal_Int64 aPosition, sal_Int32 aLength) override;
virtual css::uno::Reference< css::io::XInputStream > SAL_CALL
getBinaryStream() override;
virtual sal_Int64 SAL_CALL
position(const css::uno::Sequence< sal_Int8 >& rPattern,
sal_Int64 aStart) override;
virtual sal_Int64 SAL_CALL
positionOfBlob(const css::uno::Reference< css::sdbc::XBlob >& rPattern,
sal_Int64 aStart) override;
// ---- XInputStream ----------------------------------------------
virtual sal_Int32 SAL_CALL
readBytes(css::uno::Sequence< sal_Int8 >& rDataOut,
sal_Int32 nBytes) override;
virtual sal_Int32 SAL_CALL
readSomeBytes(css::uno::Sequence< sal_Int8 >& rDataOut,
sal_Int32 nMaximumBytes) override;
virtual void SAL_CALL
skipBytes(sal_Int32 nBytes) override;
virtual sal_Int32 SAL_CALL
available() override;
virtual void SAL_CALL
closeInput() override;
// ---- XInputStream ----------------------------------------------
virtual sal_Int32 SAL_CALL
readBytes(css::uno::Sequence< sal_Int8 >& rDataOut,
sal_Int32 nBytes) override;
virtual sal_Int32 SAL_CALL
readSomeBytes(css::uno::Sequence< sal_Int8 >& rDataOut,
sal_Int32 nMaximumBytes) override;
virtual void SAL_CALL
skipBytes(sal_Int32 nBytes) override;
virtual sal_Int32 SAL_CALL
available() override;
virtual void SAL_CALL
closeInput() override;
// ---- OComponentHelper ------------------------------------------
virtual void SAL_CALL disposing() override;
};
// ---- OComponentHelper ------------------------------------------
virtual void SAL_CALL disposing() override;
};
}
@@ -12,28 +12,28 @@
#include <sdbcx/VCatalog.hxx>
namespace connectivity::firebird
{
class Catalog: public ::connectivity::sdbcx::OCatalog
{
class Catalog: public ::connectivity::sdbcx::OCatalog
{
css::uno::Reference< css::sdbc::XConnection >
m_xConnection;
css::uno::Reference< css::sdbc::XConnection >
m_xConnection;
public:
explicit Catalog(const css::uno::Reference< css::sdbc::XConnection >& rConnection);
public:
explicit Catalog(const css::uno::Reference< css::sdbc::XConnection >& rConnection);
// OCatalog
virtual void refreshTables() override;
virtual void refreshViews() override;
// OCatalog
virtual void refreshTables() override;
virtual void refreshViews() override;
// IRefreshableGroups
virtual void refreshGroups() override;
// IRefreshableGroups
virtual void refreshGroups() override;
// IRefreshableUsers
virtual void refreshUsers() override;
// IRefreshableUsers
virtual void refreshUsers() override;
sdbcx::OCollection* getPrivateTables() const { return m_pTables.get(); }
sdbcx::OCollection* getPrivateViews() const { return m_pViews.get(); }
};
sdbcx::OCollection* getPrivateTables() const { return m_pTables.get(); }
sdbcx::OCollection* getPrivateViews() const { return m_pViews.get(); }
};
} // namespace connectivity::firebird
+35 -35
View File
@@ -18,46 +18,46 @@
#include <rtl/ref.hxx>
namespace connectivity::firebird
{
typedef ::cppu::WeakComponentImplHelper< css::sdbc::XClob >
Clob_BASE;
class Clob :
public Clob_BASE
{
typedef ::cppu::WeakComponentImplHelper< css::sdbc::XClob >
Clob_BASE;
protected:
::osl::Mutex m_aMutex;
class Clob :
public Clob_BASE
{
protected:
::osl::Mutex m_aMutex;
/*
* In Firebird Clob (textual Blob) is a subtype of blob,
* hence we store the data in a Blob, and the Clob class is
* a wrapper around that.
*/
rtl::Reference<connectivity::firebird::Blob> m_aBlob;
/*
* In Firebird Clob (textual Blob) is a subtype of blob,
* hence we store the data in a Blob, and the Clob class is
* a wrapper around that.
*/
rtl::Reference<connectivity::firebird::Blob> m_aBlob;
sal_Int64 m_nCharCount;
sal_Int64 m_nCharCount;
public:
Clob(isc_db_handle* pDatabaseHandle,
isc_tr_handle* pTransactionHandle,
ISC_QUAD const & aBlobID);
public:
Clob(isc_db_handle* pDatabaseHandle,
isc_tr_handle* pTransactionHandle,
ISC_QUAD const & aBlobID);
// ---- XClob ----------------------------------------------------
virtual sal_Int64 SAL_CALL
length() override;
virtual OUString SAL_CALL
getSubString(sal_Int64 aPosition, sal_Int32 aLength) override;
virtual css::uno::Reference< css::io::XInputStream > SAL_CALL
getCharacterStream() override;
virtual sal_Int64 SAL_CALL
position(const OUString& rPattern,
sal_Int32 aStart) override;
virtual sal_Int64 SAL_CALL
positionOfClob(const ::css::uno::Reference< ::css::sdbc::XClob >& rPattern,
sal_Int64 aStart) override;
// ---- OComponentHelper ------------------------------------------
virtual void SAL_CALL disposing() override;
};
// ---- XClob ----------------------------------------------------
virtual sal_Int64 SAL_CALL
length() override;
virtual OUString SAL_CALL
getSubString(sal_Int64 aPosition, sal_Int32 aLength) override;
virtual css::uno::Reference< css::io::XInputStream > SAL_CALL
getCharacterStream() override;
virtual sal_Int64 SAL_CALL
position(const OUString& rPattern,
sal_Int32 aStart) override;
virtual sal_Int64 SAL_CALL
positionOfClob(const ::css::uno::Reference< ::css::sdbc::XClob >& rPattern,
sal_Int64 aStart) override;
// ---- OComponentHelper ------------------------------------------
virtual void SAL_CALL disposing() override;
};
}
+14 -14
View File
@@ -11,21 +11,21 @@
#include <connectivity/sdbcx/VColumn.hxx>
namespace connectivity::firebird
{
class Column;
typedef ::comphelper::OIdPropertyArrayUsageHelper<Column> Column_PROP;
class Column : public sdbcx::OColumn,
public Column_PROP
{
class Column;
typedef ::comphelper::OIdPropertyArrayUsageHelper<Column> Column_PROP;
class Column : public sdbcx::OColumn,
public Column_PROP
{
OUString m_sAutoIncrement;
protected:
virtual ::cppu::IPropertyArrayHelper* createArrayHelper( sal_Int32 _nId) const override;
virtual ::cppu::IPropertyArrayHelper & SAL_CALL getInfoHelper() override;
public:
Column();
virtual void construct() override;
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames( ) override;
};
OUString m_sAutoIncrement;
protected:
virtual ::cppu::IPropertyArrayHelper* createArrayHelper( sal_Int32 _nId) const override;
virtual ::cppu::IPropertyArrayHelper & SAL_CALL getInfoHelper() override;
public:
Column();
virtual void construct() override;
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames( ) override;
};
}
@@ -15,15 +15,15 @@
namespace connectivity::firebird
{
class Columns: public ::connectivity::OColumnsHelper
{
protected:
virtual css::uno::Reference< css::beans::XPropertySet > createDescriptor() override;
public:
Columns(Table& rTable,
::osl::Mutex& rMutex,
const ::std::vector< OUString> &_rVector);
};
class Columns: public ::connectivity::OColumnsHelper
{
protected:
virtual css::uno::Reference< css::beans::XPropertySet > createDescriptor() override;
public:
Columns(Table& rTable,
::osl::Mutex& rMutex,
const ::std::vector< OUString> &_rVector);
};
} // namespace connectivity::firebird
@@ -42,200 +42,200 @@
#include <com/sun/star/util/XModifiable.hpp>
namespace connectivity::firebird
{
typedef ::cppu::WeakComponentImplHelper< css::document::XDocumentEventListener,
css::lang::XServiceInfo,
css::lang::XUnoTunnel,
css::sdbc::XConnection,
css::sdbc::XWarningsSupplier
> Connection_BASE;
class OStatementCommonBase;
class FirebirdDriver;
class ODatabaseMetaData;
typedef std::vector< ::connectivity::OTypeInfo> TTypeInfoVector;
typedef std::vector< css::uno::WeakReferenceHelper > OWeakRefArray;
class Connection final : public Connection_BASE
{
::osl::Mutex m_aMutex;
typedef ::cppu::WeakComponentImplHelper< css::document::XDocumentEventListener,
css::lang::XServiceInfo,
css::lang::XUnoTunnel,
css::sdbc::XConnection,
css::sdbc::XWarningsSupplier
> Connection_BASE;
TTypeInfoVector m_aTypeInfo; // vector containing an entry
// for each row returned by
// DatabaseMetaData.getTypeInfo.
class OStatementCommonBase;
class FirebirdDriver;
class ODatabaseMetaData;
/** The URL passed to us when opening, i.e. of the form sdbc:* */
OUString m_sConnectionURL;
/**
* The URL passed to firebird, i.e. either a local file (for a
* temporary .fdb extracted from a .odb or a normal local file) or
* a remote url.
*/
OUString m_sFirebirdURL;
/* EMBEDDED MODE DATA */
/** Denotes that we have a database stored within a .odb file. */
bool m_bIsEmbedded;
typedef std::vector< ::connectivity::OTypeInfo> TTypeInfoVector;
typedef std::vector< css::uno::WeakReferenceHelper > OWeakRefArray;
/**
* Handle for the parent DatabaseDocument. We need to notify this
* whenever any data is written to our temporary database so that
* the user is able to save this back to the .odb file.
*
* Note that this is ONLY set in embedded mode.
*/
css::uno::Reference< css::util::XModifiable >
m_xParentDocument;
class Connection final : public Connection_BASE
{
::osl::Mutex m_aMutex;
/**
* Handle for the folder within the .odb where we store our .fbk
* (Only used if m_bIsEmbedded is true).
*/
css::uno::Reference< css::embed::XStorage >
m_xEmbeddedStorage;
/**
* The temporary folder where we extract the .fbk from a .odb,
* and also store the temporary .fdb
* It is only valid if m_bIsEmbedded is true.
*
* The extracted .fbk is written in firebird.fbk, the temporary
* .fdb is stored as firebird.fdb.
*/
std::unique_ptr< ::utl::TempFileNamed > m_pDatabaseFileDir;
/**
* Path for our extracted .fbk file.
*
* (The temporary .fdb is our m_sFirebirdURL.)
*/
OUString m_sFBKPath;
TTypeInfoVector m_aTypeInfo; // vector containing an entry
// for each row returned by
// DatabaseMetaData.getTypeInfo.
void loadDatabaseFile(const OUString& pSrcLocation, const OUString& pTmpLocation);
/** The URL passed to us when opening, i.e. of the form sdbc:* */
OUString m_sConnectionURL;
/**
* The URL passed to firebird, i.e. either a local file (for a
* temporary .fdb extracted from a .odb or a normal local file) or
* a remote url.
*/
OUString m_sFirebirdURL;
/**
* Run the backup service, use nAction =
* isc_action_svc_backup to backup, nAction = isc_action_svc_restore
* to restore.
*/
void runBackupService(const short nAction);
/* EMBEDDED MODE DATA */
/** Denotes that we have a database stored within a .odb file. */
bool m_bIsEmbedded;
isc_svc_handle attachServiceManager();
/**
* Handle for the parent DatabaseDocument. We need to notify this
* whenever any data is written to our temporary database so that
* the user is able to save this back to the .odb file.
*
* Note that this is ONLY set in embedded mode.
*/
css::uno::Reference< css::util::XModifiable >
m_xParentDocument;
void detachServiceManager(isc_svc_handle pServiceHandle);
/**
* Handle for the folder within the .odb where we store our .fbk
* (Only used if m_bIsEmbedded is true).
*/
css::uno::Reference< css::embed::XStorage >
m_xEmbeddedStorage;
/**
* The temporary folder where we extract the .fbk from a .odb,
* and also store the temporary .fdb
* It is only valid if m_bIsEmbedded is true.
*
* The extracted .fbk is written in firebird.fbk, the temporary
* .fdb is stored as firebird.fdb.
*/
std::unique_ptr< ::utl::TempFileNamed > m_pDatabaseFileDir;
/**
* Path for our extracted .fbk file.
*
* (The temporary .fdb is our m_sFirebirdURL.)
*/
OUString m_sFBKPath;
/** We are using an external (local) file */
bool m_bIsFile;
void loadDatabaseFile(const OUString& pSrcLocation, const OUString& pTmpLocation);
/* CONNECTION PROPERTIES */
bool m_bIsAutoCommit;
bool m_bIsReadOnly;
sal_Int32 m_aTransactionIsolation;
/**
* Run the backup service, use nAction =
* isc_action_svc_backup to backup, nAction = isc_action_svc_restore
* to restore.
*/
void runBackupService(const short nAction);
isc_db_handle m_aDBHandle;
isc_tr_handle m_aTransactionHandle;
isc_svc_handle attachServiceManager();
css::uno::WeakReference< css::sdbcx::XTablesSupplier>
m_xCatalog;
css::uno::WeakReference< css::sdbc::XDatabaseMetaData >
m_xMetaData;
/** Statements owned by this connection. */
OWeakRefArray m_aStatements;
void detachServiceManager(isc_svc_handle pServiceHandle);
/// @throws css::sdbc::SQLException
void buildTypeInfo();
/** We are using an external (local) file */
bool m_bIsFile;
/**
* Creates a new transaction with the desired parameters, if
* necessary discarding an existing transaction. This has to be done
* anytime we change the transaction isolation, or autocommitting.
*
* @throws css::sdbc::SQLException
*/
void setupTransaction();
void disposeStatements();
/* CONNECTION PROPERTIES */
bool m_bIsAutoCommit;
bool m_bIsReadOnly;
sal_Int32 m_aTransactionIsolation;
public:
explicit Connection();
virtual ~Connection() override;
isc_db_handle m_aDBHandle;
isc_tr_handle m_aTransactionHandle;
/// @throws css::sdbc::SQLException
/// @throws css::uno::RuntimeException
void construct( const OUString& url,
const css::uno::Sequence< css::beans::PropertyValue >& info);
css::uno::WeakReference< css::sdbcx::XTablesSupplier>
m_xCatalog;
css::uno::WeakReference< css::sdbc::XDatabaseMetaData >
m_xMetaData;
/** Statements owned by this connection. */
OWeakRefArray m_aStatements;
const OUString& getConnectionURL() const {return m_sConnectionURL;}
bool isEmbedded() const {return m_bIsEmbedded;}
isc_db_handle& getDBHandle() {return m_aDBHandle;}
/// @throws css::sdbc::SQLException
isc_tr_handle& getTransaction();
/// @throws css::sdbc::SQLException
void buildTypeInfo();
/**
* Create a new Blob tied to this connection. Blobs are tied to a
* transaction and not to a statement, hence the connection should
* deal with their management.
*
* @throws css::sdbc::SQLException
* @throws css::uno::RuntimeException
*/
css::uno::Reference< css::sdbc::XBlob>
createBlob(ISC_QUAD const * pBlobID);
/// @throws css::sdbc::SQLException
/// @throws css::uno::RuntimeException
css::uno::Reference< css::sdbc::XClob>
createClob(ISC_QUAD const * pBlobID);
/**
* Creates a new transaction with the desired parameters, if
* necessary discarding an existing transaction. This has to be done
* anytime we change the transaction isolation, or autocommitting.
*
* @throws css::sdbc::SQLException
*/
void setupTransaction();
void disposeStatements();
/**
* Create and/or connect to the sdbcx Catalog. This is completely
* unrelated to the SQL "Catalog".
*/
css::uno::Reference< css::sdbcx::XTablesSupplier >
createCatalog();
public:
explicit Connection();
virtual ~Connection() override;
/**
* Backup and store embedded extracted database to the .odb file
*/
void storeDatabase();
/// @throws css::sdbc::SQLException
/// @throws css::uno::RuntimeException
void construct( const OUString& url,
const css::uno::Sequence< css::beans::PropertyValue >& info);
// OComponentHelper
virtual void SAL_CALL disposing() override;
const OUString& getConnectionURL() const {return m_sConnectionURL;}
bool isEmbedded() const {return m_bIsEmbedded;}
isc_db_handle& getDBHandle() {return m_aDBHandle;}
/// @throws css::sdbc::SQLException
isc_tr_handle& getTransaction();
// XServiceInfo
DECLARE_SERVICE_INFO();
// XUnoTunnel
virtual sal_Int64 SAL_CALL getSomething(const css::uno::Sequence<sal_Int8>& rId) override;
static const css::uno::Sequence<sal_Int8> & getUnoTunnelId();
// XConnection
virtual css::uno::Reference< css::sdbc::XStatement > SAL_CALL createStatement( ) override;
virtual css::uno::Reference< css::sdbc::XPreparedStatement > SAL_CALL prepareStatement( const OUString& sql ) override;
virtual css::uno::Reference< css::sdbc::XPreparedStatement > SAL_CALL prepareCall( const OUString& sql ) override;
virtual OUString SAL_CALL nativeSQL( const OUString& sql ) override;
virtual void SAL_CALL setAutoCommit( sal_Bool autoCommit ) override;
virtual sal_Bool SAL_CALL getAutoCommit( ) override;
virtual void SAL_CALL commit( ) override;
virtual void SAL_CALL rollback( ) override;
virtual sal_Bool SAL_CALL isClosed( ) override;
virtual css::uno::Reference< css::sdbc::XDatabaseMetaData > SAL_CALL getMetaData( ) override;
virtual void SAL_CALL setReadOnly( sal_Bool readOnly ) override;
virtual sal_Bool SAL_CALL isReadOnly( ) override;
virtual void SAL_CALL setCatalog( const OUString& catalog ) override;
virtual OUString SAL_CALL getCatalog( ) override;
virtual void SAL_CALL setTransactionIsolation( sal_Int32 level ) override;
virtual sal_Int32 SAL_CALL getTransactionIsolation( ) override;
virtual css::uno::Reference< css::container::XNameAccess > SAL_CALL getTypeMap( ) override;
virtual void SAL_CALL setTypeMap( const css::uno::Reference< css::container::XNameAccess >& typeMap ) override;
// XCloseable
virtual void SAL_CALL close( ) override;
// XWarningsSupplier
virtual css::uno::Any SAL_CALL getWarnings( ) override;
virtual void SAL_CALL clearWarnings( ) override;
// XDocumentEventListener
virtual void SAL_CALL documentEventOccured( const css::document::DocumentEvent& Event ) override;
// css.lang.XEventListener
virtual void SAL_CALL disposing( const css::lang::EventObject& Source ) override;
/**
* Create a new Blob tied to this connection. Blobs are tied to a
* transaction and not to a statement, hence the connection should
* deal with their management.
*
* @throws css::sdbc::SQLException
* @throws css::uno::RuntimeException
*/
css::uno::Reference< css::sdbc::XBlob>
createBlob(ISC_QUAD const * pBlobID);
/// @throws css::sdbc::SQLException
/// @throws css::uno::RuntimeException
css::uno::Reference< css::sdbc::XClob>
createClob(ISC_QUAD const * pBlobID);
/**
* Create and/or connect to the sdbcx Catalog. This is completely
* unrelated to the SQL "Catalog".
*/
css::uno::Reference< css::sdbcx::XTablesSupplier >
createCatalog();
/**
* Backup and store embedded extracted database to the .odb file
*/
void storeDatabase();
// OComponentHelper
virtual void SAL_CALL disposing() override;
// XServiceInfo
DECLARE_SERVICE_INFO();
// XUnoTunnel
virtual sal_Int64 SAL_CALL getSomething(const css::uno::Sequence<sal_Int8>& rId) override;
static const css::uno::Sequence<sal_Int8> & getUnoTunnelId();
// XConnection
virtual css::uno::Reference< css::sdbc::XStatement > SAL_CALL createStatement( ) override;
virtual css::uno::Reference< css::sdbc::XPreparedStatement > SAL_CALL prepareStatement( const OUString& sql ) override;
virtual css::uno::Reference< css::sdbc::XPreparedStatement > SAL_CALL prepareCall( const OUString& sql ) override;
virtual OUString SAL_CALL nativeSQL( const OUString& sql ) override;
virtual void SAL_CALL setAutoCommit( sal_Bool autoCommit ) override;
virtual sal_Bool SAL_CALL getAutoCommit( ) override;
virtual void SAL_CALL commit( ) override;
virtual void SAL_CALL rollback( ) override;
virtual sal_Bool SAL_CALL isClosed( ) override;
virtual css::uno::Reference< css::sdbc::XDatabaseMetaData > SAL_CALL getMetaData( ) override;
virtual void SAL_CALL setReadOnly( sal_Bool readOnly ) override;
virtual sal_Bool SAL_CALL isReadOnly( ) override;
virtual void SAL_CALL setCatalog( const OUString& catalog ) override;
virtual OUString SAL_CALL getCatalog( ) override;
virtual void SAL_CALL setTransactionIsolation( sal_Int32 level ) override;
virtual sal_Int32 SAL_CALL getTransactionIsolation( ) override;
virtual css::uno::Reference< css::container::XNameAccess > SAL_CALL getTypeMap( ) override;
virtual void SAL_CALL setTypeMap( const css::uno::Reference< css::container::XNameAccess >& typeMap ) override;
// XCloseable
virtual void SAL_CALL close( ) override;
// XWarningsSupplier
virtual css::uno::Any SAL_CALL getWarnings( ) override;
virtual void SAL_CALL clearWarnings( ) override;
// XDocumentEventListener
virtual void SAL_CALL documentEventOccured( const css::document::DocumentEvent& Event ) override;
// css.lang.XEventListener
virtual void SAL_CALL disposing( const css::lang::EventObject& Source ) override;
};
};
}
@@ -30,206 +30,206 @@
#include <rtl/ref.hxx>
namespace connectivity::firebird
{
//************ Class: ODatabaseMetaData
typedef ::cppu::WeakImplHelper< css::sdbc::XDatabaseMetaData3> ODatabaseMetaData_BASE;
class ODatabaseMetaData : public ODatabaseMetaData_BASE
{
::rtl::Reference<Connection> m_pConnection;
private:
css::uno::Reference< css::sdbc::XResultSet > lcl_getKeys( bool bIsImport, std::u16string_view table );
public:
//************ Class: ODatabaseMetaData
explicit ODatabaseMetaData(Connection* _pCon);
virtual ~ODatabaseMetaData() override;
// as I mentioned before this interface is really BIG
// XDatabaseMetaData
virtual sal_Bool SAL_CALL allProceduresAreCallable( ) override;
virtual sal_Bool SAL_CALL allTablesAreSelectable( ) override;
virtual OUString SAL_CALL getURL( ) override;
virtual OUString SAL_CALL getUserName( ) override;
virtual sal_Bool SAL_CALL isReadOnly( ) override;
virtual sal_Bool SAL_CALL nullsAreSortedHigh( ) override;
virtual sal_Bool SAL_CALL nullsAreSortedLow( ) override;
virtual sal_Bool SAL_CALL nullsAreSortedAtStart( ) override;
virtual sal_Bool SAL_CALL nullsAreSortedAtEnd( ) override;
virtual OUString SAL_CALL getDatabaseProductName( ) override;
virtual OUString SAL_CALL getDatabaseProductVersion( ) override;
virtual OUString SAL_CALL getDriverName( ) override;
virtual OUString SAL_CALL getDriverVersion( ) override;
virtual sal_Int32 SAL_CALL getDriverMajorVersion( ) override;
virtual sal_Int32 SAL_CALL getDriverMinorVersion( ) override;
virtual sal_Bool SAL_CALL usesLocalFiles( ) override;
virtual sal_Bool SAL_CALL usesLocalFilePerTable( ) override;
virtual sal_Bool SAL_CALL supportsMixedCaseIdentifiers( ) override;
virtual sal_Bool SAL_CALL storesUpperCaseIdentifiers( ) override;
virtual sal_Bool SAL_CALL storesLowerCaseIdentifiers( ) override;
virtual sal_Bool SAL_CALL storesMixedCaseIdentifiers( ) override;
virtual sal_Bool SAL_CALL supportsMixedCaseQuotedIdentifiers( ) override;
virtual sal_Bool SAL_CALL storesUpperCaseQuotedIdentifiers( ) override;
virtual sal_Bool SAL_CALL storesLowerCaseQuotedIdentifiers( ) override;
virtual sal_Bool SAL_CALL storesMixedCaseQuotedIdentifiers( ) override;
virtual OUString SAL_CALL getIdentifierQuoteString( ) override;
virtual OUString SAL_CALL getSQLKeywords( ) override;
virtual OUString SAL_CALL getNumericFunctions( ) override;
virtual OUString SAL_CALL getStringFunctions( ) override;
virtual OUString SAL_CALL getSystemFunctions( ) override;
virtual OUString SAL_CALL getTimeDateFunctions( ) override;
virtual OUString SAL_CALL getSearchStringEscape( ) override;
virtual OUString SAL_CALL getExtraNameCharacters( ) override;
virtual sal_Bool SAL_CALL supportsAlterTableWithAddColumn( ) override;
virtual sal_Bool SAL_CALL supportsAlterTableWithDropColumn( ) override;
virtual sal_Bool SAL_CALL supportsColumnAliasing( ) override;
virtual sal_Bool SAL_CALL nullPlusNonNullIsNull( ) override;
virtual sal_Bool SAL_CALL supportsTypeConversion( ) override;
virtual sal_Bool SAL_CALL supportsConvert( sal_Int32 fromType, sal_Int32 toType ) override;
virtual sal_Bool SAL_CALL supportsTableCorrelationNames( ) override;
virtual sal_Bool SAL_CALL supportsDifferentTableCorrelationNames( ) override;
virtual sal_Bool SAL_CALL supportsExpressionsInOrderBy( ) override;
virtual sal_Bool SAL_CALL supportsOrderByUnrelated( ) override;
virtual sal_Bool SAL_CALL supportsGroupBy( ) override;
virtual sal_Bool SAL_CALL supportsGroupByUnrelated( ) override;
virtual sal_Bool SAL_CALL supportsGroupByBeyondSelect( ) override;
virtual sal_Bool SAL_CALL supportsLikeEscapeClause( ) override;
virtual sal_Bool SAL_CALL supportsMultipleResultSets( ) override;
virtual sal_Bool SAL_CALL supportsMultipleTransactions( ) override;
virtual sal_Bool SAL_CALL supportsNonNullableColumns( ) override;
virtual sal_Bool SAL_CALL supportsMinimumSQLGrammar( ) override;
virtual sal_Bool SAL_CALL supportsCoreSQLGrammar( ) override;
virtual sal_Bool SAL_CALL supportsExtendedSQLGrammar( ) override;
virtual sal_Bool SAL_CALL supportsANSI92EntryLevelSQL( ) override;
virtual sal_Bool SAL_CALL supportsANSI92IntermediateSQL( ) override;
virtual sal_Bool SAL_CALL supportsANSI92FullSQL( ) override;
virtual sal_Bool SAL_CALL supportsIntegrityEnhancementFacility( ) override;
virtual sal_Bool SAL_CALL supportsOuterJoins( ) override;
virtual sal_Bool SAL_CALL supportsFullOuterJoins( ) override;
virtual sal_Bool SAL_CALL supportsLimitedOuterJoins( ) override;
virtual OUString SAL_CALL getSchemaTerm( ) override;
virtual OUString SAL_CALL getProcedureTerm( ) override;
virtual OUString SAL_CALL getCatalogTerm( ) override;
virtual sal_Bool SAL_CALL isCatalogAtStart( ) override;
virtual OUString SAL_CALL getCatalogSeparator( ) override;
virtual sal_Bool SAL_CALL supportsSchemasInDataManipulation( ) override;
virtual sal_Bool SAL_CALL supportsSchemasInProcedureCalls( ) override;
virtual sal_Bool SAL_CALL supportsSchemasInTableDefinitions( ) override;
virtual sal_Bool SAL_CALL supportsSchemasInIndexDefinitions( ) override;
virtual sal_Bool SAL_CALL supportsSchemasInPrivilegeDefinitions( ) override;
virtual sal_Bool SAL_CALL supportsCatalogsInDataManipulation( ) override;
virtual sal_Bool SAL_CALL supportsCatalogsInProcedureCalls( ) override;
virtual sal_Bool SAL_CALL supportsCatalogsInTableDefinitions( ) override;
virtual sal_Bool SAL_CALL supportsCatalogsInIndexDefinitions( ) override;
virtual sal_Bool SAL_CALL supportsCatalogsInPrivilegeDefinitions( ) override;
virtual sal_Bool SAL_CALL supportsPositionedDelete( ) override;
virtual sal_Bool SAL_CALL supportsPositionedUpdate( ) override;
virtual sal_Bool SAL_CALL supportsSelectForUpdate( ) override;
virtual sal_Bool SAL_CALL supportsStoredProcedures( ) override;
virtual sal_Bool SAL_CALL supportsSubqueriesInComparisons( ) override;
virtual sal_Bool SAL_CALL supportsSubqueriesInExists( ) override;
virtual sal_Bool SAL_CALL supportsSubqueriesInIns( ) override;
virtual sal_Bool SAL_CALL supportsSubqueriesInQuantifieds( ) override;
virtual sal_Bool SAL_CALL supportsCorrelatedSubqueries( ) override;
virtual sal_Bool SAL_CALL supportsUnion( ) override;
virtual sal_Bool SAL_CALL supportsUnionAll( ) override;
virtual sal_Bool SAL_CALL supportsOpenCursorsAcrossCommit( ) override;
virtual sal_Bool SAL_CALL supportsOpenCursorsAcrossRollback( ) override;
virtual sal_Bool SAL_CALL supportsOpenStatementsAcrossCommit( ) override;
virtual sal_Bool SAL_CALL supportsOpenStatementsAcrossRollback( ) override;
virtual sal_Int32 SAL_CALL getMaxBinaryLiteralLength( ) override;
virtual sal_Int32 SAL_CALL getMaxCharLiteralLength( ) override;
virtual sal_Int32 SAL_CALL getMaxColumnNameLength( ) override;
virtual sal_Int32 SAL_CALL getMaxColumnsInGroupBy( ) override;
virtual sal_Int32 SAL_CALL getMaxColumnsInIndex( ) override;
virtual sal_Int32 SAL_CALL getMaxColumnsInOrderBy( ) override;
virtual sal_Int32 SAL_CALL getMaxColumnsInSelect( ) override;
virtual sal_Int32 SAL_CALL getMaxColumnsInTable( ) override;
virtual sal_Int32 SAL_CALL getMaxConnections( ) override;
virtual sal_Int32 SAL_CALL getMaxCursorNameLength( ) override;
virtual sal_Int32 SAL_CALL getMaxIndexLength( ) override;
virtual sal_Int32 SAL_CALL getMaxSchemaNameLength( ) override;
virtual sal_Int32 SAL_CALL getMaxProcedureNameLength( ) override;
virtual sal_Int32 SAL_CALL getMaxCatalogNameLength( ) override;
virtual sal_Int32 SAL_CALL getMaxRowSize( ) override;
virtual sal_Bool SAL_CALL doesMaxRowSizeIncludeBlobs( ) override;
virtual sal_Int32 SAL_CALL getMaxStatementLength( ) override;
virtual sal_Int32 SAL_CALL getMaxStatements( ) override;
virtual sal_Int32 SAL_CALL getMaxTableNameLength( ) override;
virtual sal_Int32 SAL_CALL getMaxTablesInSelect( ) override;
virtual sal_Int32 SAL_CALL getMaxUserNameLength( ) override;
virtual sal_Int32 SAL_CALL getDefaultTransactionIsolation( ) override;
virtual sal_Bool SAL_CALL supportsTransactions( ) override;
virtual sal_Bool SAL_CALL supportsTransactionIsolationLevel( sal_Int32 level ) override;
virtual sal_Bool SAL_CALL supportsDataDefinitionAndDataManipulationTransactions( ) override;
virtual sal_Bool SAL_CALL supportsDataManipulationTransactionsOnly( ) override;
virtual sal_Bool SAL_CALL dataDefinitionCausesTransactionCommit( ) override;
virtual sal_Bool SAL_CALL dataDefinitionIgnoredInTransactions( ) override;
virtual css::uno::Reference< css::sdbc::XResultSet > SAL_CALL getProcedures( const css::uno::Any& catalog, const OUString& schemaPattern, const OUString& procedureNamePattern ) override;
virtual css::uno::Reference< css::sdbc::XResultSet > SAL_CALL getProcedureColumns( const css::uno::Any& catalog, const OUString& schemaPattern, const OUString& procedureNamePattern, const OUString& columnNamePattern ) override;
virtual css::uno::Reference< css::sdbc::XResultSet > SAL_CALL getTables( const css::uno::Any& catalog, const OUString& schemaPattern, const OUString& tableNamePattern, const css::uno::Sequence< OUString >& types ) override;
virtual css::uno::Reference< css::sdbc::XResultSet > SAL_CALL getSchemas( ) override;
virtual css::uno::Reference< css::sdbc::XResultSet > SAL_CALL getCatalogs( ) override;
virtual css::uno::Reference< css::sdbc::XResultSet > SAL_CALL getTableTypes( ) override;
virtual css::uno::Reference< css::sdbc::XResultSet > SAL_CALL getColumns( const css::uno::Any& catalog, const OUString& schemaPattern, const OUString& tableNamePattern, const OUString& columnNamePattern ) override;
virtual css::uno::Reference< css::sdbc::XResultSet > SAL_CALL getColumnPrivileges( const css::uno::Any& catalog, const OUString& schema, const OUString& table, const OUString& columnNamePattern ) override;
virtual css::uno::Reference< css::sdbc::XResultSet > SAL_CALL getTablePrivileges( const css::uno::Any& catalog, const OUString& schemaPattern, const OUString& tableNamePattern ) override;
virtual css::uno::Reference< css::sdbc::XResultSet > SAL_CALL getBestRowIdentifier( const css::uno::Any& catalog, const OUString& schema, const OUString& table, sal_Int32 scope, sal_Bool nullable ) override;
virtual css::uno::Reference< css::sdbc::XResultSet > SAL_CALL getVersionColumns( const css::uno::Any& catalog, const OUString& schema, const OUString& table ) override;
virtual css::uno::Reference< css::sdbc::XResultSet > SAL_CALL getPrimaryKeys( const css::uno::Any& catalog, const OUString& schema, const OUString& table ) override;
virtual css::uno::Reference< css::sdbc::XResultSet > SAL_CALL getImportedKeys( const css::uno::Any& catalog, const OUString& schema, const OUString& table ) override;
virtual css::uno::Reference< css::sdbc::XResultSet > SAL_CALL getExportedKeys( const css::uno::Any& catalog, const OUString& schema, const OUString& table ) override;
virtual css::uno::Reference< css::sdbc::XResultSet > SAL_CALL getCrossReference( const css::uno::Any& primaryCatalog, const OUString& primarySchema, const OUString& primaryTable, const css::uno::Any& foreignCatalog, const OUString& foreignSchema, const OUString& foreignTable ) override;
virtual css::uno::Reference< css::sdbc::XResultSet > SAL_CALL getTypeInfo( ) override;
virtual css::uno::Reference< css::sdbc::XResultSet > SAL_CALL getIndexInfo( const css::uno::Any& catalog, const OUString& schema, const OUString& table, sal_Bool unique, sal_Bool approximate ) override;
virtual sal_Bool SAL_CALL supportsResultSetType( sal_Int32 setType ) override;
virtual sal_Bool SAL_CALL supportsResultSetConcurrency( sal_Int32 setType, sal_Int32 concurrency ) override;
virtual sal_Bool SAL_CALL ownUpdatesAreVisible( sal_Int32 setType ) override;
virtual sal_Bool SAL_CALL ownDeletesAreVisible( sal_Int32 setType ) override;
virtual sal_Bool SAL_CALL ownInsertsAreVisible( sal_Int32 setType ) override;
virtual sal_Bool SAL_CALL othersUpdatesAreVisible( sal_Int32 setType ) override;
virtual sal_Bool SAL_CALL othersDeletesAreVisible( sal_Int32 setType ) override;
virtual sal_Bool SAL_CALL othersInsertsAreVisible( sal_Int32 setType ) override;
virtual sal_Bool SAL_CALL updatesAreDetected( sal_Int32 setType ) override;
virtual sal_Bool SAL_CALL deletesAreDetected( sal_Int32 setType ) override;
virtual sal_Bool SAL_CALL insertsAreDetected( sal_Int32 setType ) override;
virtual sal_Bool SAL_CALL supportsBatchUpdates( ) override;
virtual css::uno::Reference< css::sdbc::XResultSet > SAL_CALL getUDTs( const css::uno::Any& catalog, const OUString& schemaPattern, const OUString& typeNamePattern, const css::uno::Sequence< sal_Int32 >& types ) override;
virtual css::uno::Reference< css::sdbc::XConnection > SAL_CALL getConnection( ) override;
typedef ::cppu::WeakImplHelper< css::sdbc::XDatabaseMetaData3> ODatabaseMetaData_BASE;
// XDatabaseMetaData2
virtual ::css::uno::Sequence< ::css::beans::PropertyValue > SAL_CALL getConnectionInfo() override;
class ODatabaseMetaData : public ODatabaseMetaData_BASE
{
::rtl::Reference<Connection> m_pConnection;
private:
css::uno::Reference< css::sdbc::XResultSet > lcl_getKeys( bool bIsImport, std::u16string_view table );
public:
explicit ODatabaseMetaData(Connection* _pCon);
virtual ~ODatabaseMetaData() override;
// as I mentioned before this interface is really BIG
// XDatabaseMetaData
virtual sal_Bool SAL_CALL allProceduresAreCallable( ) override;
virtual sal_Bool SAL_CALL allTablesAreSelectable( ) override;
virtual OUString SAL_CALL getURL( ) override;
virtual OUString SAL_CALL getUserName( ) override;
virtual sal_Bool SAL_CALL isReadOnly( ) override;
virtual sal_Bool SAL_CALL nullsAreSortedHigh( ) override;
virtual sal_Bool SAL_CALL nullsAreSortedLow( ) override;
virtual sal_Bool SAL_CALL nullsAreSortedAtStart( ) override;
virtual sal_Bool SAL_CALL nullsAreSortedAtEnd( ) override;
virtual OUString SAL_CALL getDatabaseProductName( ) override;
virtual OUString SAL_CALL getDatabaseProductVersion( ) override;
virtual OUString SAL_CALL getDriverName( ) override;
virtual OUString SAL_CALL getDriverVersion( ) override;
virtual sal_Int32 SAL_CALL getDriverMajorVersion( ) override;
virtual sal_Int32 SAL_CALL getDriverMinorVersion( ) override;
virtual sal_Bool SAL_CALL usesLocalFiles( ) override;
virtual sal_Bool SAL_CALL usesLocalFilePerTable( ) override;
virtual sal_Bool SAL_CALL supportsMixedCaseIdentifiers( ) override;
virtual sal_Bool SAL_CALL storesUpperCaseIdentifiers( ) override;
virtual sal_Bool SAL_CALL storesLowerCaseIdentifiers( ) override;
virtual sal_Bool SAL_CALL storesMixedCaseIdentifiers( ) override;
virtual sal_Bool SAL_CALL supportsMixedCaseQuotedIdentifiers( ) override;
virtual sal_Bool SAL_CALL storesUpperCaseQuotedIdentifiers( ) override;
virtual sal_Bool SAL_CALL storesLowerCaseQuotedIdentifiers( ) override;
virtual sal_Bool SAL_CALL storesMixedCaseQuotedIdentifiers( ) override;
virtual OUString SAL_CALL getIdentifierQuoteString( ) override;
virtual OUString SAL_CALL getSQLKeywords( ) override;
virtual OUString SAL_CALL getNumericFunctions( ) override;
virtual OUString SAL_CALL getStringFunctions( ) override;
virtual OUString SAL_CALL getSystemFunctions( ) override;
virtual OUString SAL_CALL getTimeDateFunctions( ) override;
virtual OUString SAL_CALL getSearchStringEscape( ) override;
virtual OUString SAL_CALL getExtraNameCharacters( ) override;
virtual sal_Bool SAL_CALL supportsAlterTableWithAddColumn( ) override;
virtual sal_Bool SAL_CALL supportsAlterTableWithDropColumn( ) override;
virtual sal_Bool SAL_CALL supportsColumnAliasing( ) override;
virtual sal_Bool SAL_CALL nullPlusNonNullIsNull( ) override;
virtual sal_Bool SAL_CALL supportsTypeConversion( ) override;
virtual sal_Bool SAL_CALL supportsConvert( sal_Int32 fromType, sal_Int32 toType ) override;
virtual sal_Bool SAL_CALL supportsTableCorrelationNames( ) override;
virtual sal_Bool SAL_CALL supportsDifferentTableCorrelationNames( ) override;
virtual sal_Bool SAL_CALL supportsExpressionsInOrderBy( ) override;
virtual sal_Bool SAL_CALL supportsOrderByUnrelated( ) override;
virtual sal_Bool SAL_CALL supportsGroupBy( ) override;
virtual sal_Bool SAL_CALL supportsGroupByUnrelated( ) override;
virtual sal_Bool SAL_CALL supportsGroupByBeyondSelect( ) override;
virtual sal_Bool SAL_CALL supportsLikeEscapeClause( ) override;
virtual sal_Bool SAL_CALL supportsMultipleResultSets( ) override;
virtual sal_Bool SAL_CALL supportsMultipleTransactions( ) override;
virtual sal_Bool SAL_CALL supportsNonNullableColumns( ) override;
virtual sal_Bool SAL_CALL supportsMinimumSQLGrammar( ) override;
virtual sal_Bool SAL_CALL supportsCoreSQLGrammar( ) override;
virtual sal_Bool SAL_CALL supportsExtendedSQLGrammar( ) override;
virtual sal_Bool SAL_CALL supportsANSI92EntryLevelSQL( ) override;
virtual sal_Bool SAL_CALL supportsANSI92IntermediateSQL( ) override;
virtual sal_Bool SAL_CALL supportsANSI92FullSQL( ) override;
virtual sal_Bool SAL_CALL supportsIntegrityEnhancementFacility( ) override;
virtual sal_Bool SAL_CALL supportsOuterJoins( ) override;
virtual sal_Bool SAL_CALL supportsFullOuterJoins( ) override;
virtual sal_Bool SAL_CALL supportsLimitedOuterJoins( ) override;
virtual OUString SAL_CALL getSchemaTerm( ) override;
virtual OUString SAL_CALL getProcedureTerm( ) override;
virtual OUString SAL_CALL getCatalogTerm( ) override;
virtual sal_Bool SAL_CALL isCatalogAtStart( ) override;
virtual OUString SAL_CALL getCatalogSeparator( ) override;
virtual sal_Bool SAL_CALL supportsSchemasInDataManipulation( ) override;
virtual sal_Bool SAL_CALL supportsSchemasInProcedureCalls( ) override;
virtual sal_Bool SAL_CALL supportsSchemasInTableDefinitions( ) override;
virtual sal_Bool SAL_CALL supportsSchemasInIndexDefinitions( ) override;
virtual sal_Bool SAL_CALL supportsSchemasInPrivilegeDefinitions( ) override;
virtual sal_Bool SAL_CALL supportsCatalogsInDataManipulation( ) override;
virtual sal_Bool SAL_CALL supportsCatalogsInProcedureCalls( ) override;
virtual sal_Bool SAL_CALL supportsCatalogsInTableDefinitions( ) override;
virtual sal_Bool SAL_CALL supportsCatalogsInIndexDefinitions( ) override;
virtual sal_Bool SAL_CALL supportsCatalogsInPrivilegeDefinitions( ) override;
virtual sal_Bool SAL_CALL supportsPositionedDelete( ) override;
virtual sal_Bool SAL_CALL supportsPositionedUpdate( ) override;
virtual sal_Bool SAL_CALL supportsSelectForUpdate( ) override;
virtual sal_Bool SAL_CALL supportsStoredProcedures( ) override;
virtual sal_Bool SAL_CALL supportsSubqueriesInComparisons( ) override;
virtual sal_Bool SAL_CALL supportsSubqueriesInExists( ) override;
virtual sal_Bool SAL_CALL supportsSubqueriesInIns( ) override;
virtual sal_Bool SAL_CALL supportsSubqueriesInQuantifieds( ) override;
virtual sal_Bool SAL_CALL supportsCorrelatedSubqueries( ) override;
virtual sal_Bool SAL_CALL supportsUnion( ) override;
virtual sal_Bool SAL_CALL supportsUnionAll( ) override;
virtual sal_Bool SAL_CALL supportsOpenCursorsAcrossCommit( ) override;
virtual sal_Bool SAL_CALL supportsOpenCursorsAcrossRollback( ) override;
virtual sal_Bool SAL_CALL supportsOpenStatementsAcrossCommit( ) override;
virtual sal_Bool SAL_CALL supportsOpenStatementsAcrossRollback( ) override;
virtual sal_Int32 SAL_CALL getMaxBinaryLiteralLength( ) override;
virtual sal_Int32 SAL_CALL getMaxCharLiteralLength( ) override;
virtual sal_Int32 SAL_CALL getMaxColumnNameLength( ) override;
virtual sal_Int32 SAL_CALL getMaxColumnsInGroupBy( ) override;
virtual sal_Int32 SAL_CALL getMaxColumnsInIndex( ) override;
virtual sal_Int32 SAL_CALL getMaxColumnsInOrderBy( ) override;
virtual sal_Int32 SAL_CALL getMaxColumnsInSelect( ) override;
virtual sal_Int32 SAL_CALL getMaxColumnsInTable( ) override;
virtual sal_Int32 SAL_CALL getMaxConnections( ) override;
virtual sal_Int32 SAL_CALL getMaxCursorNameLength( ) override;
virtual sal_Int32 SAL_CALL getMaxIndexLength( ) override;
virtual sal_Int32 SAL_CALL getMaxSchemaNameLength( ) override;
virtual sal_Int32 SAL_CALL getMaxProcedureNameLength( ) override;
virtual sal_Int32 SAL_CALL getMaxCatalogNameLength( ) override;
virtual sal_Int32 SAL_CALL getMaxRowSize( ) override;
virtual sal_Bool SAL_CALL doesMaxRowSizeIncludeBlobs( ) override;
virtual sal_Int32 SAL_CALL getMaxStatementLength( ) override;
virtual sal_Int32 SAL_CALL getMaxStatements( ) override;
virtual sal_Int32 SAL_CALL getMaxTableNameLength( ) override;
virtual sal_Int32 SAL_CALL getMaxTablesInSelect( ) override;
virtual sal_Int32 SAL_CALL getMaxUserNameLength( ) override;
virtual sal_Int32 SAL_CALL getDefaultTransactionIsolation( ) override;
virtual sal_Bool SAL_CALL supportsTransactions( ) override;
virtual sal_Bool SAL_CALL supportsTransactionIsolationLevel( sal_Int32 level ) override;
virtual sal_Bool SAL_CALL supportsDataDefinitionAndDataManipulationTransactions( ) override;
virtual sal_Bool SAL_CALL supportsDataManipulationTransactionsOnly( ) override;
virtual sal_Bool SAL_CALL dataDefinitionCausesTransactionCommit( ) override;
virtual sal_Bool SAL_CALL dataDefinitionIgnoredInTransactions( ) override;
virtual css::uno::Reference< css::sdbc::XResultSet > SAL_CALL getProcedures( const css::uno::Any& catalog, const OUString& schemaPattern, const OUString& procedureNamePattern ) override;
virtual css::uno::Reference< css::sdbc::XResultSet > SAL_CALL getProcedureColumns( const css::uno::Any& catalog, const OUString& schemaPattern, const OUString& procedureNamePattern, const OUString& columnNamePattern ) override;
virtual css::uno::Reference< css::sdbc::XResultSet > SAL_CALL getTables( const css::uno::Any& catalog, const OUString& schemaPattern, const OUString& tableNamePattern, const css::uno::Sequence< OUString >& types ) override;
virtual css::uno::Reference< css::sdbc::XResultSet > SAL_CALL getSchemas( ) override;
virtual css::uno::Reference< css::sdbc::XResultSet > SAL_CALL getCatalogs( ) override;
virtual css::uno::Reference< css::sdbc::XResultSet > SAL_CALL getTableTypes( ) override;
virtual css::uno::Reference< css::sdbc::XResultSet > SAL_CALL getColumns( const css::uno::Any& catalog, const OUString& schemaPattern, const OUString& tableNamePattern, const OUString& columnNamePattern ) override;
virtual css::uno::Reference< css::sdbc::XResultSet > SAL_CALL getColumnPrivileges( const css::uno::Any& catalog, const OUString& schema, const OUString& table, const OUString& columnNamePattern ) override;
virtual css::uno::Reference< css::sdbc::XResultSet > SAL_CALL getTablePrivileges( const css::uno::Any& catalog, const OUString& schemaPattern, const OUString& tableNamePattern ) override;
virtual css::uno::Reference< css::sdbc::XResultSet > SAL_CALL getBestRowIdentifier( const css::uno::Any& catalog, const OUString& schema, const OUString& table, sal_Int32 scope, sal_Bool nullable ) override;
virtual css::uno::Reference< css::sdbc::XResultSet > SAL_CALL getVersionColumns( const css::uno::Any& catalog, const OUString& schema, const OUString& table ) override;
virtual css::uno::Reference< css::sdbc::XResultSet > SAL_CALL getPrimaryKeys( const css::uno::Any& catalog, const OUString& schema, const OUString& table ) override;
virtual css::uno::Reference< css::sdbc::XResultSet > SAL_CALL getImportedKeys( const css::uno::Any& catalog, const OUString& schema, const OUString& table ) override;
virtual css::uno::Reference< css::sdbc::XResultSet > SAL_CALL getExportedKeys( const css::uno::Any& catalog, const OUString& schema, const OUString& table ) override;
virtual css::uno::Reference< css::sdbc::XResultSet > SAL_CALL getCrossReference( const css::uno::Any& primaryCatalog, const OUString& primarySchema, const OUString& primaryTable, const css::uno::Any& foreignCatalog, const OUString& foreignSchema, const OUString& foreignTable ) override;
virtual css::uno::Reference< css::sdbc::XResultSet > SAL_CALL getTypeInfo( ) override;
virtual css::uno::Reference< css::sdbc::XResultSet > SAL_CALL getIndexInfo( const css::uno::Any& catalog, const OUString& schema, const OUString& table, sal_Bool unique, sal_Bool approximate ) override;
virtual sal_Bool SAL_CALL supportsResultSetType( sal_Int32 setType ) override;
virtual sal_Bool SAL_CALL supportsResultSetConcurrency( sal_Int32 setType, sal_Int32 concurrency ) override;
virtual sal_Bool SAL_CALL ownUpdatesAreVisible( sal_Int32 setType ) override;
virtual sal_Bool SAL_CALL ownDeletesAreVisible( sal_Int32 setType ) override;
virtual sal_Bool SAL_CALL ownInsertsAreVisible( sal_Int32 setType ) override;
virtual sal_Bool SAL_CALL othersUpdatesAreVisible( sal_Int32 setType ) override;
virtual sal_Bool SAL_CALL othersDeletesAreVisible( sal_Int32 setType ) override;
virtual sal_Bool SAL_CALL othersInsertsAreVisible( sal_Int32 setType ) override;
virtual sal_Bool SAL_CALL updatesAreDetected( sal_Int32 setType ) override;
virtual sal_Bool SAL_CALL deletesAreDetected( sal_Int32 setType ) override;
virtual sal_Bool SAL_CALL insertsAreDetected( sal_Int32 setType ) override;
virtual sal_Bool SAL_CALL supportsBatchUpdates( ) override;
virtual css::uno::Reference< css::sdbc::XResultSet > SAL_CALL getUDTs( const css::uno::Any& catalog, const OUString& schemaPattern, const OUString& typeNamePattern, const css::uno::Sequence< sal_Int32 >& types ) override;
virtual css::uno::Reference< css::sdbc::XConnection > SAL_CALL getConnection( ) override;
// XDatabaseMetaData2
virtual ::css::uno::Sequence< ::css::beans::PropertyValue > SAL_CALL getConnectionInfo() override;
// XDatabaseMetaData3
virtual sal_Bool SAL_CALL autoCommitFailureClosesAllResultSets() override;
virtual sal_Bool SAL_CALL generatedKeyAlwaysReturned() override;
virtual ::css::uno::Reference< ::css::sdbc::XResultSet > SAL_CALL getAttributes( const ::rtl::OUString& catalog, const ::rtl::OUString& schemaPattern, const ::rtl::OUString& typeNamePattern, const ::rtl::OUString& attributeNamePattern ) override;
virtual ::css::uno::Reference< ::css::sdbc::XResultSet > SAL_CALL getClientInfoProperties() override;
virtual ::sal_Int32 SAL_CALL getDatabaseMajorVersion() override;
virtual ::sal_Int32 SAL_CALL getDatabaseMinorVersion() override;
virtual ::css::uno::Reference< ::css::sdbc::XResultSet > SAL_CALL getFunctions( const ::rtl::OUString& catalog, const ::rtl::OUString& schemaPattern, const ::rtl::OUString& functionNamePattern ) override;
virtual ::css::uno::Reference< ::css::sdbc::XResultSet > SAL_CALL getFunctionColumns( const ::rtl::OUString& catalog, const ::rtl::OUString& schemaPattern, const ::rtl::OUString& functionNamePattern, const ::rtl::OUString& columnNamePattern ) override;
virtual ::sal_Int32 SAL_CALL getMaxLogicalLobSize() override;
virtual ::css::uno::Reference< ::css::sdbc::XResultSet > SAL_CALL getPseudoColumns( const ::rtl::OUString& catalog, const ::rtl::OUString& schemaPattern, const ::rtl::OUString& tableNamePattern, const ::rtl::OUString& columnNamePattern ) override;
virtual ::sal_Int32 SAL_CALL getResultSetHoldability() override;
virtual ::sal_Int32 SAL_CALL getRowIdLifetime() override;
virtual ::css::uno::Reference< ::css::sdbc::XResultSet > SAL_CALL getSchemasFiltered( const ::css::beans::Optional< ::rtl::OUString >& catalog, const ::css::beans::Optional< ::rtl::OUString >& schemaPattern ) override;
virtual ::sal_Int32 SAL_CALL getSQLStateType() override;
virtual ::css::uno::Reference< ::css::sdbc::XResultSet > SAL_CALL getSuperTables( const ::rtl::OUString& catalog, const ::rtl::OUString& schemaPattern, const ::rtl::OUString& tableNamePattern ) override;
virtual ::css::uno::Reference< ::css::sdbc::XResultSet > SAL_CALL getSuperTypes( const ::rtl::OUString& catalog, const ::rtl::OUString& schemaPattern, const ::rtl::OUString& typeNamePattern ) override;
virtual ::sal_Bool SAL_CALL locatorsUpdateCopy() override;
virtual ::sal_Bool SAL_CALL supportsConvertInGeneral() override;
virtual ::sal_Bool SAL_CALL supportsGetGeneratedKeys() override;
virtual ::sal_Bool SAL_CALL supportsMultipleOpenResults() override;
virtual ::sal_Bool SAL_CALL supportsNamedParameters() override;
virtual ::sal_Bool SAL_CALL supportsRefCursors() override;
virtual ::sal_Bool SAL_CALL supportsSavepoints() override;
virtual ::sal_Bool SAL_CALL supportsSharding() override;
virtual ::sal_Bool SAL_CALL supportsStatementPooling() override;
virtual ::sal_Bool SAL_CALL supportsStoredFunctionsUsingCallSyntax() override;
};
// XDatabaseMetaData3
virtual sal_Bool SAL_CALL autoCommitFailureClosesAllResultSets() override;
virtual sal_Bool SAL_CALL generatedKeyAlwaysReturned() override;
virtual ::css::uno::Reference< ::css::sdbc::XResultSet > SAL_CALL getAttributes( const ::rtl::OUString& catalog, const ::rtl::OUString& schemaPattern, const ::rtl::OUString& typeNamePattern, const ::rtl::OUString& attributeNamePattern ) override;
virtual ::css::uno::Reference< ::css::sdbc::XResultSet > SAL_CALL getClientInfoProperties() override;
virtual ::sal_Int32 SAL_CALL getDatabaseMajorVersion() override;
virtual ::sal_Int32 SAL_CALL getDatabaseMinorVersion() override;
virtual ::css::uno::Reference< ::css::sdbc::XResultSet > SAL_CALL getFunctions( const ::rtl::OUString& catalog, const ::rtl::OUString& schemaPattern, const ::rtl::OUString& functionNamePattern ) override;
virtual ::css::uno::Reference< ::css::sdbc::XResultSet > SAL_CALL getFunctionColumns( const ::rtl::OUString& catalog, const ::rtl::OUString& schemaPattern, const ::rtl::OUString& functionNamePattern, const ::rtl::OUString& columnNamePattern ) override;
virtual ::sal_Int32 SAL_CALL getMaxLogicalLobSize() override;
virtual ::css::uno::Reference< ::css::sdbc::XResultSet > SAL_CALL getPseudoColumns( const ::rtl::OUString& catalog, const ::rtl::OUString& schemaPattern, const ::rtl::OUString& tableNamePattern, const ::rtl::OUString& columnNamePattern ) override;
virtual ::sal_Int32 SAL_CALL getResultSetHoldability() override;
virtual ::sal_Int32 SAL_CALL getRowIdLifetime() override;
virtual ::css::uno::Reference< ::css::sdbc::XResultSet > SAL_CALL getSchemasFiltered( const ::css::beans::Optional< ::rtl::OUString >& catalog, const ::css::beans::Optional< ::rtl::OUString >& schemaPattern ) override;
virtual ::sal_Int32 SAL_CALL getSQLStateType() override;
virtual ::css::uno::Reference< ::css::sdbc::XResultSet > SAL_CALL getSuperTables( const ::rtl::OUString& catalog, const ::rtl::OUString& schemaPattern, const ::rtl::OUString& tableNamePattern ) override;
virtual ::css::uno::Reference< ::css::sdbc::XResultSet > SAL_CALL getSuperTypes( const ::rtl::OUString& catalog, const ::rtl::OUString& schemaPattern, const ::rtl::OUString& typeNamePattern ) override;
virtual ::sal_Bool SAL_CALL locatorsUpdateCopy() override;
virtual ::sal_Bool SAL_CALL supportsConvertInGeneral() override;
virtual ::sal_Bool SAL_CALL supportsGetGeneratedKeys() override;
virtual ::sal_Bool SAL_CALL supportsMultipleOpenResults() override;
virtual ::sal_Bool SAL_CALL supportsNamedParameters() override;
virtual ::sal_Bool SAL_CALL supportsRefCursors() override;
virtual ::sal_Bool SAL_CALL supportsSavepoints() override;
virtual ::sal_Bool SAL_CALL supportsSharding() override;
virtual ::sal_Bool SAL_CALL supportsStatementPooling() override;
virtual ::sal_Bool SAL_CALL supportsStoredFunctionsUsingCallSyntax() override;
};
}
+48 -48
View File
@@ -30,62 +30,62 @@
#include <unotools/weakref.hxx>
namespace connectivity::firebird
{
// The SQL dialect in use
// Has to be used in various isc_* calls.
// 3: Is IB6 -- minimum required for delimited identifiers.
// SQL_DIALECT_V6 = 3, it's the last current version
// SQL_DIALECT_CURRENT is an alias for SQL_DIALECT_V6
// See src/dsql/sqlda_pub.h for full details
typedef ::cppu::WeakComponentImplHelper< css::sdbc::XDriver,
css::sdbcx::XDataDefinitionSupplier,
css::lang::XServiceInfo > ODriver_BASE;
class FirebirdDriver : public ODriver_BASE
{
// The SQL dialect in use
// Has to be used in various isc_* calls.
// 3: Is IB6 -- minimum required for delimited identifiers.
// SQL_DIALECT_V6 = 3, it's the last current version
// SQL_DIALECT_CURRENT is an alias for SQL_DIALECT_V6
// See src/dsql/sqlda_pub.h for full details
private:
css::uno::Reference<css::uno::XComponentContext> m_aContext;
::utl::TempFileNamed m_firebirdTMPDirectory;
::utl::TempFileNamed m_firebirdLockDirectory;
typedef ::cppu::WeakComponentImplHelper< css::sdbc::XDriver,
css::sdbcx::XDataDefinitionSupplier,
css::lang::XServiceInfo > ODriver_BASE;
protected:
::osl::Mutex m_aMutex; // mutex is need to control member access
std::vector<unotools::WeakReference<Connection>>
m_xConnections; // vector containing a list
// of all the Connection objects
// for this Driver
class FirebirdDriver : public ODriver_BASE
{
private:
css::uno::Reference<css::uno::XComponentContext> m_aContext;
::utl::TempFileNamed m_firebirdTMPDirectory;
::utl::TempFileNamed m_firebirdLockDirectory;
public:
protected:
::osl::Mutex m_aMutex; // mutex is need to control member access
std::vector<unotools::WeakReference<Connection>>
m_xConnections; // vector containing a list
// of all the Connection objects
// for this Driver
explicit FirebirdDriver(const css::uno::Reference< css::uno::XComponentContext >& _rxContext);
virtual ~FirebirdDriver() override;
const css::uno::Reference<css::uno::XComponentContext>& getContext() const { return m_aContext; }
public:
// OComponentHelper
virtual void SAL_CALL disposing() override;
explicit FirebirdDriver(const css::uno::Reference< css::uno::XComponentContext >& _rxContext);
virtual ~FirebirdDriver() override;
const css::uno::Reference<css::uno::XComponentContext>& getContext() const { return m_aContext; }
// XServiceInfo
virtual OUString SAL_CALL getImplementationName( ) override;
virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) override;
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames( ) override;
// OComponentHelper
virtual void SAL_CALL disposing() override;
// XDriver
virtual css::uno::Reference< css::sdbc::XConnection > SAL_CALL connect( const OUString& url, const css::uno::Sequence< css::beans::PropertyValue >& info ) override;
virtual sal_Bool SAL_CALL acceptsURL( const OUString& url ) override;
virtual css::uno::Sequence< css::sdbc::DriverPropertyInfo > SAL_CALL getPropertyInfo( const OUString& url, const css::uno::Sequence< css::beans::PropertyValue >& info ) override;
virtual sal_Int32 SAL_CALL getMajorVersion( ) override;
virtual sal_Int32 SAL_CALL getMinorVersion( ) override;
// XServiceInfo
virtual OUString SAL_CALL getImplementationName( ) override;
virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) override;
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames( ) override;
// XDriver
virtual css::uno::Reference< css::sdbc::XConnection > SAL_CALL connect( const OUString& url, const css::uno::Sequence< css::beans::PropertyValue >& info ) override;
virtual sal_Bool SAL_CALL acceptsURL( const OUString& url ) override;
virtual css::uno::Sequence< css::sdbc::DriverPropertyInfo > SAL_CALL getPropertyInfo( const OUString& url, const css::uno::Sequence< css::beans::PropertyValue >& info ) override;
virtual sal_Int32 SAL_CALL getMajorVersion( ) override;
virtual sal_Int32 SAL_CALL getMinorVersion( ) override;
// XDataDefinitionSupplier
virtual css::uno::Reference< css::sdbcx::XTablesSupplier >
SAL_CALL getDataDefinitionByConnection(
const css::uno::Reference< css::sdbc::XConnection >& rxConnection) override;
virtual css::uno::Reference< css::sdbcx::XTablesSupplier >
SAL_CALL getDataDefinitionByURL(
const OUString& rsURL,
const css::uno::Sequence< css::beans::PropertyValue >& rInfo) override;
};
// XDataDefinitionSupplier
virtual css::uno::Reference< css::sdbcx::XTablesSupplier >
SAL_CALL getDataDefinitionByConnection(
const css::uno::Reference< css::sdbc::XConnection >& rxConnection) override;
virtual css::uno::Reference< css::sdbcx::XTablesSupplier >
SAL_CALL getDataDefinitionByURL(
const OUString& rsURL,
const css::uno::Sequence< css::beans::PropertyValue >& rInfo) override;
};
}
@@ -14,25 +14,25 @@
#include <connectivity/TIndexes.hxx>
namespace connectivity::firebird
{
{
/**
* Firebird has a non-standard DROP INDEX statement, hence we need
* to override OIndexesHelper::dropObject
*/
class Indexes: public ::connectivity::OIndexesHelper
{
private:
Table* m_pTable;
protected:
// XDrop
virtual void dropObject(sal_Int32 nPosition,
const OUString& sIndexName) override;
public:
Indexes(Table* pTable,
::osl::Mutex& rMutex,
const std::vector< OUString>& rVector);
};
/**
* Firebird has a non-standard DROP INDEX statement, hence we need
* to override OIndexesHelper::dropObject
*/
class Indexes: public ::connectivity::OIndexesHelper
{
private:
Table* m_pTable;
protected:
// XDrop
virtual void dropObject(sal_Int32 nPosition,
const OUString& sIndexName) override;
public:
Indexes(Table* pTable,
::osl::Mutex& rMutex,
const std::vector< OUString>& rVector);
};
} // namespace connectivity::firebird
+14 -14
View File
@@ -12,24 +12,24 @@
#include <connectivity/TKeys.hxx>
namespace connectivity::firebird
{
class Table;
class Keys: public ::connectivity::OKeysHelper
{
private:
Table* m_pTable;
class Table;
public:
Keys(Table* pTable,
::osl::Mutex& rMutex,
const ::std::vector< OUString>& rNames);
class Keys: public ::connectivity::OKeysHelper
{
private:
Table* m_pTable;
// OKeysHelper / XDrop
void dropObject(sal_Int32 nPosition, const OUString& sName) override;
public:
Keys(Table* pTable,
::osl::Mutex& rMutex,
const ::std::vector< OUString>& rNames);
// OKeysHelper / XDrop
void dropObject(sal_Int32 nPosition, const OUString& sName) override;
};
};
}
@@ -32,120 +32,120 @@
#include <ibase.h>
namespace connectivity::firebird
{
class OResultSetMetaData;
class OBoundParam;
typedef ::cppu::ImplHelper5< css::sdbc::XPreparedStatement,
css::sdbc::XParameters,
css::sdbc::XPreparedBatchExecution,
css::sdbc::XResultSetMetaDataSupplier,
css::lang::XServiceInfo> OPreparedStatement_Base;
class OPreparedStatement : public OStatementCommonBase,
public OPreparedStatement_Base
{
class OResultSetMetaData;
class OBoundParam;
typedef ::cppu::ImplHelper5< css::sdbc::XPreparedStatement,
css::sdbc::XParameters,
css::sdbc::XPreparedBatchExecution,
css::sdbc::XResultSetMetaDataSupplier,
css::lang::XServiceInfo> OPreparedStatement_Base;
protected:
OUString m_sSqlStatement;
rtl::Reference<OResultSetMetaData> m_xMetaData;
class OPreparedStatement : public OStatementCommonBase,
public OPreparedStatement_Base
{
protected:
OUString m_sSqlStatement;
rtl::Reference<OResultSetMetaData> m_xMetaData;
XSQLDA* m_pOutSqlda;
XSQLDA* m_pInSqlda;
/// @throws css::sdbc::SQLException
/// @throws css::uno::RuntimeException
void checkParameterIndex(sal_Int32 nParameterIndex);
XSQLDA* m_pOutSqlda;
XSQLDA* m_pInSqlda;
/// @throws css::sdbc::SQLException
/// @throws css::uno::RuntimeException
void checkParameterIndex(sal_Int32 nParameterIndex);
/**
* Set a numeric value in the input SQLDA. If the destination
* parameter is not of nType then an Exception will be thrown.
*
* @throws css::sdbc::SQLException
* @throws css::uno::RuntimeException
*/
template <typename T> void setValue(sal_Int32 nIndex, const T& nValue, ISC_SHORT nType);
void setParameterNull(sal_Int32 nParameterIndex, bool bSetNull = true);
/**
* Set a numeric value in the input SQLDA. If the destination
* parameter is not of nType then an Exception will be thrown.
*
* @throws css::sdbc::SQLException
* @throws css::uno::RuntimeException
*/
template <typename T> void setValue(sal_Int32 nIndex, const T& nValue, ISC_SHORT nType);
void setParameterNull(sal_Int32 nParameterIndex, bool bSetNull = true);
/// @throws css::sdbc::SQLException
/// @throws css::uno::RuntimeException
void ensurePrepared();
/**
* Assumes that all necessary mutexes have been taken.
*/
void openBlobForWriting(isc_blob_handle& rBlobHandle, ISC_QUAD& rBlobId);
/**
* Assumes that all necessary mutexes have been taken.
*/
void closeBlobAfterWriting(isc_blob_handle& rBlobHandle);
void setClob(sal_Int32 nParamIndex, std::u16string_view rStr);
/// @throws css::sdbc::SQLException
/// @throws css::uno::RuntimeException
void ensurePrepared();
/**
* Assumes that all necessary mutexes have been taken.
*/
void openBlobForWriting(isc_blob_handle& rBlobHandle, ISC_QUAD& rBlobId);
/**
* Assumes that all necessary mutexes have been taken.
*/
void closeBlobAfterWriting(isc_blob_handle& rBlobHandle);
void setClob(sal_Int32 nParamIndex, std::u16string_view rStr);
protected:
virtual void SAL_CALL setFastPropertyValue_NoBroadcast(sal_Int32 nHandle,
const css::uno::Any& rValue) override;
virtual ~OPreparedStatement() override;
public:
DECLARE_SERVICE_INFO();
// a constructor, which is required for returning objects:
OPreparedStatement( Connection* _pConnection,
const OUString& sql);
protected:
virtual void SAL_CALL setFastPropertyValue_NoBroadcast(sal_Int32 nHandle,
const css::uno::Any& rValue) override;
virtual ~OPreparedStatement() override;
public:
DECLARE_SERVICE_INFO();
// a constructor, which is required for returning objects:
OPreparedStatement( Connection* _pConnection,
const OUString& sql);
//XInterface
virtual css::uno::Any SAL_CALL queryInterface( const css::uno::Type & rType ) override;
virtual void SAL_CALL acquire() noexcept override;
virtual void SAL_CALL release() noexcept override;
//XTypeProvider
virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes( ) override;
//XInterface
virtual css::uno::Any SAL_CALL queryInterface( const css::uno::Type & rType ) override;
virtual void SAL_CALL acquire() noexcept override;
virtual void SAL_CALL release() noexcept override;
//XTypeProvider
virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes( ) override;
// XPreparedStatement
virtual css::uno::Reference< css::sdbc::XResultSet > SAL_CALL
executeQuery() override;
virtual sal_Int32 SAL_CALL
executeUpdate() override;
virtual sal_Bool SAL_CALL
execute() override;
virtual css::uno::Reference< css::sdbc::XConnection > SAL_CALL
getConnection() override;
// XPreparedStatement
virtual css::uno::Reference< css::sdbc::XResultSet > SAL_CALL
executeQuery() override;
virtual sal_Int32 SAL_CALL
executeUpdate() override;
virtual sal_Bool SAL_CALL
execute() override;
virtual css::uno::Reference< css::sdbc::XConnection > SAL_CALL
getConnection() override;
// XParameters
virtual void SAL_CALL setNull(sal_Int32 nIndex, sal_Int32 nValue) override;
virtual void SAL_CALL setObjectNull(sal_Int32 parameterIndex, sal_Int32 sqlType, const OUString& typeName ) override;
virtual void SAL_CALL setBoolean( sal_Int32 nIndex, sal_Bool nValue) override;
virtual void SAL_CALL setByte(sal_Int32 nIndex, sal_Int8 nValue) override;
virtual void SAL_CALL setShort(sal_Int32 nIndex, sal_Int16 nValue) override;
virtual void SAL_CALL setInt(sal_Int32 nIndex, sal_Int32 nValue) override;
virtual void SAL_CALL setLong(sal_Int32 nIndex, sal_Int64 nValue) override;
virtual void SAL_CALL setFloat( sal_Int32 parameterIndex, float x ) override;
virtual void SAL_CALL setDouble( sal_Int32 parameterIndex, double x ) override;
virtual void SAL_CALL setString( sal_Int32 parameterIndex, const OUString& x ) override;
virtual void SAL_CALL setBytes( sal_Int32 parameterIndex, const css::uno::Sequence< sal_Int8 >& x ) override;
virtual void SAL_CALL setDate( sal_Int32 parameterIndex, const css::util::Date& x ) override;
virtual void SAL_CALL setTime( sal_Int32 parameterIndex, const css::util::Time& x ) override;
virtual void SAL_CALL setTimestamp( sal_Int32 parameterIndex, const css::util::DateTime& x ) override;
virtual void SAL_CALL setBinaryStream( sal_Int32 parameterIndex, const css::uno::Reference< css::io::XInputStream >& x, sal_Int32 length ) override;
virtual void SAL_CALL setCharacterStream( sal_Int32 parameterIndex, const css::uno::Reference< css::io::XInputStream >& x, sal_Int32 length ) override;
virtual void SAL_CALL setObject( sal_Int32 parameterIndex, const css::uno::Any& x ) override;
virtual void SAL_CALL setObjectWithInfo( sal_Int32 parameterIndex, const css::uno::Any& x, sal_Int32 targetSqlType, sal_Int32 scale ) override;
virtual void SAL_CALL setRef( sal_Int32 parameterIndex, const css::uno::Reference< css::sdbc::XRef >& x ) override;
virtual void SAL_CALL setBlob( sal_Int32 parameterIndex, const css::uno::Reference< css::sdbc::XBlob >& x ) override;
virtual void SAL_CALL setClob( sal_Int32 parameterIndex, const css::uno::Reference< css::sdbc::XClob >& x ) override;
virtual void SAL_CALL setArray( sal_Int32 parameterIndex, const css::uno::Reference< css::sdbc::XArray >& x ) override;
virtual void SAL_CALL clearParameters( ) override;
// XParameters
virtual void SAL_CALL setNull(sal_Int32 nIndex, sal_Int32 nValue) override;
virtual void SAL_CALL setObjectNull(sal_Int32 parameterIndex, sal_Int32 sqlType, const OUString& typeName ) override;
virtual void SAL_CALL setBoolean( sal_Int32 nIndex, sal_Bool nValue) override;
virtual void SAL_CALL setByte(sal_Int32 nIndex, sal_Int8 nValue) override;
virtual void SAL_CALL setShort(sal_Int32 nIndex, sal_Int16 nValue) override;
virtual void SAL_CALL setInt(sal_Int32 nIndex, sal_Int32 nValue) override;
virtual void SAL_CALL setLong(sal_Int32 nIndex, sal_Int64 nValue) override;
virtual void SAL_CALL setFloat( sal_Int32 parameterIndex, float x ) override;
virtual void SAL_CALL setDouble( sal_Int32 parameterIndex, double x ) override;
virtual void SAL_CALL setString( sal_Int32 parameterIndex, const OUString& x ) override;
virtual void SAL_CALL setBytes( sal_Int32 parameterIndex, const css::uno::Sequence< sal_Int8 >& x ) override;
virtual void SAL_CALL setDate( sal_Int32 parameterIndex, const css::util::Date& x ) override;
virtual void SAL_CALL setTime( sal_Int32 parameterIndex, const css::util::Time& x ) override;
virtual void SAL_CALL setTimestamp( sal_Int32 parameterIndex, const css::util::DateTime& x ) override;
virtual void SAL_CALL setBinaryStream( sal_Int32 parameterIndex, const css::uno::Reference< css::io::XInputStream >& x, sal_Int32 length ) override;
virtual void SAL_CALL setCharacterStream( sal_Int32 parameterIndex, const css::uno::Reference< css::io::XInputStream >& x, sal_Int32 length ) override;
virtual void SAL_CALL setObject( sal_Int32 parameterIndex, const css::uno::Any& x ) override;
virtual void SAL_CALL setObjectWithInfo( sal_Int32 parameterIndex, const css::uno::Any& x, sal_Int32 targetSqlType, sal_Int32 scale ) override;
virtual void SAL_CALL setRef( sal_Int32 parameterIndex, const css::uno::Reference< css::sdbc::XRef >& x ) override;
virtual void SAL_CALL setBlob( sal_Int32 parameterIndex, const css::uno::Reference< css::sdbc::XBlob >& x ) override;
virtual void SAL_CALL setClob( sal_Int32 parameterIndex, const css::uno::Reference< css::sdbc::XClob >& x ) override;
virtual void SAL_CALL setArray( sal_Int32 parameterIndex, const css::uno::Reference< css::sdbc::XArray >& x ) override;
virtual void SAL_CALL clearParameters( ) override;
// XPreparedBatchExecution -- UNSUPPORTED by firebird
virtual void SAL_CALL
addBatch() override;
virtual void SAL_CALL
clearBatch() override;
virtual css::uno::Sequence< sal_Int32 > SAL_CALL
executeBatch() override;
// XPreparedBatchExecution -- UNSUPPORTED by firebird
virtual void SAL_CALL
addBatch() override;
virtual void SAL_CALL
clearBatch() override;
virtual css::uno::Sequence< sal_Int32 > SAL_CALL
executeBatch() override;
// XCloseable
virtual void SAL_CALL close() override;
// OComponentHelper
virtual void SAL_CALL disposing() override;
// XCloseable
virtual void SAL_CALL close() override;
// OComponentHelper
virtual void SAL_CALL disposing() override;
// XResultSetMetaDataSupplier
virtual css::uno::Reference< css::sdbc::XResultSetMetaData > SAL_CALL getMetaData( ) override;
// XResultSetMetaDataSupplier
virtual css::uno::Reference< css::sdbc::XResultSetMetaData > SAL_CALL getMetaData( ) override;
};
};
}
+164 -164
View File
@@ -38,181 +38,181 @@
#include <type_traits>
namespace connectivity::firebird
{
class OResultSetMetaData;
/*
** OResultSet
*/
typedef ::cppu::WeakComponentImplHelper< css::sdbc::XResultSet,
css::sdbc::XRow,
css::sdbc::XResultSetMetaDataSupplier,
css::util::XCancellable,
css::sdbc::XCloseable,
css::sdbc::XColumnLocate,
css::lang::XServiceInfo> OResultSet_BASE;
/**
* This ResultSet does not deal with the management of the SQLDA
* it is supplied with. The owner must manage its SQLDA appropriately
* and ensure that the ResultSet is destroyed before disposing of the
* SQLDA.
*/
class OResultSet: public OResultSet_BASE,
public ::comphelper::OPropertyContainer,
public ::comphelper::OPropertyArrayUsageHelper<OResultSet>
{
class OResultSetMetaData;
/*
** OResultSet
*/
typedef ::cppu::WeakComponentImplHelper< css::sdbc::XResultSet,
css::sdbc::XRow,
css::sdbc::XResultSetMetaDataSupplier,
css::util::XCancellable,
css::sdbc::XCloseable,
css::sdbc::XColumnLocate,
css::lang::XServiceInfo> OResultSet_BASE;
private:
bool m_bIsBookmarkable;
sal_Int32 m_nFetchSize;
sal_Int32 m_nResultSetType;
sal_Int32 m_nFetchDirection;
sal_Int32 m_nResultSetConcurrency;
/**
* This ResultSet does not deal with the management of the SQLDA
* it is supplied with. The owner must manage its SQLDA appropriately
* and ensure that the ResultSet is destroyed before disposing of the
* SQLDA.
*/
class OResultSet: public OResultSet_BASE,
public ::comphelper::OPropertyContainer,
public ::comphelper::OPropertyArrayUsageHelper<OResultSet>
{
private:
bool m_bIsBookmarkable;
sal_Int32 m_nFetchSize;
sal_Int32 m_nResultSetType;
sal_Int32 m_nFetchDirection;
sal_Int32 m_nResultSetConcurrency;
protected:
// Connection kept alive by m_xStatement
Connection* m_pConnection;
::osl::Mutex& m_rMutex;
const css::uno::Reference< css::uno::XInterface >& m_xStatement;
protected:
// Connection kept alive by m_xStatement
Connection* m_pConnection;
::osl::Mutex& m_rMutex;
const css::uno::Reference< css::uno::XInterface >& m_xStatement;
rtl::Reference<OResultSetMetaData> m_xMetaData;
rtl::Reference<OResultSetMetaData> m_xMetaData;
XSQLDA* m_pSqlda;
isc_stmt_handle m_statementHandle;
XSQLDA* m_pSqlda;
isc_stmt_handle m_statementHandle;
bool m_bWasNull;
// Row numbering starts with 0 for "in front of first row"
sal_Int32 m_currentRow;
bool m_bIsAfterLastRow;
bool m_bWasNull;
// Row numbering starts with 0 for "in front of first row"
sal_Int32 m_currentRow;
bool m_bIsAfterLastRow;
const sal_Int32 m_fieldCount;
ISC_STATUS_ARRAY m_statusVector;
const sal_Int32 m_fieldCount;
ISC_STATUS_ARRAY m_statusVector;
bool isNull(const sal_Int32 nColumnIndex);
bool isNull(const sal_Int32 nColumnIndex);
template <typename T> requires std::is_integral_v<T>
OUString makeNumericString(const sal_Int32 nColumnIndex);
template <typename T> requires std::is_integral_v<T>
OUString makeNumericString(const sal_Int32 nColumnIndex);
template <typename T> T retrieveValue(const sal_Int32 nColumnIndex,
const ISC_SHORT nType);
template <typename T> T retrieveValue(const sal_Int32 nColumnIndex,
const ISC_SHORT nType);
template <typename T> T safelyRetrieveValue(
const sal_Int32 nColumnIndex,
const ISC_SHORT nType = 0);
// OIdPropertyArrayUsageHelper
virtual ::cppu::IPropertyArrayHelper* createArrayHelper() const override;
virtual ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper() override;
/// @throws css::sdbc::SQLException
/// @throws css::uno::RuntimeException
void checkColumnIndex( sal_Int32 index );
/// @throws css::sdbc::SQLException
/// @throws css::uno::RuntimeException
void checkRowIndex();
// you can't delete objects of this type
virtual ~OResultSet() override;
public:
DECLARE_SERVICE_INFO();
OResultSet(Connection* pConnection,
::osl::Mutex& rMutex,
const css::uno::Reference< css::uno::XInterface >& xStatement,
isc_stmt_handle aStatementHandle,
XSQLDA* aSqlda
);
// XInterface
virtual css::uno::Any SAL_CALL queryInterface(
const css::uno::Type& rType) override;
virtual void SAL_CALL acquire() noexcept override;
virtual void SAL_CALL release() noexcept override;
//XTypeProvider
virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes( ) override;
// XPropertySet
virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) override;
// XResultSet
virtual sal_Bool SAL_CALL next( ) override;
virtual sal_Bool SAL_CALL isBeforeFirst( ) override;
virtual sal_Bool SAL_CALL isAfterLast( ) override;
virtual sal_Bool SAL_CALL isFirst( ) override;
virtual sal_Bool SAL_CALL isLast( ) override;
virtual void SAL_CALL beforeFirst( ) override;
virtual void SAL_CALL afterLast( ) override;
virtual sal_Bool SAL_CALL first( ) override;
virtual sal_Bool SAL_CALL last( ) override;
virtual sal_Int32 SAL_CALL getRow( ) override;
virtual sal_Bool SAL_CALL absolute( sal_Int32 row ) override;
virtual sal_Bool SAL_CALL relative( sal_Int32 rows ) override;
virtual sal_Bool SAL_CALL previous( ) override;
virtual void SAL_CALL refreshRow( ) override;
virtual sal_Bool SAL_CALL rowUpdated( ) override;
virtual sal_Bool SAL_CALL rowInserted( ) override;
virtual sal_Bool SAL_CALL rowDeleted( ) override;
virtual css::uno::Reference< css::uno::XInterface > SAL_CALL getStatement( ) override;
// XRow
virtual sal_Bool SAL_CALL wasNull( ) override;
virtual OUString SAL_CALL getString( sal_Int32 columnIndex ) override;
virtual sal_Bool SAL_CALL getBoolean( sal_Int32 columnIndex ) override;
virtual sal_Int8 SAL_CALL getByte( sal_Int32 columnIndex ) override;
virtual sal_Int16 SAL_CALL getShort( sal_Int32 columnIndex ) override;
virtual sal_Int32 SAL_CALL getInt( sal_Int32 columnIndex ) override;
virtual sal_Int64 SAL_CALL getLong( sal_Int32 columnIndex ) override;
virtual float SAL_CALL getFloat( sal_Int32 columnIndex ) override;
virtual double SAL_CALL getDouble( sal_Int32 columnIndex ) override;
virtual css::uno::Sequence< sal_Int8 > SAL_CALL getBytes( sal_Int32 columnIndex ) override;
virtual css::util::Date SAL_CALL getDate( sal_Int32 columnIndex ) override;
virtual css::util::Time SAL_CALL getTime( sal_Int32 columnIndex ) override;
virtual css::util::DateTime SAL_CALL getTimestamp( sal_Int32 columnIndex ) override;
virtual css::uno::Reference< css::io::XInputStream > SAL_CALL getBinaryStream( sal_Int32 columnIndex ) override;
virtual css::uno::Reference< css::io::XInputStream > SAL_CALL getCharacterStream( sal_Int32 columnIndex ) override;
virtual css::uno::Any SAL_CALL getObject( sal_Int32 columnIndex, const css::uno::Reference< css::container::XNameAccess >& typeMap ) override;
virtual css::uno::Reference< css::sdbc::XRef > SAL_CALL getRef( sal_Int32 columnIndex ) override;
virtual css::uno::Reference< css::sdbc::XBlob > SAL_CALL getBlob( sal_Int32 columnIndex ) override;
virtual css::uno::Reference< css::sdbc::XClob > SAL_CALL getClob( sal_Int32 columnIndex ) override;
virtual css::uno::Reference< css::sdbc::XArray > SAL_CALL getArray( sal_Int32 columnIndex ) override;
// XResultSetMetaDataSupplier
virtual css::uno::Reference< css::sdbc::XResultSetMetaData > SAL_CALL getMetaData( ) override;
// XCancellable
virtual void SAL_CALL cancel( ) override;
// XCloseable
virtual void SAL_CALL close( ) override;
// XWarningsSupplier
// XColumnLocate
virtual sal_Int32 SAL_CALL findColumn(const OUString& columnName) override;
};
// Specialisations have to be in the namespace and can't be within the class.
template <> css::util::Date
OResultSet::retrieveValue(
template <typename T> T safelyRetrieveValue(
const sal_Int32 nColumnIndex,
const ISC_SHORT nType);
template <> ::connectivity::ORowSetValue
OResultSet::retrieveValue(
const sal_Int32 nColumnIndex,
const ISC_SHORT nType);
template <> css::util::Time
OResultSet::retrieveValue(
const sal_Int32 nColumnIndex,
const ISC_SHORT nType);
template <> css::util::DateTime
OResultSet::retrieveValue(
const sal_Int32 nColumnIndex,
const ISC_SHORT nType);
template <> ISC_QUAD*
OResultSet::retrieveValue(
const sal_Int32 nColumnIndex,
const ISC_SHORT nType);
template <> OUString
OResultSet::retrieveValue(
const sal_Int32 nColumnIndex,
const ISC_SHORT nType);
template <> ISC_QUAD*
OResultSet::retrieveValue(
const sal_Int32 nColumnIndex,
const ISC_SHORT nType);
const ISC_SHORT nType = 0);
// OIdPropertyArrayUsageHelper
virtual ::cppu::IPropertyArrayHelper* createArrayHelper() const override;
virtual ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper() override;
/// @throws css::sdbc::SQLException
/// @throws css::uno::RuntimeException
void checkColumnIndex( sal_Int32 index );
/// @throws css::sdbc::SQLException
/// @throws css::uno::RuntimeException
void checkRowIndex();
// you can't delete objects of this type
virtual ~OResultSet() override;
public:
DECLARE_SERVICE_INFO();
OResultSet(Connection* pConnection,
::osl::Mutex& rMutex,
const css::uno::Reference< css::uno::XInterface >& xStatement,
isc_stmt_handle aStatementHandle,
XSQLDA* aSqlda
);
// XInterface
virtual css::uno::Any SAL_CALL queryInterface(
const css::uno::Type& rType) override;
virtual void SAL_CALL acquire() noexcept override;
virtual void SAL_CALL release() noexcept override;
//XTypeProvider
virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes( ) override;
// XPropertySet
virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) override;
// XResultSet
virtual sal_Bool SAL_CALL next( ) override;
virtual sal_Bool SAL_CALL isBeforeFirst( ) override;
virtual sal_Bool SAL_CALL isAfterLast( ) override;
virtual sal_Bool SAL_CALL isFirst( ) override;
virtual sal_Bool SAL_CALL isLast( ) override;
virtual void SAL_CALL beforeFirst( ) override;
virtual void SAL_CALL afterLast( ) override;
virtual sal_Bool SAL_CALL first( ) override;
virtual sal_Bool SAL_CALL last( ) override;
virtual sal_Int32 SAL_CALL getRow( ) override;
virtual sal_Bool SAL_CALL absolute( sal_Int32 row ) override;
virtual sal_Bool SAL_CALL relative( sal_Int32 rows ) override;
virtual sal_Bool SAL_CALL previous( ) override;
virtual void SAL_CALL refreshRow( ) override;
virtual sal_Bool SAL_CALL rowUpdated( ) override;
virtual sal_Bool SAL_CALL rowInserted( ) override;
virtual sal_Bool SAL_CALL rowDeleted( ) override;
virtual css::uno::Reference< css::uno::XInterface > SAL_CALL getStatement( ) override;
// XRow
virtual sal_Bool SAL_CALL wasNull( ) override;
virtual OUString SAL_CALL getString( sal_Int32 columnIndex ) override;
virtual sal_Bool SAL_CALL getBoolean( sal_Int32 columnIndex ) override;
virtual sal_Int8 SAL_CALL getByte( sal_Int32 columnIndex ) override;
virtual sal_Int16 SAL_CALL getShort( sal_Int32 columnIndex ) override;
virtual sal_Int32 SAL_CALL getInt( sal_Int32 columnIndex ) override;
virtual sal_Int64 SAL_CALL getLong( sal_Int32 columnIndex ) override;
virtual float SAL_CALL getFloat( sal_Int32 columnIndex ) override;
virtual double SAL_CALL getDouble( sal_Int32 columnIndex ) override;
virtual css::uno::Sequence< sal_Int8 > SAL_CALL getBytes( sal_Int32 columnIndex ) override;
virtual css::util::Date SAL_CALL getDate( sal_Int32 columnIndex ) override;
virtual css::util::Time SAL_CALL getTime( sal_Int32 columnIndex ) override;
virtual css::util::DateTime SAL_CALL getTimestamp( sal_Int32 columnIndex ) override;
virtual css::uno::Reference< css::io::XInputStream > SAL_CALL getBinaryStream( sal_Int32 columnIndex ) override;
virtual css::uno::Reference< css::io::XInputStream > SAL_CALL getCharacterStream( sal_Int32 columnIndex ) override;
virtual css::uno::Any SAL_CALL getObject( sal_Int32 columnIndex, const css::uno::Reference< css::container::XNameAccess >& typeMap ) override;
virtual css::uno::Reference< css::sdbc::XRef > SAL_CALL getRef( sal_Int32 columnIndex ) override;
virtual css::uno::Reference< css::sdbc::XBlob > SAL_CALL getBlob( sal_Int32 columnIndex ) override;
virtual css::uno::Reference< css::sdbc::XClob > SAL_CALL getClob( sal_Int32 columnIndex ) override;
virtual css::uno::Reference< css::sdbc::XArray > SAL_CALL getArray( sal_Int32 columnIndex ) override;
// XResultSetMetaDataSupplier
virtual css::uno::Reference< css::sdbc::XResultSetMetaData > SAL_CALL getMetaData( ) override;
// XCancellable
virtual void SAL_CALL cancel( ) override;
// XCloseable
virtual void SAL_CALL close( ) override;
// XWarningsSupplier
// XColumnLocate
virtual sal_Int32 SAL_CALL findColumn(const OUString& columnName) override;
};
// Specialisations have to be in the namespace and can't be within the class.
template <> css::util::Date
OResultSet::retrieveValue(
const sal_Int32 nColumnIndex,
const ISC_SHORT nType);
template <> ::connectivity::ORowSetValue
OResultSet::retrieveValue(
const sal_Int32 nColumnIndex,
const ISC_SHORT nType);
template <> css::util::Time
OResultSet::retrieveValue(
const sal_Int32 nColumnIndex,
const ISC_SHORT nType);
template <> css::util::DateTime
OResultSet::retrieveValue(
const sal_Int32 nColumnIndex,
const ISC_SHORT nType);
template <> ISC_QUAD*
OResultSet::retrieveValue(
const sal_Int32 nColumnIndex,
const ISC_SHORT nType);
template <> OUString
OResultSet::retrieveValue(
const sal_Int32 nColumnIndex,
const ISC_SHORT nType);
template <> ISC_QUAD*
OResultSet::retrieveValue(
const sal_Int32 nColumnIndex,
const ISC_SHORT nType);
}
@@ -29,51 +29,51 @@
#include <com/sun/star/sdbc/XResultSetMetaData.hpp>
namespace connectivity::firebird
{
typedef ::cppu::WeakImplHelper< css::sdbc::XResultSetMetaData>
OResultSetMetaData_BASE;
class OResultSetMetaData : public OResultSetMetaData_BASE
{
typedef ::cppu::WeakImplHelper< css::sdbc::XResultSetMetaData>
OResultSetMetaData_BASE;
protected:
::rtl::Reference<Connection> m_pConnection;
XSQLDA* m_pSqlda;
class OResultSetMetaData : public OResultSetMetaData_BASE
{
protected:
::rtl::Reference<Connection> m_pConnection;
XSQLDA* m_pSqlda;
virtual ~OResultSetMetaData() override;
virtual ~OResultSetMetaData() override;
/// @throws css::sdbc::SQLException
void verifyValidColumn(sal_Int32 column);
OUString getCharacterSet(sal_Int32 nIndex);
public:
// a constructor, which is required for returning objects:
OResultSetMetaData(Connection* pConnection,
XSQLDA* pSqlda)
: m_pConnection(pConnection)
, m_pSqlda(pSqlda)
{}
/// @throws css::sdbc::SQLException
void verifyValidColumn(sal_Int32 column);
OUString getCharacterSet(sal_Int32 nIndex);
public:
// a constructor, which is required for returning objects:
OResultSetMetaData(Connection* pConnection,
XSQLDA* pSqlda)
: m_pConnection(pConnection)
, m_pSqlda(pSqlda)
{}
virtual sal_Int32 SAL_CALL getColumnCount() override;
virtual sal_Bool SAL_CALL isAutoIncrement(sal_Int32 column) override;
virtual sal_Bool SAL_CALL isCaseSensitive(sal_Int32 column) override;
virtual sal_Bool SAL_CALL isSearchable(sal_Int32 column) override;
virtual sal_Bool SAL_CALL isCurrency(sal_Int32 column) override;
virtual sal_Int32 SAL_CALL isNullable(sal_Int32 column) override;
virtual sal_Bool SAL_CALL isSigned(sal_Int32 column) override;
virtual sal_Int32 SAL_CALL getColumnDisplaySize(sal_Int32 column) override;
virtual OUString SAL_CALL getColumnLabel(sal_Int32 column) override;
virtual OUString SAL_CALL getColumnName(sal_Int32 column) override;
virtual OUString SAL_CALL getSchemaName(sal_Int32 column) override;
virtual sal_Int32 SAL_CALL getPrecision(sal_Int32 column) override;
virtual sal_Int32 SAL_CALL getScale(sal_Int32 column) override;
virtual OUString SAL_CALL getTableName(sal_Int32 column) override;
virtual OUString SAL_CALL getCatalogName(sal_Int32 column) override;
virtual sal_Int32 SAL_CALL getColumnType(sal_Int32 column) override;
virtual OUString SAL_CALL getColumnTypeName(sal_Int32 column) override;
virtual sal_Bool SAL_CALL isReadOnly(sal_Int32 column) override;
virtual sal_Bool SAL_CALL isWritable(sal_Int32 column) override;
virtual sal_Bool SAL_CALL isDefinitelyWritable(sal_Int32 column) override;
virtual OUString SAL_CALL getColumnServiceName(sal_Int32 column) override;
};
virtual sal_Int32 SAL_CALL getColumnCount() override;
virtual sal_Bool SAL_CALL isAutoIncrement(sal_Int32 column) override;
virtual sal_Bool SAL_CALL isCaseSensitive(sal_Int32 column) override;
virtual sal_Bool SAL_CALL isSearchable(sal_Int32 column) override;
virtual sal_Bool SAL_CALL isCurrency(sal_Int32 column) override;
virtual sal_Int32 SAL_CALL isNullable(sal_Int32 column) override;
virtual sal_Bool SAL_CALL isSigned(sal_Int32 column) override;
virtual sal_Int32 SAL_CALL getColumnDisplaySize(sal_Int32 column) override;
virtual OUString SAL_CALL getColumnLabel(sal_Int32 column) override;
virtual OUString SAL_CALL getColumnName(sal_Int32 column) override;
virtual OUString SAL_CALL getSchemaName(sal_Int32 column) override;
virtual sal_Int32 SAL_CALL getPrecision(sal_Int32 column) override;
virtual sal_Int32 SAL_CALL getScale(sal_Int32 column) override;
virtual OUString SAL_CALL getTableName(sal_Int32 column) override;
virtual OUString SAL_CALL getCatalogName(sal_Int32 column) override;
virtual sal_Int32 SAL_CALL getColumnType(sal_Int32 column) override;
virtual OUString SAL_CALL getColumnTypeName(sal_Int32 column) override;
virtual sal_Bool SAL_CALL isReadOnly(sal_Int32 column) override;
virtual sal_Bool SAL_CALL isWritable(sal_Int32 column) override;
virtual sal_Bool SAL_CALL isDefinitelyWritable(sal_Int32 column) override;
virtual OUString SAL_CALL getColumnServiceName(sal_Int32 column) override;
};
}
@@ -25,59 +25,59 @@
#include <com/sun/star/sdbc/XBatchExecution.hpp>
namespace connectivity::firebird
{
typedef ::cppu::ImplHelper1< css::sdbc::XStatement >
OStatement_Base;
class OStatement : public OStatementCommonBase,
public OStatement_Base,
public css::sdbc::XBatchExecution,
public css::lang::XServiceInfo
{
XSQLDA* m_pSqlda;
protected:
virtual ~OStatement() override {}
typedef ::cppu::ImplHelper1< css::sdbc::XStatement >
OStatement_Base;
public:
// a constructor, which is required for returning objects:
explicit OStatement( Connection* _pConnection)
: OStatementCommonBase( _pConnection),
m_pSqlda(nullptr)
{}
class OStatement : public OStatementCommonBase,
public OStatement_Base,
public css::sdbc::XBatchExecution,
public css::lang::XServiceInfo
{
XSQLDA* m_pSqlda;
protected:
virtual ~OStatement() override {}
virtual void disposeResultSet() override;
public:
// a constructor, which is required for returning objects:
explicit OStatement( Connection* _pConnection)
: OStatementCommonBase( _pConnection),
m_pSqlda(nullptr)
{}
DECLARE_SERVICE_INFO();
virtual void disposeResultSet() override;
virtual void SAL_CALL acquire() noexcept override;
virtual void SAL_CALL release() noexcept override;
DECLARE_SERVICE_INFO();
// XStatement
virtual css::uno::Reference< css::sdbc::XResultSet > SAL_CALL
executeQuery(const OUString& sql) override;
virtual sal_Int32 SAL_CALL executeUpdate(const OUString& sqlIn) override;
virtual sal_Bool SAL_CALL
execute(const OUString& sql) override;
virtual css::uno::Reference< css::sdbc::XConnection > SAL_CALL
getConnection() override;
virtual void SAL_CALL acquire() noexcept override;
virtual void SAL_CALL release() noexcept override;
// XBatchExecution - UNSUPPORTED
virtual void SAL_CALL addBatch( const OUString& sql ) override;
virtual void SAL_CALL clearBatch( ) override;
virtual css::uno::Sequence< sal_Int32 > SAL_CALL executeBatch( ) override;
// XStatement
virtual css::uno::Reference< css::sdbc::XResultSet > SAL_CALL
executeQuery(const OUString& sql) override;
virtual sal_Int32 SAL_CALL executeUpdate(const OUString& sqlIn) override;
virtual sal_Bool SAL_CALL
execute(const OUString& sql) override;
virtual css::uno::Reference< css::sdbc::XConnection > SAL_CALL
getConnection() override;
// XInterface
virtual css::uno::Any SAL_CALL
queryInterface(const css::uno::Type & rType) override;
// XBatchExecution - UNSUPPORTED
virtual void SAL_CALL addBatch( const OUString& sql ) override;
virtual void SAL_CALL clearBatch( ) override;
virtual css::uno::Sequence< sal_Int32 > SAL_CALL executeBatch( ) override;
//XTypeProvider
virtual css::uno::Sequence< css::uno::Type > SAL_CALL
getTypes() override;
// OComponentHelper
virtual void SAL_CALL disposing() override;
// XInterface
virtual css::uno::Any SAL_CALL
queryInterface(const css::uno::Type & rType) override;
//XTypeProvider
virtual css::uno::Sequence< css::uno::Type > SAL_CALL
getTypes() override;
// OComponentHelper
virtual void SAL_CALL disposing() override;
};
};
}
@@ -37,98 +37,98 @@
#include <com/sun/star/util/XCancellable.hpp>
namespace connectivity::firebird
{
class OResultSet;
typedef ::cppu::WeakComponentImplHelper< css::sdbc::XWarningsSupplier,
css::util::XCancellable,
css::sdbc::XCloseable,
css::sdbc::XMultipleResults> OStatementCommonBase_Base;
class OStatementCommonBase : public OStatementCommonBase_Base,
public ::cppu::OPropertySetHelper,
public OPropertyArrayUsageHelper<OStatementCommonBase>
{
class OResultSet;
protected:
::osl::Mutex m_aMutex;
typedef ::cppu::WeakComponentImplHelper< css::sdbc::XWarningsSupplier,
css::util::XCancellable,
css::sdbc::XCloseable,
css::sdbc::XMultipleResults> OStatementCommonBase_Base;
rtl::Reference<OResultSet> m_xResultSet; // The last ResultSet created
// for this Statement
class OStatementCommonBase : public OStatementCommonBase_Base,
public ::cppu::OPropertySetHelper,
public OPropertyArrayUsageHelper<OStatementCommonBase>
::rtl::Reference<Connection> m_pConnection;
{
protected:
::osl::Mutex m_aMutex;
ISC_STATUS_ARRAY m_statusVector;
isc_stmt_handle m_aStatementHandle;
rtl::Reference<OResultSet> m_xResultSet; // The last ResultSet created
// for this Statement
protected:
virtual void disposeResultSet();
/// @throws css::sdbc::SQLException
void freeStatementHandle();
::rtl::Reference<Connection> m_pConnection;
// OPropertyArrayUsageHelper
virtual ::cppu::IPropertyArrayHelper* createArrayHelper( ) const override;
// OPropertySetHelper
using OPropertySetHelper::getFastPropertyValue;
virtual ::cppu::IPropertyArrayHelper & SAL_CALL getInfoHelper() override;
virtual sal_Bool SAL_CALL convertFastPropertyValue(
css::uno::Any & rConvertedValue,
css::uno::Any & rOldValue,
sal_Int32 nHandle,
const css::uno::Any& rValue ) override;
virtual void SAL_CALL setFastPropertyValue_NoBroadcast(
sal_Int32 nHandle,
const css::uno::Any& rValue) override;
virtual void SAL_CALL getFastPropertyValue(
css::uno::Any& rValue,
sal_Int32 nHandle) const override;
virtual ~OStatementCommonBase() override;
ISC_STATUS_ARRAY m_statusVector;
isc_stmt_handle m_aStatementHandle;
/// @throws css::sdbc::SQLException
void prepareAndDescribeStatement(std::u16string_view sqlIn, XSQLDA*& pOutSqlda);
protected:
virtual void disposeResultSet();
/// @throws css::sdbc::SQLException
void freeStatementHandle();
/// @throws css::sdbc::SQLException
short getSqlInfoItem(char aInfoItem);
/// @throws css::sdbc::SQLException
bool isDDLStatement();
/// @throws css::sdbc::SQLException
sal_Int32 getStatementChangeCount();
// OPropertyArrayUsageHelper
virtual ::cppu::IPropertyArrayHelper* createArrayHelper( ) const override;
// OPropertySetHelper
using OPropertySetHelper::getFastPropertyValue;
virtual ::cppu::IPropertyArrayHelper & SAL_CALL getInfoHelper() override;
virtual sal_Bool SAL_CALL convertFastPropertyValue(
css::uno::Any & rConvertedValue,
css::uno::Any & rOldValue,
sal_Int32 nHandle,
const css::uno::Any& rValue ) override;
virtual void SAL_CALL setFastPropertyValue_NoBroadcast(
sal_Int32 nHandle,
const css::uno::Any& rValue) override;
virtual void SAL_CALL getFastPropertyValue(
css::uno::Any& rValue,
sal_Int32 nHandle) const override;
virtual ~OStatementCommonBase() override;
public:
/// @throws css::sdbc::SQLException
void prepareAndDescribeStatement(std::u16string_view sqlIn, XSQLDA*& pOutSqlda);
explicit OStatementCommonBase(Connection* _pConnection);
using OStatementCommonBase_Base::operator css::uno::Reference< css::uno::XInterface >;
/// @throws css::sdbc::SQLException
short getSqlInfoItem(char aInfoItem);
/// @throws css::sdbc::SQLException
bool isDDLStatement();
/// @throws css::sdbc::SQLException
sal_Int32 getStatementChangeCount();
// OComponentHelper
virtual void SAL_CALL disposing() override {
disposeResultSet();
OStatementCommonBase_Base::disposing();
}
// XInterface
virtual void SAL_CALL release() noexcept override;
virtual void SAL_CALL acquire() noexcept override;
// XInterface
virtual css::uno::Any SAL_CALL queryInterface( const css::uno::Type & rType ) override;
//XTypeProvider
virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes( ) override;
public:
// XPropertySet
virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) override;
explicit OStatementCommonBase(Connection* _pConnection);
using OStatementCommonBase_Base::operator css::uno::Reference< css::uno::XInterface >;
// XWarningsSupplier - UNSUPPORTED
virtual css::uno::Any SAL_CALL getWarnings( ) override;
virtual void SAL_CALL clearWarnings( ) override;
// XMultipleResults - UNSUPPORTED
virtual css::uno::Reference< css::sdbc::XResultSet > SAL_CALL getResultSet( ) override;
virtual sal_Int32 SAL_CALL getUpdateCount( ) override;
virtual sal_Bool SAL_CALL getMoreResults( ) override;
// OComponentHelper
virtual void SAL_CALL disposing() override {
disposeResultSet();
OStatementCommonBase_Base::disposing();
}
// XInterface
virtual void SAL_CALL release() noexcept override;
virtual void SAL_CALL acquire() noexcept override;
// XInterface
virtual css::uno::Any SAL_CALL queryInterface( const css::uno::Type & rType ) override;
//XTypeProvider
virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes( ) override;
// XCancellable
virtual void SAL_CALL cancel( ) override;
// XCloseable
virtual void SAL_CALL close( ) override;
// XPropertySet
virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) override;
// XWarningsSupplier - UNSUPPORTED
virtual css::uno::Any SAL_CALL getWarnings( ) override;
virtual void SAL_CALL clearWarnings( ) override;
// XMultipleResults - UNSUPPORTED
virtual css::uno::Reference< css::sdbc::XResultSet > SAL_CALL getResultSet( ) override;
virtual sal_Int32 SAL_CALL getUpdateCount( ) override;
virtual sal_Bool SAL_CALL getMoreResults( ) override;
// XCancellable
virtual void SAL_CALL cancel( ) override;
// XCloseable
virtual void SAL_CALL close( ) override;
};
};
}
@@ -27,84 +27,84 @@ namespace cppu { class IPropertyArrayHelper; }
namespace com::sun::star::lang { class XComponent; }
namespace connectivity::firebird
{
/// @throws css::lang::DisposedException
void checkDisposed(bool _bThrow);
template <class TYPE>
class OPropertyArrayUsageHelper
{
/// @throws css::lang::DisposedException
void checkDisposed(bool _bThrow);
protected:
static sal_Int32 s_nRefCount;
static ::cppu::IPropertyArrayHelper* s_pProps;
static ::osl::Mutex s_aMutex;
public:
OPropertyArrayUsageHelper();
virtual ~OPropertyArrayUsageHelper();
/** call this in the getInfoHelper method of your derived class. The method returns the array helper of the
class, which is created if necessary.
*/
::cppu::IPropertyArrayHelper* getArrayHelper();
protected:
/** used to implement the creation of the array helper which is shared amongst all instances of the class.
This method needs to be implemented in derived classes.
<BR>
The method gets called with s_aMutex acquired.
@return a 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>
::cppu::IPropertyArrayHelper* OPropertyArrayUsageHelper< TYPE >::s_pProps = nullptr;
template<class TYPE>
::osl::Mutex OPropertyArrayUsageHelper< TYPE >::s_aMutex;
template <class TYPE>
class OPropertyArrayUsageHelper
template <class TYPE>
OPropertyArrayUsageHelper<TYPE>::OPropertyArrayUsageHelper()
{
::osl::MutexGuard aGuard(s_aMutex);
++s_nRefCount;
}
template <class TYPE>
OPropertyArrayUsageHelper<TYPE>::~OPropertyArrayUsageHelper()
{
::osl::MutexGuard aGuard(s_aMutex);
OSL_ENSURE(s_nRefCount > 0, "OPropertyArrayUsageHelper::~OPropertyArrayUsageHelper : suspicious call : have a refcount of 0 !");
if (!--s_nRefCount)
{
protected:
static sal_Int32 s_nRefCount;
static ::cppu::IPropertyArrayHelper* s_pProps;
static ::osl::Mutex s_aMutex;
public:
OPropertyArrayUsageHelper();
virtual ~OPropertyArrayUsageHelper();
/** call this in the getInfoHelper method of your derived class. The method returns the array helper of the
class, which is created if necessary.
*/
::cppu::IPropertyArrayHelper* getArrayHelper();
protected:
/** used to implement the creation of the array helper which is shared amongst all instances of the class.
This method needs to be implemented in derived classes.
<BR>
The method gets called with s_aMutex acquired.
@return a 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>
::cppu::IPropertyArrayHelper* OPropertyArrayUsageHelper< TYPE >::s_pProps = nullptr;
template<class TYPE>
::osl::Mutex OPropertyArrayUsageHelper< TYPE >::s_aMutex;
delete s_pProps;
s_pProps = nullptr;
}
}
template <class TYPE>
OPropertyArrayUsageHelper<TYPE>::OPropertyArrayUsageHelper()
template <class TYPE>
::cppu::IPropertyArrayHelper* OPropertyArrayUsageHelper<TYPE>::getArrayHelper()
{
OSL_ENSURE(s_nRefCount, "OPropertyArrayUsageHelper::getArrayHelper : suspicious call : have a refcount of 0 !");
if (!s_pProps)
{
::osl::MutexGuard aGuard(s_aMutex);
++s_nRefCount;
}
template <class TYPE>
OPropertyArrayUsageHelper<TYPE>::~OPropertyArrayUsageHelper()
{
::osl::MutexGuard aGuard(s_aMutex);
OSL_ENSURE(s_nRefCount > 0, "OPropertyArrayUsageHelper::~OPropertyArrayUsageHelper : suspicious call : have a refcount of 0 !");
if (!--s_nRefCount)
{
delete s_pProps;
s_pProps = nullptr;
}
}
template <class TYPE>
::cppu::IPropertyArrayHelper* OPropertyArrayUsageHelper<TYPE>::getArrayHelper()
{
OSL_ENSURE(s_nRefCount, "OPropertyArrayUsageHelper::getArrayHelper : suspicious call : have a refcount of 0 !");
if (!s_pProps)
{
::osl::MutexGuard aGuard(s_aMutex);
if (!s_pProps)
{
s_pProps = createArrayHelper();
OSL_ENSURE(s_pProps, "OPropertyArrayUsageHelper::getArrayHelper : createArrayHelper returned nonsense !");
}
s_pProps = createArrayHelper();
OSL_ENSURE(s_pProps, "OPropertyArrayUsageHelper::getArrayHelper : createArrayHelper returned nonsense !");
}
return s_pProps;
}
return s_pProps;
}
}
+46 -46
View File
@@ -18,63 +18,63 @@
#include <connectivity/TTableHelper.hxx>
namespace connectivity::firebird
{
/**
* Implements sdbcx.Table. We don't support table renaming (XRename)
* hence the appropriate methods are overridden.
*/
class Table: public OTableHelper
{
private:
::osl::Mutex& m_rMutex;
sal_Int32 m_nPrivileges;
/**
* Implements sdbcx.Table. We don't support table renaming (XRename)
* hence the appropriate methods are overridden.
* Get the ALTER TABLE [TABLE] ALTER [COLUMN] String.
* Includes a trailing space.
*/
class Table: public OTableHelper
{
private:
::osl::Mutex& m_rMutex;
sal_Int32 m_nPrivileges;
OUString getAlterTableColumn(std::u16string_view rColumn);
/**
* Get the ALTER TABLE [TABLE] ALTER [COLUMN] String.
* Includes a trailing space.
*/
OUString getAlterTableColumn(std::u16string_view rColumn);
protected:
void construct() override;
protected:
void construct() override;
public:
Table(Tables* pTables,
::osl::Mutex& rMutex,
const css::uno::Reference< css::sdbc::XConnection >& _xConnection);
Table(Tables* pTables,
::osl::Mutex& rMutex,
const css::uno::Reference< css::sdbc::XConnection >& _xConnection,
const OUString& rName,
const OUString& rType,
const OUString& rDescription);
public:
Table(Tables* pTables,
::osl::Mutex& rMutex,
const css::uno::Reference< css::sdbc::XConnection >& _xConnection);
Table(Tables* pTables,
::osl::Mutex& rMutex,
const css::uno::Reference< css::sdbc::XConnection >& _xConnection,
const OUString& rName,
const OUString& rType,
const OUString& rDescription);
// OTableHelper
virtual ::connectivity::sdbcx::OCollection* createColumns(
const ::std::vector< OUString>& rNames) override;
virtual ::connectivity::sdbcx::OCollection* createKeys(
const ::std::vector< OUString>& rNames) override;
virtual ::connectivity::sdbcx::OCollection* createIndexes(
const ::std::vector< OUString>& rNames) override;
// OTableHelper
virtual ::connectivity::sdbcx::OCollection* createColumns(
const ::std::vector< OUString>& rNames) override;
virtual ::connectivity::sdbcx::OCollection* createKeys(
const ::std::vector< OUString>& rNames) override;
virtual ::connectivity::sdbcx::OCollection* createIndexes(
const ::std::vector< OUString>& rNames) override;
// XAlterTable
/**
* See css::sdbcx::ColumnDescriptor for details of
* rDescriptor.
*/
virtual void SAL_CALL alterColumnByName(
const OUString& rColName,
const css::uno::Reference< css::beans::XPropertySet >& rDescriptor) override;
// XAlterTable
/**
* See css::sdbcx::ColumnDescriptor for details of
* rDescriptor.
*/
virtual void SAL_CALL alterColumnByName(
const OUString& rColName,
const css::uno::Reference< css::beans::XPropertySet >& rDescriptor) override;
// XRename -- UNSUPPORTED
virtual void SAL_CALL rename(const OUString& sName) override;
// XRename -- UNSUPPORTED
virtual void SAL_CALL rename(const OUString& sName) override;
//XInterface
virtual css::uno::Any
SAL_CALL queryInterface(const css::uno::Type & rType) override;
//XInterface
virtual css::uno::Any
SAL_CALL queryInterface(const css::uno::Type & rType) override;
};
};
} // namespace connectivity::firebird
+31 -31
View File
@@ -16,45 +16,45 @@
#include <utility>
namespace connectivity::firebird
{
/**
* This implements com.sun.star.sdbcx.Container, which seems to be
* also known by the name of Tables and Collection.
*/
class Tables: public ::connectivity::sdbcx::OCollection
{
protected:
css::uno::Reference< css::sdbc::XDatabaseMetaData >
m_xMetaData;
/**
* This implements com.sun.star.sdbcx.Container, which seems to be
* also known by the name of Tables and Collection.
*/
class Tables: public ::connectivity::sdbcx::OCollection
{
protected:
css::uno::Reference< css::sdbc::XDatabaseMetaData >
m_xMetaData;
static OUString createStandardColumnPart(const css::uno::Reference< css::beans::XPropertySet >& xColProp,const css::uno::Reference< css::sdbc::XConnection>& _xConnection);
static OUString createStandardColumnPart(const css::uno::Reference< css::beans::XPropertySet >& xColProp,const css::uno::Reference< css::sdbc::XConnection>& _xConnection);
// OCollection
virtual void impl_refresh() override;
virtual css::uno::Reference< css::beans::XPropertySet > createObject(
const OUString& rName) override;
virtual css::uno::Reference< css::beans::XPropertySet >
createDescriptor() override;
virtual css::uno::Reference< css::beans::XPropertySet > appendObject(
const OUString& rName,
const css::uno::Reference< css::beans::XPropertySet >& rDescriptor) override;
// OCollection
virtual void impl_refresh() override;
virtual css::uno::Reference< css::beans::XPropertySet > createObject(
const OUString& rName) override;
virtual css::uno::Reference< css::beans::XPropertySet >
createDescriptor() override;
virtual css::uno::Reference< css::beans::XPropertySet > appendObject(
const OUString& rName,
const css::uno::Reference< css::beans::XPropertySet >& rDescriptor) override;
public:
Tables(css::uno::Reference< css::sdbc::XDatabaseMetaData > xMetaData,
::cppu::OWeakObject& rParent,
::osl::Mutex& rMutex,
::std::vector< OUString> const & rNames) : sdbcx::OCollection(rParent, true, rMutex, rNames), m_xMetaData(std::move(xMetaData)) {}
public:
Tables(css::uno::Reference< css::sdbc::XDatabaseMetaData > xMetaData,
::cppu::OWeakObject& rParent,
::osl::Mutex& rMutex,
::std::vector< OUString> const & rNames) : sdbcx::OCollection(rParent, true, rMutex, rNames), m_xMetaData(std::move(xMetaData)) {}
// TODO: we should also implement XDataDescriptorFactory, XRefreshable,
// XAppend, etc., but all are optional.
// TODO: we should also implement XDataDescriptorFactory, XRefreshable,
// XAppend, etc., but all are optional.
// XDrop
virtual void dropObject(sal_Int32 nPosition, const OUString& rName) override;
// XDrop
virtual void dropObject(sal_Int32 nPosition, const OUString& rName) override;
void appendNew(const OUString& _rsNewTable);
void appendNew(const OUString& _rsNewTable);
};
};
} // namespace connectivity::firebird
+21 -21
View File
@@ -13,33 +13,33 @@
#include <com/sun/star/sdbc/XConnection.hpp>
namespace connectivity::firebird
{
/**
* This implements com.sun.star.sdbcx.Container.
*/
class User: public ::connectivity::sdbcx::OUser
{
css::uno::Reference< css::sdbc::XConnection > m_xConnection;
public:
/**
* This implements com.sun.star.sdbcx.Container.
* Create a "new" descriptor, which isn't yet in the database.
*/
class User: public ::connectivity::sdbcx::OUser
{
css::uno::Reference< css::sdbc::XConnection > m_xConnection;
User(const css::uno::Reference< css::sdbc::XConnection >& rConnection);
/**
* For a user that already exists in the db.
*/
User(const css::uno::Reference< css::sdbc::XConnection >& rConnection, const OUString& rName);
public:
/**
* Create a "new" descriptor, which isn't yet in the database.
*/
User(const css::uno::Reference< css::sdbc::XConnection >& rConnection);
/**
* For a user that already exists in the db.
*/
User(const css::uno::Reference< css::sdbc::XConnection >& rConnection, const OUString& rName);
// XAuthorizable
virtual void SAL_CALL changePassword(const OUString&, const OUString& newPassword) override;
virtual sal_Int32 SAL_CALL getPrivileges(const OUString&, sal_Int32) override;
virtual sal_Int32 SAL_CALL getGrantablePrivileges(const OUString&, sal_Int32) override;
// XAuthorizable
virtual void SAL_CALL changePassword(const OUString&, const OUString& newPassword) override;
virtual sal_Int32 SAL_CALL getPrivileges(const OUString&, sal_Int32) override;
virtual sal_Int32 SAL_CALL getGrantablePrivileges(const OUString&, sal_Int32) override;
// IRefreshableGroups::
virtual void refreshGroups() override;
};
// IRefreshableGroups::
virtual void refreshGroups() override;
};
} // namespace connectivity::firebird
+28 -28
View File
@@ -13,40 +13,40 @@
#include <com/sun/star/sdbc/XDatabaseMetaData.hpp>
namespace connectivity::firebird
{
/**
* This implements com.sun.star.sdbcx.Container.
*/
class Users: public ::connectivity::sdbcx::OCollection
{
css::uno::Reference< css::sdbc::XDatabaseMetaData >
m_xMetaData;
protected:
/**
* This implements com.sun.star.sdbcx.Container.
*/
class Users: public ::connectivity::sdbcx::OCollection
{
css::uno::Reference< css::sdbc::XDatabaseMetaData >
m_xMetaData;
protected:
// OCollection
virtual void impl_refresh() override;
virtual css::uno::Reference< css::beans::XPropertySet > createObject(
const OUString& rName) override;
virtual css::uno::Reference< css::beans::XPropertySet >
createDescriptor() override;
virtual ::css::uno::Reference< css::beans::XPropertySet > appendObject(
const OUString& rName,
const css::uno::Reference< css::beans::XPropertySet >& rDescriptor) override;
// OCollection
virtual void impl_refresh() override;
virtual css::uno::Reference< css::beans::XPropertySet > createObject(
const OUString& rName) override;
virtual css::uno::Reference< css::beans::XPropertySet >
createDescriptor() override;
virtual ::css::uno::Reference< css::beans::XPropertySet > appendObject(
const OUString& rName,
const css::uno::Reference< css::beans::XPropertySet >& rDescriptor) override;
public:
Users(const css::uno::Reference< css::sdbc::XDatabaseMetaData >& rMetaData,
::cppu::OWeakObject& rParent,
::osl::Mutex& rMutex,
::std::vector< OUString> const & rNames);
public:
Users(const css::uno::Reference< css::sdbc::XDatabaseMetaData >& rMetaData,
::cppu::OWeakObject& rParent,
::osl::Mutex& rMutex,
::std::vector< OUString> const & rNames);
// TODO: we should also implement XDataDescriptorFactory, XRefreshable,
// XAppend, etc., but all are optional.
// TODO: we should also implement XDataDescriptorFactory, XRefreshable,
// XAppend, etc., but all are optional.
// XDrop
virtual void dropObject(sal_Int32 nPosition, const OUString& rName) override;
// XDrop
virtual void dropObject(sal_Int32 nPosition, const OUString& rName) override;
};
};
} // namespace connectivity::firebird
+90 -90
View File
@@ -17,106 +17,106 @@
#include <utility>
namespace connectivity::firebird
{
// Type Blob has 2 subtypes values
// 0 for BLOB, 1 for CLOB
// see http://www.firebirdfaq.org/faq48/
// User-defined subtypes are negative.
// Use a number for image which is very unlikely to be defined by a
// user.
enum class BlobSubtype {
Blob = 0,
Clob = 1,
Image = -9546
};
{
// Type Blob has 2 subtypes values
// 0 for BLOB, 1 for CLOB
// see http://www.firebirdfaq.org/faq48/
// User-defined subtypes are negative.
// Use a number for image which is very unlikely to be defined by a
// user.
enum class BlobSubtype {
Blob = 0,
Clob = 1,
Image = -9546
};
/**
* Numeric and decimal types can be identified by their subtype in
* Firebird API. 1 for NUMERIC, 2 for DECIMAL.
*/
enum class NumberSubType {
Other = 0,
Numeric = 1,
Decimal = 2
};
/**
* Numeric and decimal types can be identified by their subtype in
* Firebird API. 1 for NUMERIC, 2 for DECIMAL.
*/
enum class NumberSubType {
Other = 0,
Numeric = 1,
Decimal = 2
};
class ColumnTypeInfo {
class ColumnTypeInfo {
private:
short m_aType;
short m_aSubType;
short m_nScale;
OUString m_sCharsetName;
short m_aType;
short m_aSubType;
short m_nScale;
OUString m_sCharsetName;
public:
/**
* @param tType SQL type of column defined by Firebird (e.g.
* SQL_DOUBLE)
* @param aSubType SQL sub type as in firebird API. See
* NumberSubType.
* @param scale: Scale of the number. It is ignored in case it's not
* a number. Scale obtained from the Firebird API is negative, so
* that should be negated before passing to this constructor.
*
*/
explicit ColumnTypeInfo( short aType, short aSubType = 0,
short nScale = 0, OUString sCharset = OUString() )
: m_aType(aType)
, m_aSubType(aSubType)
, m_nScale(nScale)
, m_sCharsetName(std::move(sCharset)) {}
explicit ColumnTypeInfo(const XSQLVAR& var, OUString sCharset = {})
: ColumnTypeInfo(var.sqltype, var.sqlsubtype, -var.sqlscale, std::move(sCharset)) {}
explicit ColumnTypeInfo(const XSQLDA* pXSQLDA, sal_Int32 column, OUString sCharset = {})
: ColumnTypeInfo(pXSQLDA->sqlvar[column-1], std::move(sCharset)) {}
short getType() const { return m_aType; }
short getSubType() const { return m_aSubType; }
short getScale() const { return m_nScale; }
OUString const & getCharacterSet() const { return m_sCharsetName; }
sal_Int32 getSdbcType() const;
OUString getColumnTypeName() const;
};
/**
* Make sure an identifier is safe to use within the database. Currently
* firebird seems to return identifiers with 93 character (instead of
* 31), whereby the name is simply padded with trailing whitespace.
* This removes all trailing whitespace (i.e. if necessary so that
* the length is below 31 characters). Firebird automatically compensates
* for such shorter strings, however any trailing padding makes the gui
* editing of such names harder, hence we remove all trailing whitespace.
*/
OUString sanitizeIdentifier(std::u16string_view rIdentifier);
inline bool IndicatesError(const ISC_STATUS_ARRAY& rStatusVector)
{
return rStatusVector[0]==1 && rStatusVector[1]; // indicates error;
}
OUString StatusVectorToString(const ISC_STATUS_ARRAY& rStatusVector,
std::u16string_view rCause);
/**
* Evaluate a firebird status vector and throw exceptions as necessary.
* The content of the status vector is included in the thrown exception.
* @param tType SQL type of column defined by Firebird (e.g.
* SQL_DOUBLE)
* @param aSubType SQL sub type as in firebird API. See
* NumberSubType.
* @param scale: Scale of the number. It is ignored in case it's not
* a number. Scale obtained from the Firebird API is negative, so
* that should be negated before passing to this constructor.
*
* @throws css::sdbc::SQLException
*/
void evaluateStatusVector(const ISC_STATUS_ARRAY& rStatusVector,
std::u16string_view aCause,
const css::uno::Reference< css::uno::XInterface >& _rxContext);
explicit ColumnTypeInfo( short aType, short aSubType = 0,
short nScale = 0, OUString sCharset = OUString() )
: m_aType(aType)
, m_aSubType(aSubType)
, m_nScale(nScale)
, m_sCharsetName(std::move(sCharset)) {}
explicit ColumnTypeInfo(const XSQLVAR& var, OUString sCharset = {})
: ColumnTypeInfo(var.sqltype, var.sqlsubtype, -var.sqlscale, std::move(sCharset)) {}
explicit ColumnTypeInfo(const XSQLDA* pXSQLDA, sal_Int32 column, OUString sCharset = {})
: ColumnTypeInfo(pXSQLDA->sqlvar[column-1], std::move(sCharset)) {}
short getType() const { return m_aType; }
short getSubType() const { return m_aSubType; }
short getScale() const { return m_nScale; }
OUString const & getCharacterSet() const { return m_sCharsetName; }
/**
* Internally (i.e. in RDB$FIELD_TYPE) firebird stores the data type
* for a column as defined in blr_*, however in the firebird
* api the SQL_* types are used, hence we need to be able to convert
* between the two when retrieving column metadata.
*/
short getFBTypeFromBlrType(short blrType);
sal_Int32 getSdbcType() const;
OUString getColumnTypeName() const;
void mallocSQLVAR(XSQLDA* pSqlda);
};
void freeSQLVAR(XSQLDA* pSqlda);
/**
* Make sure an identifier is safe to use within the database. Currently
* firebird seems to return identifiers with 93 character (instead of
* 31), whereby the name is simply padded with trailing whitespace.
* This removes all trailing whitespace (i.e. if necessary so that
* the length is below 31 characters). Firebird automatically compensates
* for such shorter strings, however any trailing padding makes the gui
* editing of such names harder, hence we remove all trailing whitespace.
*/
OUString sanitizeIdentifier(std::u16string_view rIdentifier);
inline bool IndicatesError(const ISC_STATUS_ARRAY& rStatusVector)
{
return rStatusVector[0]==1 && rStatusVector[1]; // indicates error;
}
OUString StatusVectorToString(const ISC_STATUS_ARRAY& rStatusVector,
std::u16string_view rCause);
/**
* Evaluate a firebird status vector and throw exceptions as necessary.
* The content of the status vector is included in the thrown exception.
*
* @throws css::sdbc::SQLException
*/
void evaluateStatusVector(const ISC_STATUS_ARRAY& rStatusVector,
std::u16string_view aCause,
const css::uno::Reference< css::uno::XInterface >& _rxContext);
/**
* Internally (i.e. in RDB$FIELD_TYPE) firebird stores the data type
* for a column as defined in blr_*, however in the firebird
* api the SQL_* types are used, hence we need to be able to convert
* between the two when retrieving column metadata.
*/
short getFBTypeFromBlrType(short blrType);
void mallocSQLVAR(XSQLDA* pSqlda);
void freeSQLVAR(XSQLDA* pSqlda);
}
@@ -23,23 +23,23 @@
namespace connectivity::hsqldb
{
class ODriverDelegator;
class OConnectionController : public ::cppu::WeakImplHelper< css::frame::XTerminateListener >
{
class ODriverDelegator;
class OConnectionController : public ::cppu::WeakImplHelper< css::frame::XTerminateListener >
{
ODriverDelegator* m_pDriver;
protected:
virtual ~OConnectionController() override {m_pDriver = nullptr;}
public:
explicit OConnectionController(ODriverDelegator* _pDriver) : m_pDriver(_pDriver){}
ODriverDelegator* m_pDriver;
protected:
virtual ~OConnectionController() override {m_pDriver = nullptr;}
public:
explicit OConnectionController(ODriverDelegator* _pDriver) : m_pDriver(_pDriver){}
// XEventListener
virtual void SAL_CALL disposing( const css::lang::EventObject& Source ) override;
// XEventListener
virtual void SAL_CALL disposing( const css::lang::EventObject& Source ) override;
// XTerminateListener
virtual void SAL_CALL queryTermination( const css::lang::EventObject& aEvent ) override;
virtual void SAL_CALL notifyTermination( const css::lang::EventObject& aEvent ) override;
};
// XTerminateListener
virtual void SAL_CALL queryTermination( const css::lang::EventObject& aEvent ) override;
virtual void SAL_CALL notifyTermination( const css::lang::EventObject& aEvent ) override;
};
} // namespace connectivity::hsqldb
@@ -32,28 +32,28 @@
namespace connectivity::macab
{
class MacabAddressBook
{
protected:
ABAddressBookRef m_aAddressBook;
MacabRecords *m_xMacabRecords;
std::vector<MacabGroup *> m_xMacabGroups;
bool m_bRetrievedGroups;
class MacabAddressBook
{
protected:
ABAddressBookRef m_aAddressBook;
MacabRecords *m_xMacabRecords;
std::vector<MacabGroup *> m_xMacabGroups;
bool m_bRetrievedGroups;
public:
MacabAddressBook();
~MacabAddressBook();
static const OUString & getDefaultTableName();
public:
MacabAddressBook();
~MacabAddressBook();
static const OUString & getDefaultTableName();
MacabRecords *getMacabRecords();
std::vector<MacabGroup *> getMacabGroups();
MacabRecords *getMacabRecords();
std::vector<MacabGroup *> getMacabGroups();
MacabGroup *getMacabGroup(std::u16string_view _groupName);
MacabRecords *getMacabRecords(std::u16string_view _tableName);
MacabGroup *getMacabGroup(std::u16string_view _groupName);
MacabRecords *getMacabRecords(std::u16string_view _tableName);
MacabGroup *getMacabGroupMatch(const OUString& _groupName);
MacabRecords *getMacabRecordsMatch(const OUString& _tableName);
};
MacabGroup *getMacabGroupMatch(const OUString& _groupName);
MacabRecords *getMacabRecordsMatch(const OUString& _tableName);
};
}
@@ -23,29 +23,29 @@
namespace connectivity::macab
{
class MacabConnection;
class MacabConnection;
class MacabCatalog : public connectivity::sdbcx::OCatalog
{
MacabConnection* m_pConnection; // used to get the metadata
class MacabCatalog : public connectivity::sdbcx::OCatalog
{
MacabConnection* m_pConnection; // used to get the metadata
public:
explicit MacabCatalog(MacabConnection* _pCon);
public:
explicit MacabCatalog(MacabConnection* _pCon);
MacabConnection* getConnection() const { return m_pConnection; }
MacabConnection* getConnection() const { return m_pConnection; }
static const OUString& getDot();
static const OUString& getDot();
// implementation of the pure virtual methods
virtual void refreshTables() override;
virtual void refreshViews() override;
virtual void refreshGroups() override;
virtual void refreshUsers() override;
// implementation of the pure virtual methods
virtual void refreshTables() override;
virtual void refreshViews() override;
virtual void refreshGroups() override;
virtual void refreshUsers() override;
// XTablesSupplier
virtual css::uno::Reference< css::container::XNameAccess > SAL_CALL getTables(
) override;
};
// XTablesSupplier
virtual css::uno::Reference< css::container::XNameAccess > SAL_CALL getTables(
) override;
};
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
@@ -24,19 +24,19 @@
namespace connectivity::macab
{
class MacabColumns : public sdbcx::OCollection
{
protected:
MacabTable* m_pTable;
class MacabColumns : public sdbcx::OCollection
{
protected:
MacabTable* m_pTable;
virtual css::uno::Reference< css::beans::XPropertySet > createObject(const OUString& _rName) override;
virtual void impl_refresh() override;
virtual css::uno::Reference< css::beans::XPropertySet > createObject(const OUString& _rName) override;
virtual void impl_refresh() override;
public:
MacabColumns( MacabTable* _pTable,
::osl::Mutex& _rMutex,
const ::std::vector< OUString> &_rVector);
};
public:
MacabColumns( MacabTable* _pTable,
::osl::Mutex& _rMutex,
const ::std::vector< OUString> &_rVector);
};
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
@@ -30,79 +30,79 @@
namespace connectivity::macab
{
typedef ::cppu::WeakComponentImplHelper<css::sdbc::XConnection,
css::sdbc::XWarningsSupplier,
css::lang::XServiceInfo
> OMetaConnection_BASE;
typedef ::cppu::WeakComponentImplHelper<css::sdbc::XConnection,
css::sdbc::XWarningsSupplier,
css::lang::XServiceInfo
> OMetaConnection_BASE;
class MacabDriver;
class MacabAddressBook;
class MacabDriver;
class MacabAddressBook;
typedef connectivity::OMetaConnection MacabConnection_BASE;
typedef connectivity::OMetaConnection MacabConnection_BASE;
class MacabConnection : public MacabConnection_BASE
{
protected:
class MacabConnection : public MacabConnection_BASE
{
protected:
// Data attributes
// Data attributes
MacabAddressBook* m_pAddressBook; // the address book
MacabDriver* m_pDriver; // pointer to the owning driver object
css::uno::Reference< css::sdbcx::XTablesSupplier>
m_xCatalog; // needed for the SQL interpreter
MacabAddressBook* m_pAddressBook; // the address book
MacabDriver* m_pDriver; // pointer to the owning driver object
css::uno::Reference< css::sdbcx::XTablesSupplier>
m_xCatalog; // needed for the SQL interpreter
private:
bool doIsClosed();
private:
bool doIsClosed();
void doClose();
void doClose();
public:
/// @throws css::sdbc::SQLException
virtual void construct( const OUString& url,const css::uno::Sequence< css::beans::PropertyValue >& info);
public:
/// @throws css::sdbc::SQLException
virtual void construct( const OUString& url,const css::uno::Sequence< css::beans::PropertyValue >& info);
explicit MacabConnection(MacabDriver* _pDriver);
virtual ~MacabConnection() override;
explicit MacabConnection(MacabDriver* _pDriver);
virtual ~MacabConnection() override;
// OComponentHelper
virtual void SAL_CALL disposing() override;
// OComponentHelper
virtual void SAL_CALL disposing() override;
// XServiceInfo
DECLARE_SERVICE_INFO();
// XServiceInfo
DECLARE_SERVICE_INFO();
// XConnection
virtual css::uno::Reference< css::sdbc::XStatement > SAL_CALL createStatement( ) override;
virtual css::uno::Reference< css::sdbc::XPreparedStatement > SAL_CALL prepareStatement( const OUString& sql ) override;
virtual css::uno::Reference< css::sdbc::XPreparedStatement > SAL_CALL prepareCall( const OUString& sql ) override;
virtual OUString SAL_CALL nativeSQL( const OUString& sql ) override;
virtual void SAL_CALL setAutoCommit( sal_Bool autoCommit ) override;
virtual sal_Bool SAL_CALL getAutoCommit( ) override;
virtual void SAL_CALL commit( ) override;
virtual void SAL_CALL rollback( ) override;
virtual sal_Bool SAL_CALL isClosed( ) override;
virtual css::uno::Reference< css::sdbc::XDatabaseMetaData > SAL_CALL getMetaData( ) override;
virtual void SAL_CALL setReadOnly( sal_Bool readOnly ) override;
virtual sal_Bool SAL_CALL isReadOnly( ) override;
virtual void SAL_CALL setCatalog( const OUString& catalog ) override;
virtual OUString SAL_CALL getCatalog( ) override;
virtual void SAL_CALL setTransactionIsolation( sal_Int32 level ) override;
virtual sal_Int32 SAL_CALL getTransactionIsolation( ) override;
virtual css::uno::Reference< css::container::XNameAccess > SAL_CALL getTypeMap( ) override;
virtual void SAL_CALL setTypeMap( const css::uno::Reference< css::container::XNameAccess >& typeMap ) override;
// XConnection
virtual css::uno::Reference< css::sdbc::XStatement > SAL_CALL createStatement( ) override;
virtual css::uno::Reference< css::sdbc::XPreparedStatement > SAL_CALL prepareStatement( const OUString& sql ) override;
virtual css::uno::Reference< css::sdbc::XPreparedStatement > SAL_CALL prepareCall( const OUString& sql ) override;
virtual OUString SAL_CALL nativeSQL( const OUString& sql ) override;
virtual void SAL_CALL setAutoCommit( sal_Bool autoCommit ) override;
virtual sal_Bool SAL_CALL getAutoCommit( ) override;
virtual void SAL_CALL commit( ) override;
virtual void SAL_CALL rollback( ) override;
virtual sal_Bool SAL_CALL isClosed( ) override;
virtual css::uno::Reference< css::sdbc::XDatabaseMetaData > SAL_CALL getMetaData( ) override;
virtual void SAL_CALL setReadOnly( sal_Bool readOnly ) override;
virtual sal_Bool SAL_CALL isReadOnly( ) override;
virtual void SAL_CALL setCatalog( const OUString& catalog ) override;
virtual OUString SAL_CALL getCatalog( ) override;
virtual void SAL_CALL setTransactionIsolation( sal_Int32 level ) override;
virtual sal_Int32 SAL_CALL getTransactionIsolation( ) override;
virtual css::uno::Reference< css::container::XNameAccess > SAL_CALL getTypeMap( ) override;
virtual void SAL_CALL setTypeMap( const css::uno::Reference< css::container::XNameAccess >& typeMap ) override;
// XCloseable
virtual void SAL_CALL close( ) override;
// XCloseable
virtual void SAL_CALL close( ) override;
// XWarningsSupplier
virtual css::uno::Any SAL_CALL getWarnings( ) override;
virtual void SAL_CALL clearWarnings( ) override;
// XWarningsSupplier
virtual css::uno::Any SAL_CALL getWarnings( ) override;
virtual void SAL_CALL clearWarnings( ) override;
// needed for the SQL interpreter
css::uno::Reference< css::sdbcx::XTablesSupplier > createCatalog();
// needed for the SQL interpreter
css::uno::Reference< css::sdbcx::XTablesSupplier > createCatalog();
// accessors
MacabDriver* getDriver() const { return m_pDriver;}
MacabAddressBook* getAddressBook() const;
};
// accessors
MacabDriver* getDriver() const { return m_pDriver;}
MacabAddressBook* getAddressBook() const;
};
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
@@ -26,170 +26,170 @@
namespace connectivity::macab
{
class MacabDatabaseMetaData : public ::cppu::WeakImplHelper< css::sdbc::XDatabaseMetaData>
{
rtl::Reference< MacabConnection > m_xConnection;
bool m_bUseCatalog;
class MacabDatabaseMetaData : public ::cppu::WeakImplHelper< css::sdbc::XDatabaseMetaData>
{
rtl::Reference< MacabConnection > m_xConnection;
bool m_bUseCatalog;
public:
public:
MacabConnection* getOwnConnection() const { return m_xConnection.get(); }
MacabConnection* getOwnConnection() const { return m_xConnection.get(); }
explicit MacabDatabaseMetaData(MacabConnection* _pCon);
virtual ~MacabDatabaseMetaData() override;
explicit MacabDatabaseMetaData(MacabConnection* _pCon);
virtual ~MacabDatabaseMetaData() override;
// this interface is really BIG
// XDatabaseMetaData
virtual sal_Bool SAL_CALL allProceduresAreCallable( ) override;
virtual sal_Bool SAL_CALL allTablesAreSelectable( ) override;
virtual OUString SAL_CALL getURL( ) override;
virtual OUString SAL_CALL getUserName( ) override;
virtual sal_Bool SAL_CALL isReadOnly( ) override;
virtual sal_Bool SAL_CALL nullsAreSortedHigh( ) override;
virtual sal_Bool SAL_CALL nullsAreSortedLow( ) override;
virtual sal_Bool SAL_CALL nullsAreSortedAtStart( ) override;
virtual sal_Bool SAL_CALL nullsAreSortedAtEnd( ) override;
virtual OUString SAL_CALL getDatabaseProductName( ) override;
virtual OUString SAL_CALL getDatabaseProductVersion( ) override;
virtual OUString SAL_CALL getDriverName( ) override;
virtual OUString SAL_CALL getDriverVersion( ) override;
virtual sal_Int32 SAL_CALL getDriverMajorVersion( ) override;
virtual sal_Int32 SAL_CALL getDriverMinorVersion( ) override;
virtual sal_Bool SAL_CALL usesLocalFiles( ) override;
virtual sal_Bool SAL_CALL usesLocalFilePerTable( ) override;
virtual sal_Bool SAL_CALL supportsMixedCaseIdentifiers( ) override;
virtual sal_Bool SAL_CALL storesUpperCaseIdentifiers( ) override;
virtual sal_Bool SAL_CALL storesLowerCaseIdentifiers( ) override;
virtual sal_Bool SAL_CALL storesMixedCaseIdentifiers( ) override;
virtual sal_Bool SAL_CALL supportsMixedCaseQuotedIdentifiers( ) override;
virtual sal_Bool SAL_CALL storesUpperCaseQuotedIdentifiers( ) override;
virtual sal_Bool SAL_CALL storesLowerCaseQuotedIdentifiers( ) override;
virtual sal_Bool SAL_CALL storesMixedCaseQuotedIdentifiers( ) override;
virtual OUString SAL_CALL getIdentifierQuoteString( ) override;
virtual OUString SAL_CALL getSQLKeywords( ) override;
virtual OUString SAL_CALL getNumericFunctions( ) override;
virtual OUString SAL_CALL getStringFunctions( ) override;
virtual OUString SAL_CALL getSystemFunctions( ) override;
virtual OUString SAL_CALL getTimeDateFunctions( ) override;
virtual OUString SAL_CALL getSearchStringEscape( ) override;
virtual OUString SAL_CALL getExtraNameCharacters( ) override;
virtual sal_Bool SAL_CALL supportsAlterTableWithAddColumn( ) override;
virtual sal_Bool SAL_CALL supportsAlterTableWithDropColumn( ) override;
virtual sal_Bool SAL_CALL supportsColumnAliasing( ) override;
virtual sal_Bool SAL_CALL nullPlusNonNullIsNull( ) override;
virtual sal_Bool SAL_CALL supportsTypeConversion( ) override;
virtual sal_Bool SAL_CALL supportsConvert( sal_Int32 fromType, sal_Int32 toType ) override;
virtual sal_Bool SAL_CALL supportsTableCorrelationNames( ) override;
virtual sal_Bool SAL_CALL supportsDifferentTableCorrelationNames( ) override;
virtual sal_Bool SAL_CALL supportsExpressionsInOrderBy( ) override;
virtual sal_Bool SAL_CALL supportsOrderByUnrelated( ) override;
virtual sal_Bool SAL_CALL supportsGroupBy( ) override;
virtual sal_Bool SAL_CALL supportsGroupByUnrelated( ) override;
virtual sal_Bool SAL_CALL supportsGroupByBeyondSelect( ) override;
virtual sal_Bool SAL_CALL supportsLikeEscapeClause( ) override;
virtual sal_Bool SAL_CALL supportsMultipleResultSets( ) override;
virtual sal_Bool SAL_CALL supportsMultipleTransactions( ) override;
virtual sal_Bool SAL_CALL supportsNonNullableColumns( ) override;
virtual sal_Bool SAL_CALL supportsMinimumSQLGrammar( ) override;
virtual sal_Bool SAL_CALL supportsCoreSQLGrammar( ) override;
virtual sal_Bool SAL_CALL supportsExtendedSQLGrammar( ) override;
virtual sal_Bool SAL_CALL supportsANSI92EntryLevelSQL( ) override;
virtual sal_Bool SAL_CALL supportsANSI92IntermediateSQL( ) override;
virtual sal_Bool SAL_CALL supportsANSI92FullSQL( ) override;
virtual sal_Bool SAL_CALL supportsIntegrityEnhancementFacility( ) override;
virtual sal_Bool SAL_CALL supportsOuterJoins( ) override;
virtual sal_Bool SAL_CALL supportsFullOuterJoins( ) override;
virtual sal_Bool SAL_CALL supportsLimitedOuterJoins( ) override;
virtual OUString SAL_CALL getSchemaTerm( ) override;
virtual OUString SAL_CALL getProcedureTerm( ) override;
virtual OUString SAL_CALL getCatalogTerm( ) override;
virtual sal_Bool SAL_CALL isCatalogAtStart( ) override;
virtual OUString SAL_CALL getCatalogSeparator( ) override;
virtual sal_Bool SAL_CALL supportsSchemasInDataManipulation( ) override;
virtual sal_Bool SAL_CALL supportsSchemasInProcedureCalls( ) override;
virtual sal_Bool SAL_CALL supportsSchemasInTableDefinitions( ) override;
virtual sal_Bool SAL_CALL supportsSchemasInIndexDefinitions( ) override;
virtual sal_Bool SAL_CALL supportsSchemasInPrivilegeDefinitions( ) override;
virtual sal_Bool SAL_CALL supportsCatalogsInDataManipulation( ) override;
virtual sal_Bool SAL_CALL supportsCatalogsInProcedureCalls( ) override;
virtual sal_Bool SAL_CALL supportsCatalogsInTableDefinitions( ) override;
virtual sal_Bool SAL_CALL supportsCatalogsInIndexDefinitions( ) override;
virtual sal_Bool SAL_CALL supportsCatalogsInPrivilegeDefinitions( ) override;
virtual sal_Bool SAL_CALL supportsPositionedDelete( ) override;
virtual sal_Bool SAL_CALL supportsPositionedUpdate( ) override;
virtual sal_Bool SAL_CALL supportsSelectForUpdate( ) override;
virtual sal_Bool SAL_CALL supportsStoredProcedures( ) override;
virtual sal_Bool SAL_CALL supportsSubqueriesInComparisons( ) override;
virtual sal_Bool SAL_CALL supportsSubqueriesInExists( ) override;
virtual sal_Bool SAL_CALL supportsSubqueriesInIns( ) override;
virtual sal_Bool SAL_CALL supportsSubqueriesInQuantifieds( ) override;
virtual sal_Bool SAL_CALL supportsCorrelatedSubqueries( ) override;
virtual sal_Bool SAL_CALL supportsUnion( ) override;
virtual sal_Bool SAL_CALL supportsUnionAll( ) override;
virtual sal_Bool SAL_CALL supportsOpenCursorsAcrossCommit( ) override;
virtual sal_Bool SAL_CALL supportsOpenCursorsAcrossRollback( ) override;
virtual sal_Bool SAL_CALL supportsOpenStatementsAcrossCommit( ) override;
virtual sal_Bool SAL_CALL supportsOpenStatementsAcrossRollback( ) override;
virtual sal_Int32 SAL_CALL getMaxBinaryLiteralLength( ) override;
virtual sal_Int32 SAL_CALL getMaxCharLiteralLength( ) override;
virtual sal_Int32 SAL_CALL getMaxColumnNameLength( ) override;
virtual sal_Int32 SAL_CALL getMaxColumnsInGroupBy( ) override;
virtual sal_Int32 SAL_CALL getMaxColumnsInIndex( ) override;
virtual sal_Int32 SAL_CALL getMaxColumnsInOrderBy( ) override;
virtual sal_Int32 SAL_CALL getMaxColumnsInSelect( ) override;
virtual sal_Int32 SAL_CALL getMaxColumnsInTable( ) override;
virtual sal_Int32 SAL_CALL getMaxConnections( ) override;
virtual sal_Int32 SAL_CALL getMaxCursorNameLength( ) override;
virtual sal_Int32 SAL_CALL getMaxIndexLength( ) override;
virtual sal_Int32 SAL_CALL getMaxSchemaNameLength( ) override;
virtual sal_Int32 SAL_CALL getMaxProcedureNameLength( ) override;
virtual sal_Int32 SAL_CALL getMaxCatalogNameLength( ) override;
virtual sal_Int32 SAL_CALL getMaxRowSize( ) override;
virtual sal_Bool SAL_CALL doesMaxRowSizeIncludeBlobs( ) override;
virtual sal_Int32 SAL_CALL getMaxStatementLength( ) override;
virtual sal_Int32 SAL_CALL getMaxStatements( ) override;
virtual sal_Int32 SAL_CALL getMaxTableNameLength( ) override;
virtual sal_Int32 SAL_CALL getMaxTablesInSelect( ) override;
virtual sal_Int32 SAL_CALL getMaxUserNameLength( ) override;
virtual sal_Int32 SAL_CALL getDefaultTransactionIsolation( ) override;
virtual sal_Bool SAL_CALL supportsTransactions( ) override;
virtual sal_Bool SAL_CALL supportsTransactionIsolationLevel( sal_Int32 level ) override;
virtual sal_Bool SAL_CALL supportsDataDefinitionAndDataManipulationTransactions( ) override;
virtual sal_Bool SAL_CALL supportsDataManipulationTransactionsOnly( ) override;
virtual sal_Bool SAL_CALL dataDefinitionCausesTransactionCommit( ) override;
virtual sal_Bool SAL_CALL dataDefinitionIgnoredInTransactions( ) override;
virtual css::uno::Reference< css::sdbc::XResultSet > SAL_CALL getProcedures( const css::uno::Any& catalog, const OUString& schemaPattern, const OUString& procedureNamePattern ) override;
virtual css::uno::Reference< css::sdbc::XResultSet > SAL_CALL getProcedureColumns( const css::uno::Any& catalog, const OUString& schemaPattern, const OUString& procedureNamePattern, const OUString& columnNamePattern ) override;
virtual css::uno::Reference< css::sdbc::XResultSet > SAL_CALL getTables( const css::uno::Any& catalog, const OUString& schemaPattern, const OUString& tableNamePattern, const css::uno::Sequence< OUString >& types ) override;
virtual css::uno::Reference< css::sdbc::XResultSet > SAL_CALL getSchemas( ) override;
virtual css::uno::Reference< css::sdbc::XResultSet > SAL_CALL getCatalogs( ) override;
virtual css::uno::Reference< css::sdbc::XResultSet > SAL_CALL getTableTypes( ) override;
virtual css::uno::Reference< css::sdbc::XResultSet > SAL_CALL getColumns( const css::uno::Any& catalog, const OUString& schemaPattern, const OUString& tableNamePattern, const OUString& columnNamePattern ) override;
virtual css::uno::Reference< css::sdbc::XResultSet > SAL_CALL getColumnPrivileges( const css::uno::Any& catalog, const OUString& schema, const OUString& table, const OUString& columnNamePattern ) override;
virtual css::uno::Reference< css::sdbc::XResultSet > SAL_CALL getTablePrivileges( const css::uno::Any& catalog, const OUString& schemaPattern, const OUString& tableNamePattern ) override;
virtual css::uno::Reference< css::sdbc::XResultSet > SAL_CALL getBestRowIdentifier( const css::uno::Any& catalog, const OUString& schema, const OUString& table, sal_Int32 scope, sal_Bool nullable ) override;
virtual css::uno::Reference< css::sdbc::XResultSet > SAL_CALL getVersionColumns( const css::uno::Any& catalog, const OUString& schema, const OUString& table ) override;
virtual css::uno::Reference< css::sdbc::XResultSet > SAL_CALL getPrimaryKeys( const css::uno::Any& catalog, const OUString& schema, const OUString& table ) override;
virtual css::uno::Reference< css::sdbc::XResultSet > SAL_CALL getImportedKeys( const css::uno::Any& catalog, const OUString& schema, const OUString& table ) override;
virtual css::uno::Reference< css::sdbc::XResultSet > SAL_CALL getExportedKeys( const css::uno::Any& catalog, const OUString& schema, const OUString& table ) override;
virtual css::uno::Reference< css::sdbc::XResultSet > SAL_CALL getCrossReference( const css::uno::Any& primaryCatalog, const OUString& primarySchema, const OUString& primaryTable, const css::uno::Any& foreignCatalog, const OUString& foreignSchema, const OUString& foreignTable ) override;
virtual css::uno::Reference< css::sdbc::XResultSet > SAL_CALL getTypeInfo( ) override;
virtual css::uno::Reference< css::sdbc::XResultSet > SAL_CALL getIndexInfo( const css::uno::Any& catalog, const OUString& schema, const OUString& table, sal_Bool unique, sal_Bool approximate ) override;
virtual sal_Bool SAL_CALL supportsResultSetType( sal_Int32 setType ) override;
virtual sal_Bool SAL_CALL supportsResultSetConcurrency( sal_Int32 setType, sal_Int32 concurrency ) override;
virtual sal_Bool SAL_CALL ownUpdatesAreVisible( sal_Int32 setType ) override;
virtual sal_Bool SAL_CALL ownDeletesAreVisible( sal_Int32 setType ) override;
virtual sal_Bool SAL_CALL ownInsertsAreVisible( sal_Int32 setType ) override;
virtual sal_Bool SAL_CALL othersUpdatesAreVisible( sal_Int32 setType ) override;
virtual sal_Bool SAL_CALL othersDeletesAreVisible( sal_Int32 setType ) override;
virtual sal_Bool SAL_CALL othersInsertsAreVisible( sal_Int32 setType ) override;
virtual sal_Bool SAL_CALL updatesAreDetected( sal_Int32 setType ) override;
virtual sal_Bool SAL_CALL deletesAreDetected( sal_Int32 setType ) override;
virtual sal_Bool SAL_CALL insertsAreDetected( sal_Int32 setType ) override;
virtual sal_Bool SAL_CALL supportsBatchUpdates( ) override;
virtual css::uno::Reference< css::sdbc::XResultSet > SAL_CALL getUDTs( const css::uno::Any& catalog, const OUString& schemaPattern, const OUString& typeNamePattern, const css::uno::Sequence< sal_Int32 >& types ) override;
virtual css::uno::Reference< css::sdbc::XConnection > SAL_CALL getConnection( ) override;
};
// this interface is really BIG
// XDatabaseMetaData
virtual sal_Bool SAL_CALL allProceduresAreCallable( ) override;
virtual sal_Bool SAL_CALL allTablesAreSelectable( ) override;
virtual OUString SAL_CALL getURL( ) override;
virtual OUString SAL_CALL getUserName( ) override;
virtual sal_Bool SAL_CALL isReadOnly( ) override;
virtual sal_Bool SAL_CALL nullsAreSortedHigh( ) override;
virtual sal_Bool SAL_CALL nullsAreSortedLow( ) override;
virtual sal_Bool SAL_CALL nullsAreSortedAtStart( ) override;
virtual sal_Bool SAL_CALL nullsAreSortedAtEnd( ) override;
virtual OUString SAL_CALL getDatabaseProductName( ) override;
virtual OUString SAL_CALL getDatabaseProductVersion( ) override;
virtual OUString SAL_CALL getDriverName( ) override;
virtual OUString SAL_CALL getDriverVersion( ) override;
virtual sal_Int32 SAL_CALL getDriverMajorVersion( ) override;
virtual sal_Int32 SAL_CALL getDriverMinorVersion( ) override;
virtual sal_Bool SAL_CALL usesLocalFiles( ) override;
virtual sal_Bool SAL_CALL usesLocalFilePerTable( ) override;
virtual sal_Bool SAL_CALL supportsMixedCaseIdentifiers( ) override;
virtual sal_Bool SAL_CALL storesUpperCaseIdentifiers( ) override;
virtual sal_Bool SAL_CALL storesLowerCaseIdentifiers( ) override;
virtual sal_Bool SAL_CALL storesMixedCaseIdentifiers( ) override;
virtual sal_Bool SAL_CALL supportsMixedCaseQuotedIdentifiers( ) override;
virtual sal_Bool SAL_CALL storesUpperCaseQuotedIdentifiers( ) override;
virtual sal_Bool SAL_CALL storesLowerCaseQuotedIdentifiers( ) override;
virtual sal_Bool SAL_CALL storesMixedCaseQuotedIdentifiers( ) override;
virtual OUString SAL_CALL getIdentifierQuoteString( ) override;
virtual OUString SAL_CALL getSQLKeywords( ) override;
virtual OUString SAL_CALL getNumericFunctions( ) override;
virtual OUString SAL_CALL getStringFunctions( ) override;
virtual OUString SAL_CALL getSystemFunctions( ) override;
virtual OUString SAL_CALL getTimeDateFunctions( ) override;
virtual OUString SAL_CALL getSearchStringEscape( ) override;
virtual OUString SAL_CALL getExtraNameCharacters( ) override;
virtual sal_Bool SAL_CALL supportsAlterTableWithAddColumn( ) override;
virtual sal_Bool SAL_CALL supportsAlterTableWithDropColumn( ) override;
virtual sal_Bool SAL_CALL supportsColumnAliasing( ) override;
virtual sal_Bool SAL_CALL nullPlusNonNullIsNull( ) override;
virtual sal_Bool SAL_CALL supportsTypeConversion( ) override;
virtual sal_Bool SAL_CALL supportsConvert( sal_Int32 fromType, sal_Int32 toType ) override;
virtual sal_Bool SAL_CALL supportsTableCorrelationNames( ) override;
virtual sal_Bool SAL_CALL supportsDifferentTableCorrelationNames( ) override;
virtual sal_Bool SAL_CALL supportsExpressionsInOrderBy( ) override;
virtual sal_Bool SAL_CALL supportsOrderByUnrelated( ) override;
virtual sal_Bool SAL_CALL supportsGroupBy( ) override;
virtual sal_Bool SAL_CALL supportsGroupByUnrelated( ) override;
virtual sal_Bool SAL_CALL supportsGroupByBeyondSelect( ) override;
virtual sal_Bool SAL_CALL supportsLikeEscapeClause( ) override;
virtual sal_Bool SAL_CALL supportsMultipleResultSets( ) override;
virtual sal_Bool SAL_CALL supportsMultipleTransactions( ) override;
virtual sal_Bool SAL_CALL supportsNonNullableColumns( ) override;
virtual sal_Bool SAL_CALL supportsMinimumSQLGrammar( ) override;
virtual sal_Bool SAL_CALL supportsCoreSQLGrammar( ) override;
virtual sal_Bool SAL_CALL supportsExtendedSQLGrammar( ) override;
virtual sal_Bool SAL_CALL supportsANSI92EntryLevelSQL( ) override;
virtual sal_Bool SAL_CALL supportsANSI92IntermediateSQL( ) override;
virtual sal_Bool SAL_CALL supportsANSI92FullSQL( ) override;
virtual sal_Bool SAL_CALL supportsIntegrityEnhancementFacility( ) override;
virtual sal_Bool SAL_CALL supportsOuterJoins( ) override;
virtual sal_Bool SAL_CALL supportsFullOuterJoins( ) override;
virtual sal_Bool SAL_CALL supportsLimitedOuterJoins( ) override;
virtual OUString SAL_CALL getSchemaTerm( ) override;
virtual OUString SAL_CALL getProcedureTerm( ) override;
virtual OUString SAL_CALL getCatalogTerm( ) override;
virtual sal_Bool SAL_CALL isCatalogAtStart( ) override;
virtual OUString SAL_CALL getCatalogSeparator( ) override;
virtual sal_Bool SAL_CALL supportsSchemasInDataManipulation( ) override;
virtual sal_Bool SAL_CALL supportsSchemasInProcedureCalls( ) override;
virtual sal_Bool SAL_CALL supportsSchemasInTableDefinitions( ) override;
virtual sal_Bool SAL_CALL supportsSchemasInIndexDefinitions( ) override;
virtual sal_Bool SAL_CALL supportsSchemasInPrivilegeDefinitions( ) override;
virtual sal_Bool SAL_CALL supportsCatalogsInDataManipulation( ) override;
virtual sal_Bool SAL_CALL supportsCatalogsInProcedureCalls( ) override;
virtual sal_Bool SAL_CALL supportsCatalogsInTableDefinitions( ) override;
virtual sal_Bool SAL_CALL supportsCatalogsInIndexDefinitions( ) override;
virtual sal_Bool SAL_CALL supportsCatalogsInPrivilegeDefinitions( ) override;
virtual sal_Bool SAL_CALL supportsPositionedDelete( ) override;
virtual sal_Bool SAL_CALL supportsPositionedUpdate( ) override;
virtual sal_Bool SAL_CALL supportsSelectForUpdate( ) override;
virtual sal_Bool SAL_CALL supportsStoredProcedures( ) override;
virtual sal_Bool SAL_CALL supportsSubqueriesInComparisons( ) override;
virtual sal_Bool SAL_CALL supportsSubqueriesInExists( ) override;
virtual sal_Bool SAL_CALL supportsSubqueriesInIns( ) override;
virtual sal_Bool SAL_CALL supportsSubqueriesInQuantifieds( ) override;
virtual sal_Bool SAL_CALL supportsCorrelatedSubqueries( ) override;
virtual sal_Bool SAL_CALL supportsUnion( ) override;
virtual sal_Bool SAL_CALL supportsUnionAll( ) override;
virtual sal_Bool SAL_CALL supportsOpenCursorsAcrossCommit( ) override;
virtual sal_Bool SAL_CALL supportsOpenCursorsAcrossRollback( ) override;
virtual sal_Bool SAL_CALL supportsOpenStatementsAcrossCommit( ) override;
virtual sal_Bool SAL_CALL supportsOpenStatementsAcrossRollback( ) override;
virtual sal_Int32 SAL_CALL getMaxBinaryLiteralLength( ) override;
virtual sal_Int32 SAL_CALL getMaxCharLiteralLength( ) override;
virtual sal_Int32 SAL_CALL getMaxColumnNameLength( ) override;
virtual sal_Int32 SAL_CALL getMaxColumnsInGroupBy( ) override;
virtual sal_Int32 SAL_CALL getMaxColumnsInIndex( ) override;
virtual sal_Int32 SAL_CALL getMaxColumnsInOrderBy( ) override;
virtual sal_Int32 SAL_CALL getMaxColumnsInSelect( ) override;
virtual sal_Int32 SAL_CALL getMaxColumnsInTable( ) override;
virtual sal_Int32 SAL_CALL getMaxConnections( ) override;
virtual sal_Int32 SAL_CALL getMaxCursorNameLength( ) override;
virtual sal_Int32 SAL_CALL getMaxIndexLength( ) override;
virtual sal_Int32 SAL_CALL getMaxSchemaNameLength( ) override;
virtual sal_Int32 SAL_CALL getMaxProcedureNameLength( ) override;
virtual sal_Int32 SAL_CALL getMaxCatalogNameLength( ) override;
virtual sal_Int32 SAL_CALL getMaxRowSize( ) override;
virtual sal_Bool SAL_CALL doesMaxRowSizeIncludeBlobs( ) override;
virtual sal_Int32 SAL_CALL getMaxStatementLength( ) override;
virtual sal_Int32 SAL_CALL getMaxStatements( ) override;
virtual sal_Int32 SAL_CALL getMaxTableNameLength( ) override;
virtual sal_Int32 SAL_CALL getMaxTablesInSelect( ) override;
virtual sal_Int32 SAL_CALL getMaxUserNameLength( ) override;
virtual sal_Int32 SAL_CALL getDefaultTransactionIsolation( ) override;
virtual sal_Bool SAL_CALL supportsTransactions( ) override;
virtual sal_Bool SAL_CALL supportsTransactionIsolationLevel( sal_Int32 level ) override;
virtual sal_Bool SAL_CALL supportsDataDefinitionAndDataManipulationTransactions( ) override;
virtual sal_Bool SAL_CALL supportsDataManipulationTransactionsOnly( ) override;
virtual sal_Bool SAL_CALL dataDefinitionCausesTransactionCommit( ) override;
virtual sal_Bool SAL_CALL dataDefinitionIgnoredInTransactions( ) override;
virtual css::uno::Reference< css::sdbc::XResultSet > SAL_CALL getProcedures( const css::uno::Any& catalog, const OUString& schemaPattern, const OUString& procedureNamePattern ) override;
virtual css::uno::Reference< css::sdbc::XResultSet > SAL_CALL getProcedureColumns( const css::uno::Any& catalog, const OUString& schemaPattern, const OUString& procedureNamePattern, const OUString& columnNamePattern ) override;
virtual css::uno::Reference< css::sdbc::XResultSet > SAL_CALL getTables( const css::uno::Any& catalog, const OUString& schemaPattern, const OUString& tableNamePattern, const css::uno::Sequence< OUString >& types ) override;
virtual css::uno::Reference< css::sdbc::XResultSet > SAL_CALL getSchemas( ) override;
virtual css::uno::Reference< css::sdbc::XResultSet > SAL_CALL getCatalogs( ) override;
virtual css::uno::Reference< css::sdbc::XResultSet > SAL_CALL getTableTypes( ) override;
virtual css::uno::Reference< css::sdbc::XResultSet > SAL_CALL getColumns( const css::uno::Any& catalog, const OUString& schemaPattern, const OUString& tableNamePattern, const OUString& columnNamePattern ) override;
virtual css::uno::Reference< css::sdbc::XResultSet > SAL_CALL getColumnPrivileges( const css::uno::Any& catalog, const OUString& schema, const OUString& table, const OUString& columnNamePattern ) override;
virtual css::uno::Reference< css::sdbc::XResultSet > SAL_CALL getTablePrivileges( const css::uno::Any& catalog, const OUString& schemaPattern, const OUString& tableNamePattern ) override;
virtual css::uno::Reference< css::sdbc::XResultSet > SAL_CALL getBestRowIdentifier( const css::uno::Any& catalog, const OUString& schema, const OUString& table, sal_Int32 scope, sal_Bool nullable ) override;
virtual css::uno::Reference< css::sdbc::XResultSet > SAL_CALL getVersionColumns( const css::uno::Any& catalog, const OUString& schema, const OUString& table ) override;
virtual css::uno::Reference< css::sdbc::XResultSet > SAL_CALL getPrimaryKeys( const css::uno::Any& catalog, const OUString& schema, const OUString& table ) override;
virtual css::uno::Reference< css::sdbc::XResultSet > SAL_CALL getImportedKeys( const css::uno::Any& catalog, const OUString& schema, const OUString& table ) override;
virtual css::uno::Reference< css::sdbc::XResultSet > SAL_CALL getExportedKeys( const css::uno::Any& catalog, const OUString& schema, const OUString& table ) override;
virtual css::uno::Reference< css::sdbc::XResultSet > SAL_CALL getCrossReference( const css::uno::Any& primaryCatalog, const OUString& primarySchema, const OUString& primaryTable, const css::uno::Any& foreignCatalog, const OUString& foreignSchema, const OUString& foreignTable ) override;
virtual css::uno::Reference< css::sdbc::XResultSet > SAL_CALL getTypeInfo( ) override;
virtual css::uno::Reference< css::sdbc::XResultSet > SAL_CALL getIndexInfo( const css::uno::Any& catalog, const OUString& schema, const OUString& table, sal_Bool unique, sal_Bool approximate ) override;
virtual sal_Bool SAL_CALL supportsResultSetType( sal_Int32 setType ) override;
virtual sal_Bool SAL_CALL supportsResultSetConcurrency( sal_Int32 setType, sal_Int32 concurrency ) override;
virtual sal_Bool SAL_CALL ownUpdatesAreVisible( sal_Int32 setType ) override;
virtual sal_Bool SAL_CALL ownDeletesAreVisible( sal_Int32 setType ) override;
virtual sal_Bool SAL_CALL ownInsertsAreVisible( sal_Int32 setType ) override;
virtual sal_Bool SAL_CALL othersUpdatesAreVisible( sal_Int32 setType ) override;
virtual sal_Bool SAL_CALL othersDeletesAreVisible( sal_Int32 setType ) override;
virtual sal_Bool SAL_CALL othersInsertsAreVisible( sal_Int32 setType ) override;
virtual sal_Bool SAL_CALL updatesAreDetected( sal_Int32 setType ) override;
virtual sal_Bool SAL_CALL deletesAreDetected( sal_Int32 setType ) override;
virtual sal_Bool SAL_CALL insertsAreDetected( sal_Int32 setType ) override;
virtual sal_Bool SAL_CALL supportsBatchUpdates( ) override;
virtual css::uno::Reference< css::sdbc::XResultSet > SAL_CALL getUDTs( const css::uno::Any& catalog, const OUString& schemaPattern, const OUString& typeNamePattern, const css::uno::Sequence< sal_Int32 >& types ) override;
virtual css::uno::Reference< css::sdbc::XConnection > SAL_CALL getConnection( ) override;
};
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
@@ -33,128 +33,128 @@
namespace connectivity::macab
{
class MacabConnection;
class MacabDriver;
class MacabConnection;
class MacabDriver;
typedef void* (SAL_CALL * ConnectionFactoryFunction)( void* _pDriver );
typedef void* (SAL_CALL * ConnectionFactoryFunction)( void* _pDriver );
typedef std::vector< css::uno::WeakReferenceHelper > OWeakRefArray;
typedef std::vector< css::uno::WeakReferenceHelper > OWeakRefArray;
// = MacabImplModule
// = MacabImplModule
class MacabImplModule
{
private:
/// Did we already attempt to load the module and to retrieve the symbols?
bool m_bAttemptedLoadModule;
oslModule m_hConnectorModule;
ConnectionFactoryFunction m_pConnectionFactoryFunc;
class MacabImplModule
{
private:
/// Did we already attempt to load the module and to retrieve the symbols?
bool m_bAttemptedLoadModule;
oslModule m_hConnectorModule;
ConnectionFactoryFunction m_pConnectionFactoryFunc;
public:
MacabImplModule();
public:
MacabImplModule();
/** determines whether there is a mac OS present in the environment
*/
bool isMacOSPresent();
/** determines whether there is a mac OS present in the environment
*/
bool isMacOSPresent();
/** initializes the implementation module.
/** initializes the implementation module.
@throws css::uno::RuntimeException
if the module could be loaded, but required symbols are missing
@throws css::sdbc::SQLException
if no Mac OS was found at all
*/
void init();
@throws css::uno::RuntimeException
if the module could be loaded, but required symbols are missing
@throws css::sdbc::SQLException
if no Mac OS was found at all
*/
void init();
/** shuts down the impl module
*/
void shutdown();
/** shuts down the impl module
*/
void shutdown();
/** creates a new connection
@precond
<member>init</member> has been called before
@throws css::uno::RuntimeException
if no connection object could be created (which is a severe error, normally impossible)
*/
MacabConnection* createConnection( MacabDriver* _pDriver ) const;
/** creates a new connection
@precond
<member>init</member> has been called before
@throws css::uno::RuntimeException
if no connection object could be created (which is a severe error, normally impossible)
*/
MacabConnection* createConnection( MacabDriver* _pDriver ) const;
private:
/** loads the implementation module and retrieves the needed symbols
private:
/** loads the implementation module and retrieves the needed symbols
Save against being called multiple times.
Save against being called multiple times.
@return <TRUE/> if the module could be loaded successfully.
@return <TRUE/> if the module could be loaded successfully.
@throws css::uno::RuntimeException
if the module could be loaded, but required symbols are missing
*/
bool impl_loadModule();
@throws css::uno::RuntimeException
if the module could be loaded, but required symbols are missing
*/
bool impl_loadModule();
/** unloads the implementation module, and resets all function pointers to <NULL/>
@precond m_hConnectorModule is not <NULL/>
*/
void impl_unloadModule();
};
/** unloads the implementation module, and resets all function pointers to <NULL/>
@precond m_hConnectorModule is not <NULL/>
*/
void impl_unloadModule();
};
// = MacabDriver
// = MacabDriver
typedef ::cppu::WeakComponentImplHelper< css::sdbc::XDriver,
css::lang::XServiceInfo,
css::frame::XTerminateListener > MacabDriver_BASE;
class MacabDriver : public MacabDriver_BASE
{
protected:
::osl::Mutex m_aMutex; // mutex is need to control member access
OWeakRefArray m_xConnections; // vector containing a list of all the
// MacabConnection objects for this Driver
css::uno::Reference< css::uno::XComponentContext >
m_xContext; // the multi-service factory
MacabImplModule m_aImplModule;
typedef ::cppu::WeakComponentImplHelper< css::sdbc::XDriver,
css::lang::XServiceInfo,
css::frame::XTerminateListener > MacabDriver_BASE;
class MacabDriver : public MacabDriver_BASE
{
protected:
::osl::Mutex m_aMutex; // mutex is need to control member access
OWeakRefArray m_xConnections; // vector containing a list of all the
// MacabConnection objects for this Driver
css::uno::Reference< css::uno::XComponentContext >
m_xContext; // the multi-service factory
MacabImplModule m_aImplModule;
public:
css::uno::Reference< css::uno::XComponentContext > const &
getComponentContext() const { return m_xContext; }
public:
css::uno::Reference< css::uno::XComponentContext > const &
getComponentContext() const { return m_xContext; }
/** returns the path of our configuration settings
*/
static OUString impl_getConfigurationSettingsPath();
/** returns the path of our configuration settings
*/
static OUString impl_getConfigurationSettingsPath();
explicit MacabDriver(const css::uno::Reference< css::uno::XComponentContext >& _rxContext);
protected:
explicit MacabDriver(const css::uno::Reference< css::uno::XComponentContext >& _rxContext);
protected:
// OComponentHelper
virtual void SAL_CALL disposing() override;
// OComponentHelper
virtual void SAL_CALL disposing() override;
// XServiceInfo
virtual OUString SAL_CALL getImplementationName( ) override;
virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) override;
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames( ) override;
// XServiceInfo
virtual OUString SAL_CALL getImplementationName( ) override;
virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) override;
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames( ) override;
// XDriver
virtual css::uno::Reference< css::sdbc::XConnection > SAL_CALL connect( const OUString& url, const css::uno::Sequence< css::beans::PropertyValue >& info ) override;
virtual sal_Bool SAL_CALL acceptsURL( const OUString& url ) override;
virtual css::uno::Sequence< css::sdbc::DriverPropertyInfo > SAL_CALL getPropertyInfo( const OUString& url, const css::uno::Sequence< css::beans::PropertyValue >& info ) override;
virtual sal_Int32 SAL_CALL getMajorVersion() override;
virtual sal_Int32 SAL_CALL getMinorVersion() override;
// XDriver
virtual css::uno::Reference< css::sdbc::XConnection > SAL_CALL connect( const OUString& url, const css::uno::Sequence< css::beans::PropertyValue >& info ) override;
virtual sal_Bool SAL_CALL acceptsURL( const OUString& url ) override;
virtual css::uno::Sequence< css::sdbc::DriverPropertyInfo > SAL_CALL getPropertyInfo( const OUString& url, const css::uno::Sequence< css::beans::PropertyValue >& info ) override;
virtual sal_Int32 SAL_CALL getMajorVersion() override;
virtual sal_Int32 SAL_CALL getMinorVersion() override;
// XTerminateListener
virtual void SAL_CALL queryTermination( const css::lang::EventObject& Event ) override;
virtual void SAL_CALL notifyTermination( const css::lang::EventObject& Event ) override;
// XTerminateListener
virtual void SAL_CALL queryTermination( const css::lang::EventObject& Event ) override;
virtual void SAL_CALL notifyTermination( const css::lang::EventObject& Event ) override;
// XEventListener
virtual void SAL_CALL disposing( const css::lang::EventObject& Source ) override;
// XEventListener
virtual void SAL_CALL disposing( const css::lang::EventObject& Source ) override;
private:
/** shuts down the library which contains the real implementations
private:
/** shuts down the library which contains the real implementations
This method is safe against being called multiple times
This method is safe against being called multiple times
@precond our mutex is locked
*/
void impl_shutdownImplementationModule();
};
@precond our mutex is locked
*/
void impl_shutdownImplementationModule();
};
}
@@ -29,10 +29,10 @@
namespace connectivity::macab
{
class MacabGroup: public MacabRecords {
public:
MacabGroup(const ABAddressBookRef _addressBook, const MacabRecords *_allRecords, const ABGroupRef _xGroup);
};
class MacabGroup: public MacabRecords {
public:
MacabGroup(const ABAddressBookRef _addressBook, const MacabRecords *_allRecords, const ABGroupRef _xGroup);
};
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
@@ -27,35 +27,35 @@
namespace connectivity::macab
{
class MacabHeader: public MacabRecord{
protected:
macabfield **sortRecord(sal_Int32 _start, sal_Int32 _length);
public:
MacabHeader();
MacabHeader(const sal_Int32 _size, macabfield **_fields);
virtual ~MacabHeader() override;
void operator+= (const MacabHeader *r);
OUString getString(const sal_Int32 i) const;
void sortRecord();
sal_Int32 getColumnNumber(std::u16string_view s) const;
class MacabHeader: public MacabRecord{
protected:
macabfield **sortRecord(sal_Int32 _start, sal_Int32 _length);
public:
MacabHeader();
MacabHeader(const sal_Int32 _size, macabfield **_fields);
virtual ~MacabHeader() override;
void operator+= (const MacabHeader *r);
OUString getString(const sal_Int32 i) const;
void sortRecord();
sal_Int32 getColumnNumber(std::u16string_view s) const;
static sal_Int32 compareFields(const macabfield *_field1, const macabfield *_field2);
static sal_Int32 compareFields(const macabfield *_field1, const macabfield *_field2);
MacabHeader *begin();
sal_Int32 end() const;
class iterator{
protected:
sal_Int32 id;
MacabHeader *record;
public:
iterator& operator= (MacabHeader *_record);
iterator();
void operator++ ();
bool operator!= (const sal_Int32 i) const;
bool operator== (const sal_Int32 i) const;
macabfield *operator* () const;
};
};
MacabHeader *begin();
sal_Int32 end() const;
class iterator{
protected:
sal_Int32 id;
MacabHeader *record;
public:
iterator& operator= (MacabHeader *_record);
iterator();
void operator++ ();
bool operator!= (const sal_Int32 i) const;
bool operator== (const sal_Int32 i) const;
macabfield *operator* () const;
};
};
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
@@ -28,84 +28,84 @@
namespace connectivity::macab
{
typedef ::cppu::ImplInheritanceHelper< MacabCommonStatement,
css::sdbc::XPreparedStatement,
css::sdbc::XParameters,
css::sdbc::XResultSetMetaDataSupplier,
css::lang::XServiceInfo> MacabPreparedStatement_BASE;
typedef ::cppu::ImplInheritanceHelper< MacabCommonStatement,
css::sdbc::XPreparedStatement,
css::sdbc::XParameters,
css::sdbc::XResultSetMetaDataSupplier,
css::lang::XServiceInfo> MacabPreparedStatement_BASE;
class MacabPreparedStatement : public MacabPreparedStatement_BASE
{
protected:
OUString m_sSqlStatement;
::rtl::Reference< MacabResultSetMetaData >
m_xMetaData;
bool m_bPrepared;
mutable sal_Int32 m_nParameterIndex;
OValueRow m_aParameterRow;
class MacabPreparedStatement : public MacabPreparedStatement_BASE
{
protected:
OUString m_sSqlStatement;
::rtl::Reference< MacabResultSetMetaData >
m_xMetaData;
bool m_bPrepared;
mutable sal_Int32 m_nParameterIndex;
OValueRow m_aParameterRow;
/// @throws css::sdbc::SQLException
void checkAndResizeParameters(sal_Int32 nParams);
/// @throws css::sdbc::SQLException
void setMacabFields() const;
/// @throws css::sdbc::SQLException
void checkAndResizeParameters(sal_Int32 nParams);
/// @throws css::sdbc::SQLException
void setMacabFields() const;
protected:
virtual void SAL_CALL setFastPropertyValue_NoBroadcast(
sal_Int32 nHandle,
const css::uno::Any& rValue) override;
protected:
virtual void SAL_CALL setFastPropertyValue_NoBroadcast(
sal_Int32 nHandle,
const css::uno::Any& rValue) override;
virtual void resetParameters() const override;
virtual void getNextParameter(OUString &rParameter) const override;
virtual ~MacabPreparedStatement() override;
virtual void resetParameters() const override;
virtual void getNextParameter(OUString &rParameter) const override;
virtual ~MacabPreparedStatement() override;
public:
DECLARE_SERVICE_INFO();
MacabPreparedStatement(MacabConnection* _pConnection, const OUString& sql);
public:
DECLARE_SERVICE_INFO();
MacabPreparedStatement(MacabConnection* _pConnection, const OUString& sql);
// OComponentHelper
virtual void SAL_CALL disposing() override;
// OComponentHelper
virtual void SAL_CALL disposing() override;
// XPreparedStatement
using MacabCommonStatement::executeQuery;
using MacabCommonStatement::executeUpdate;
using MacabCommonStatement::execute;
// XPreparedStatement
using MacabCommonStatement::executeQuery;
using MacabCommonStatement::executeUpdate;
using MacabCommonStatement::execute;
virtual css::uno::Reference< css::sdbc::XResultSet > SAL_CALL executeQuery( ) override;
virtual sal_Int32 SAL_CALL executeUpdate( ) override;
virtual sal_Bool SAL_CALL execute( ) override;
virtual css::uno::Reference< css::sdbc::XConnection > SAL_CALL getConnection( ) override;
virtual css::uno::Reference< css::sdbc::XResultSet > SAL_CALL executeQuery( ) override;
virtual sal_Int32 SAL_CALL executeUpdate( ) override;
virtual sal_Bool SAL_CALL execute( ) override;
virtual css::uno::Reference< css::sdbc::XConnection > SAL_CALL getConnection( ) override;
// XParameters
virtual void SAL_CALL setNull( sal_Int32 parameterIndex, sal_Int32 sqlType ) override;
virtual void SAL_CALL setObjectNull( sal_Int32 parameterIndex, sal_Int32 sqlType, const OUString& typeName ) override;
virtual void SAL_CALL setBoolean( sal_Int32 parameterIndex, sal_Bool x ) override;
virtual void SAL_CALL setByte( sal_Int32 parameterIndex, sal_Int8 x ) override;
virtual void SAL_CALL setShort( sal_Int32 parameterIndex, sal_Int16 x ) override;
virtual void SAL_CALL setInt( sal_Int32 parameterIndex, sal_Int32 x ) override;
virtual void SAL_CALL setLong( sal_Int32 parameterIndex, sal_Int64 x ) override;
virtual void SAL_CALL setFloat( sal_Int32 parameterIndex, float x ) override;
virtual void SAL_CALL setDouble( sal_Int32 parameterIndex, double x ) override;
virtual void SAL_CALL setString( sal_Int32 parameterIndex, const OUString& x ) override;
virtual void SAL_CALL setBytes( sal_Int32 parameterIndex, const css::uno::Sequence< sal_Int8 >& x ) override;
virtual void SAL_CALL setDate( sal_Int32 parameterIndex, const css::util::Date& x ) override;
virtual void SAL_CALL setTime( sal_Int32 parameterIndex, const css::util::Time& x ) override;
virtual void SAL_CALL setTimestamp( sal_Int32 parameterIndex, const css::util::DateTime& x ) override;
virtual void SAL_CALL setBinaryStream( sal_Int32 parameterIndex, const css::uno::Reference< css::io::XInputStream >& x, sal_Int32 length ) override;
virtual void SAL_CALL setCharacterStream( sal_Int32 parameterIndex, const css::uno::Reference< css::io::XInputStream >& x, sal_Int32 length ) override;
virtual void SAL_CALL setObject( sal_Int32 parameterIndex, const css::uno::Any& x ) override;
virtual void SAL_CALL setObjectWithInfo( sal_Int32 parameterIndex, const css::uno::Any& x, sal_Int32 targetSqlType, sal_Int32 scale ) override;
virtual void SAL_CALL setRef( sal_Int32 parameterIndex, const css::uno::Reference< css::sdbc::XRef >& x ) override;
virtual void SAL_CALL setBlob( sal_Int32 parameterIndex, const css::uno::Reference< css::sdbc::XBlob >& x ) override;
virtual void SAL_CALL setClob( sal_Int32 parameterIndex, const css::uno::Reference< css::sdbc::XClob >& x ) override;
virtual void SAL_CALL setArray( sal_Int32 parameterIndex, const css::uno::Reference< css::sdbc::XArray >& x ) override;
virtual void SAL_CALL clearParameters( ) override;
// XParameters
virtual void SAL_CALL setNull( sal_Int32 parameterIndex, sal_Int32 sqlType ) override;
virtual void SAL_CALL setObjectNull( sal_Int32 parameterIndex, sal_Int32 sqlType, const OUString& typeName ) override;
virtual void SAL_CALL setBoolean( sal_Int32 parameterIndex, sal_Bool x ) override;
virtual void SAL_CALL setByte( sal_Int32 parameterIndex, sal_Int8 x ) override;
virtual void SAL_CALL setShort( sal_Int32 parameterIndex, sal_Int16 x ) override;
virtual void SAL_CALL setInt( sal_Int32 parameterIndex, sal_Int32 x ) override;
virtual void SAL_CALL setLong( sal_Int32 parameterIndex, sal_Int64 x ) override;
virtual void SAL_CALL setFloat( sal_Int32 parameterIndex, float x ) override;
virtual void SAL_CALL setDouble( sal_Int32 parameterIndex, double x ) override;
virtual void SAL_CALL setString( sal_Int32 parameterIndex, const OUString& x ) override;
virtual void SAL_CALL setBytes( sal_Int32 parameterIndex, const css::uno::Sequence< sal_Int8 >& x ) override;
virtual void SAL_CALL setDate( sal_Int32 parameterIndex, const css::util::Date& x ) override;
virtual void SAL_CALL setTime( sal_Int32 parameterIndex, const css::util::Time& x ) override;
virtual void SAL_CALL setTimestamp( sal_Int32 parameterIndex, const css::util::DateTime& x ) override;
virtual void SAL_CALL setBinaryStream( sal_Int32 parameterIndex, const css::uno::Reference< css::io::XInputStream >& x, sal_Int32 length ) override;
virtual void SAL_CALL setCharacterStream( sal_Int32 parameterIndex, const css::uno::Reference< css::io::XInputStream >& x, sal_Int32 length ) override;
virtual void SAL_CALL setObject( sal_Int32 parameterIndex, const css::uno::Any& x ) override;
virtual void SAL_CALL setObjectWithInfo( sal_Int32 parameterIndex, const css::uno::Any& x, sal_Int32 targetSqlType, sal_Int32 scale ) override;
virtual void SAL_CALL setRef( sal_Int32 parameterIndex, const css::uno::Reference< css::sdbc::XRef >& x ) override;
virtual void SAL_CALL setBlob( sal_Int32 parameterIndex, const css::uno::Reference< css::sdbc::XBlob >& x ) override;
virtual void SAL_CALL setClob( sal_Int32 parameterIndex, const css::uno::Reference< css::sdbc::XClob >& x ) override;
virtual void SAL_CALL setArray( sal_Int32 parameterIndex, const css::uno::Reference< css::sdbc::XArray >& x ) override;
virtual void SAL_CALL clearParameters( ) override;
// XCloseable
virtual void SAL_CALL close( ) override;
// XCloseable
virtual void SAL_CALL close( ) override;
// XResultSetMetaDataSupplier
virtual css::uno::Reference< css::sdbc::XResultSetMetaData > SAL_CALL getMetaData( ) override;
};
// XResultSetMetaDataSupplier
virtual css::uno::Reference< css::sdbc::XResultSetMetaData > SAL_CALL getMetaData( ) override;
};
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
@@ -34,38 +34,38 @@
namespace connectivity::macab
{
/* a MacabRecord is at root a list of macabfields (which is just
* something to hold both a CFTypeRef (a CoreFoundation object) and
* its Address Book type.
*/
struct macabfield
{
CFTypeRef value;
ABPropertyType type;
};
/* a MacabRecord is at root a list of macabfields (which is just
* something to hold both a CFTypeRef (a CoreFoundation object) and
* its Address Book type.
*/
struct macabfield
{
CFTypeRef value;
ABPropertyType type;
};
class MacabRecord{
protected:
sal_Int32 size;
std::unique_ptr<macabfield *[]> fields;
protected:
void releaseFields();
public:
MacabRecord();
explicit MacabRecord(const sal_Int32 _size);
virtual ~MacabRecord();
void insertAtColumn (CFTypeRef _value, ABPropertyType _type, const sal_Int32 _column);
bool contains(const macabfield *_field) const;
bool contains(const CFTypeRef _value) const;
sal_Int32 getSize() const;
macabfield *copy(const sal_Int32 i) const;
macabfield *get(const sal_Int32 i) const;
class MacabRecord{
protected:
sal_Int32 size;
std::unique_ptr<macabfield *[]> fields;
protected:
void releaseFields();
public:
MacabRecord();
explicit MacabRecord(const sal_Int32 _size);
virtual ~MacabRecord();
void insertAtColumn (CFTypeRef _value, ABPropertyType _type, const sal_Int32 _column);
bool contains(const macabfield *_field) const;
bool contains(const CFTypeRef _value) const;
sal_Int32 getSize() const;
macabfield *copy(const sal_Int32 i) const;
macabfield *get(const sal_Int32 i) const;
static sal_Int32 compareFields(const macabfield *_field1, const macabfield *_field2);
static macabfield *createMacabField(const OUString& _newFieldString, const ABPropertyType _abtype);
static OUString fieldToString(const macabfield *_aField);
static sal_Int32 compareFields(const macabfield *_field1, const macabfield *_field2);
static macabfield *createMacabField(const OUString& _newFieldString, const ABPropertyType _abtype);
static OUString fieldToString(const macabfield *_aField);
};
};
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
@@ -35,91 +35,91 @@
namespace connectivity::macab
{
/* This struct is for converting CF types to AB types (Core Foundation
* types to Address Book types).
*/
struct lcl_CFType {
CFTypeID cf;
sal_Int32 ab;
};
/* This struct is for converting CF types to AB types (Core Foundation
* types to Address Book types).
*/
struct lcl_CFType {
CFTypeID cf;
sal_Int32 ab;
};
class MacabRecords{
protected:
/* MacabRecords is, at its core, a table of macabfields, in the
* form of a header and a list of objects of type MacabRecord.
* It also has a unique name that refers to the name of the table.
*/
sal_Int32 recordsSize;
sal_Int32 currentRecord;
CFStringRef recordType;
MacabHeader *header;
MacabRecord **records;
ABAddressBookRef addressBook;
OUString m_sName;
class MacabRecords{
protected:
/* MacabRecords is, at its core, a table of macabfields, in the
* form of a header and a list of objects of type MacabRecord.
* It also has a unique name that refers to the name of the table.
*/
sal_Int32 recordsSize;
sal_Int32 currentRecord;
CFStringRef recordType;
MacabHeader *header;
MacabRecord **records;
ABAddressBookRef addressBook;
OUString m_sName;
/* For converting CF types to AB types */
std::vector<lcl_CFType> lcl_CFTypes;
/* For converting CF types to AB types */
std::vector<lcl_CFType> lcl_CFTypes;
/* For required properties */
std::vector<CFStringRef> requiredProperties;
/* For required properties */
std::vector<CFStringRef> requiredProperties;
private:
/* All of the private methods are for creating a MacabHeader or a
* MacabRecord. They are used by the initialize method that goes
* about filling a MacabRecords using all of the records in the
* macOS Address Book.
*/
void bootstrap_CF_types();
void bootstrap_requiredProperties();
MacabHeader *createHeaderForProperty(const ABRecordRef _record, const CFStringRef _propertyName, const CFStringRef _recordType, const bool _isPropertyRequired) const;
MacabHeader *createHeaderForProperty(const ABPropertyType _propertyType, const CFTypeRef _propertyValue, const CFStringRef _propertyName) const;
ABPropertyType getABTypeFromCFType(const CFTypeID cf_type ) const;
void insertPropertyIntoMacabRecord(MacabRecord *_abrecord, const MacabHeader *_header, const OUString& _propertyName, const CFTypeRef _propertyValue) const;
void insertPropertyIntoMacabRecord(const ABPropertyType _propertyType, MacabRecord *_abrecord, const MacabHeader *_header, const OUString& _propertyName, const CFTypeRef _propertyValue) const;
public:
MacabRecords(const ABAddressBookRef _addressBook, MacabHeader *_header, MacabRecord **_records, sal_Int32 _numRecords);
explicit MacabRecords(const MacabRecords *_copy);
explicit MacabRecords(const ABAddressBookRef _addressBook);
~MacabRecords();
private:
/* All of the private methods are for creating a MacabHeader or a
* MacabRecord. They are used by the initialize method that goes
* about filling a MacabRecords using all of the records in the
* macOS Address Book.
*/
void bootstrap_CF_types();
void bootstrap_requiredProperties();
MacabHeader *createHeaderForProperty(const ABRecordRef _record, const CFStringRef _propertyName, const CFStringRef _recordType, const bool _isPropertyRequired) const;
MacabHeader *createHeaderForProperty(const ABPropertyType _propertyType, const CFTypeRef _propertyValue, const CFStringRef _propertyName) const;
ABPropertyType getABTypeFromCFType(const CFTypeID cf_type ) const;
void insertPropertyIntoMacabRecord(MacabRecord *_abrecord, const MacabHeader *_header, const OUString& _propertyName, const CFTypeRef _propertyValue) const;
void insertPropertyIntoMacabRecord(const ABPropertyType _propertyType, MacabRecord *_abrecord, const MacabHeader *_header, const OUString& _propertyName, const CFTypeRef _propertyValue) const;
public:
MacabRecords(const ABAddressBookRef _addressBook, MacabHeader *_header, MacabRecord **_records, sal_Int32 _numRecords);
explicit MacabRecords(const MacabRecords *_copy);
explicit MacabRecords(const ABAddressBookRef _addressBook);
~MacabRecords();
void initialize();
void initialize();
void setHeader(MacabHeader *_header);
MacabHeader *getHeader() const;
void setHeader(MacabHeader *_header);
MacabHeader *getHeader() const;
void setName(const OUString& _sName);
OUString const & getName() const;
void setName(const OUString& _sName);
OUString const & getName() const;
MacabRecord *insertRecord(MacabRecord *_newRecord, const sal_Int32 _location);
void insertRecord(MacabRecord *_newRecord);
MacabRecord *getRecord(const sal_Int32 _location) const;
void swap(const sal_Int32 _id1, const sal_Int32 _id2);
MacabRecord *insertRecord(MacabRecord *_newRecord, const sal_Int32 _location);
void insertRecord(MacabRecord *_newRecord);
MacabRecord *getRecord(const sal_Int32 _location) const;
void swap(const sal_Int32 _id1, const sal_Int32 _id2);
macabfield *getField(const sal_Int32 _recordNumber, const sal_Int32 _columnNumber) const;
macabfield *getField(const sal_Int32 _recordNumber, std::u16string_view _columnName) const;
sal_Int32 getFieldNumber(std::u16string_view _columnName) const;
macabfield *getField(const sal_Int32 _recordNumber, const sal_Int32 _columnNumber) const;
macabfield *getField(const sal_Int32 _recordNumber, std::u16string_view _columnName) const;
sal_Int32 getFieldNumber(std::u16string_view _columnName) const;
sal_Int32 size() const;
sal_Int32 size() const;
MacabHeader *createHeaderForRecordType(const CFArrayRef _records, const CFStringRef _recordType) const;
MacabRecord *createMacabRecord(const ABRecordRef _abrecord, const MacabHeader *_header, const CFStringRef _recordType) const;
MacabHeader *createHeaderForRecordType(const CFArrayRef _records, const CFStringRef _recordType) const;
MacabRecord *createMacabRecord(const ABRecordRef _abrecord, const MacabHeader *_header, const CFStringRef _recordType) const;
MacabRecords *begin();
sal_Int32 end() const;
class iterator{
protected:
MacabRecords *records;
public:
sal_Int32 id;
iterator& operator= (MacabRecords *_records);
iterator();
void operator++ ();
bool operator!= (const sal_Int32 i) const;
bool operator== (const sal_Int32 i) const;
MacabRecord *operator* () const;
};
MacabRecords *begin();
sal_Int32 end() const;
class iterator{
protected:
MacabRecords *records;
public:
sal_Int32 id;
iterator& operator= (MacabRecords *_records);
iterator();
void operator++ ();
bool operator!= (const sal_Int32 i) const;
bool operator== (const sal_Int32 i) const;
MacabRecord *operator* () const;
};
};
};
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
@@ -33,181 +33,181 @@
namespace connectivity::macab
{
/*
** MacabResultSet
*/
typedef ::cppu::WeakComponentImplHelper< css::sdbc::XResultSet,
css::sdbc::XRow,
css::sdbc::XResultSetMetaDataSupplier,
css::util::XCancellable,
css::sdbc::XWarningsSupplier,
css::sdbc::XResultSetUpdate,
css::sdbc::XRowUpdate,
css::sdbcx::XRowLocate,
css::sdbcx::XDeleteRows,
css::sdbc::XCloseable,
css::sdbc::XColumnLocate,
css::lang::XServiceInfo> MacabResultSet_BASE;
class MacabRecords;
/*
** MacabResultSet
*/
typedef ::cppu::WeakComponentImplHelper< css::sdbc::XResultSet,
css::sdbc::XRow,
css::sdbc::XResultSetMetaDataSupplier,
css::util::XCancellable,
css::sdbc::XWarningsSupplier,
css::sdbc::XResultSetUpdate,
css::sdbc::XRowUpdate,
css::sdbcx::XRowLocate,
css::sdbcx::XDeleteRows,
css::sdbc::XCloseable,
css::sdbc::XColumnLocate,
css::lang::XServiceInfo> MacabResultSet_BASE;
class MacabRecords;
class MacabResultSet : public cppu::BaseMutex,
public MacabResultSet_BASE,
public ::cppu::OPropertySetHelper,
public comphelper::OPropertyArrayUsageHelper<MacabResultSet>
class MacabResultSet : public cppu::BaseMutex,
public MacabResultSet_BASE,
public ::cppu::OPropertySetHelper,
public comphelper::OPropertyArrayUsageHelper<MacabResultSet>
{
protected:
::rtl::Reference< MacabCommonStatement > m_xStatement; // the statement that has created this result set
::rtl::Reference< MacabResultSetMetaData > m_xMetaData; // the description of the columns in this result set
MacabRecords * m_aMacabRecords; // address book entries matching the query
sal_Int32 m_nRowPos; // the current row within the result set
bool m_bWasNull; // last entry retrieved from this result set was NULL
OUString m_sTableName;
// OPropertyArrayUsageHelper
virtual ::cppu::IPropertyArrayHelper* createArrayHelper( ) const override;
// OPropertySetHelper
virtual ::cppu::IPropertyArrayHelper & SAL_CALL getInfoHelper() override;
virtual sal_Bool SAL_CALL convertFastPropertyValue(
css::uno::Any & rConvertedValue,
css::uno::Any & rOldValue,
sal_Int32 nHandle,
const css::uno::Any& rValue) override;
virtual void SAL_CALL setFastPropertyValue_NoBroadcast(
sal_Int32 nHandle,
const css::uno::Any& rValue) override;
virtual void SAL_CALL getFastPropertyValue(
css::uno::Any& rValue,
sal_Int32 nHandle) const override;
// you can't delete objects of this type
virtual ~MacabResultSet() override;
public:
DECLARE_SERVICE_INFO();
explicit MacabResultSet(MacabCommonStatement *pStmt);
css::uno::Reference< css::uno::XInterface > operator *()
{
protected:
::rtl::Reference< MacabCommonStatement > m_xStatement; // the statement that has created this result set
::rtl::Reference< MacabResultSetMetaData > m_xMetaData; // the description of the columns in this result set
MacabRecords * m_aMacabRecords; // address book entries matching the query
sal_Int32 m_nRowPos; // the current row within the result set
bool m_bWasNull; // last entry retrieved from this result set was NULL
OUString m_sTableName;
return css::uno::Reference< css::uno::XInterface >(*static_cast<MacabResultSet_BASE*>(this));
}
// OPropertyArrayUsageHelper
virtual ::cppu::IPropertyArrayHelper* createArrayHelper( ) const override;
void allMacabRecords();
void someMacabRecords(const class MacabCondition *pCondition);
void sortMacabRecords(const class MacabOrder *pOrder);
void setTableName(const OUString& _sTableName);
// OPropertySetHelper
virtual ::cppu::IPropertyArrayHelper & SAL_CALL getInfoHelper() override;
// ::cppu::OComponentHelper
virtual void SAL_CALL disposing() override;
virtual sal_Bool SAL_CALL convertFastPropertyValue(
css::uno::Any & rConvertedValue,
css::uno::Any & rOldValue,
sal_Int32 nHandle,
const css::uno::Any& rValue) override;
virtual void SAL_CALL setFastPropertyValue_NoBroadcast(
sal_Int32 nHandle,
const css::uno::Any& rValue) override;
virtual void SAL_CALL getFastPropertyValue(
css::uno::Any& rValue,
sal_Int32 nHandle) const override;
// XInterface
virtual css::uno::Any SAL_CALL queryInterface( const css::uno::Type & rType ) override;
virtual void SAL_CALL acquire() noexcept override;
virtual void SAL_CALL release() noexcept override;
// you can't delete objects of this type
virtual ~MacabResultSet() override;
// XTypeProvider
virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes( ) override;
public:
DECLARE_SERVICE_INFO();
// XPropertySet
virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) override;
explicit MacabResultSet(MacabCommonStatement *pStmt);
// XResultSet
virtual sal_Bool SAL_CALL isBeforeFirst( ) override;
virtual sal_Bool SAL_CALL isAfterLast( ) override;
virtual sal_Bool SAL_CALL isFirst( ) override;
virtual sal_Bool SAL_CALL isLast( ) override;
virtual void SAL_CALL beforeFirst( ) override;
virtual void SAL_CALL afterLast( ) override;
virtual sal_Bool SAL_CALL first( ) override;
virtual sal_Bool SAL_CALL last( ) override;
virtual sal_Int32 SAL_CALL getRow( ) override;
virtual sal_Bool SAL_CALL absolute( sal_Int32 row ) override;
virtual sal_Bool SAL_CALL relative( sal_Int32 rows ) override;
virtual sal_Bool SAL_CALL next( ) override;
virtual sal_Bool SAL_CALL previous( ) override;
virtual void SAL_CALL refreshRow( ) override;
virtual sal_Bool SAL_CALL rowUpdated( ) override;
virtual sal_Bool SAL_CALL rowInserted( ) override;
virtual sal_Bool SAL_CALL rowDeleted( ) override;
virtual css::uno::Reference< css::uno::XInterface > SAL_CALL getStatement( ) override;
css::uno::Reference< css::uno::XInterface > operator *()
{
return css::uno::Reference< css::uno::XInterface >(*static_cast<MacabResultSet_BASE*>(this));
}
// XRow
virtual sal_Bool SAL_CALL wasNull( ) override;
virtual OUString SAL_CALL getString( sal_Int32 columnIndex ) override;
virtual sal_Bool SAL_CALL getBoolean( sal_Int32 columnIndex ) override;
virtual sal_Int8 SAL_CALL getByte( sal_Int32 columnIndex ) override;
virtual sal_Int16 SAL_CALL getShort( sal_Int32 columnIndex ) override;
virtual sal_Int32 SAL_CALL getInt( sal_Int32 columnIndex ) override;
virtual sal_Int64 SAL_CALL getLong( sal_Int32 columnIndex ) override;
virtual float SAL_CALL getFloat( sal_Int32 columnIndex ) override;
virtual double SAL_CALL getDouble( sal_Int32 columnIndex ) override;
virtual css::uno::Sequence< sal_Int8 > SAL_CALL getBytes( sal_Int32 columnIndex ) override;
virtual css::util::Date SAL_CALL getDate( sal_Int32 columnIndex ) override;
virtual css::util::Time SAL_CALL getTime( sal_Int32 columnIndex ) override;
virtual css::util::DateTime SAL_CALL getTimestamp( sal_Int32 columnIndex ) override;
virtual css::uno::Reference< css::io::XInputStream > SAL_CALL getBinaryStream( sal_Int32 columnIndex ) override;
virtual css::uno::Reference< css::io::XInputStream > SAL_CALL getCharacterStream( sal_Int32 columnIndex ) override;
virtual css::uno::Any SAL_CALL getObject( sal_Int32 columnIndex, const css::uno::Reference< css::container::XNameAccess >& typeMap ) override;
virtual css::uno::Reference< css::sdbc::XRef > SAL_CALL getRef( sal_Int32 columnIndex ) override;
virtual css::uno::Reference< css::sdbc::XBlob > SAL_CALL getBlob( sal_Int32 columnIndex ) override;
virtual css::uno::Reference< css::sdbc::XClob > SAL_CALL getClob( sal_Int32 columnIndex ) override;
virtual css::uno::Reference< css::sdbc::XArray > SAL_CALL getArray( sal_Int32 columnIndex ) override;
void allMacabRecords();
void someMacabRecords(const class MacabCondition *pCondition);
void sortMacabRecords(const class MacabOrder *pOrder);
void setTableName(const OUString& _sTableName);
// XResultSetMetaDataSupplier
virtual css::uno::Reference< css::sdbc::XResultSetMetaData > SAL_CALL getMetaData( ) override;
// ::cppu::OComponentHelper
virtual void SAL_CALL disposing() override;
// XCancellable
virtual void SAL_CALL cancel( ) override;
// XInterface
virtual css::uno::Any SAL_CALL queryInterface( const css::uno::Type & rType ) override;
virtual void SAL_CALL acquire() noexcept override;
virtual void SAL_CALL release() noexcept override;
// XCloseable
virtual void SAL_CALL close( ) override;
// XTypeProvider
virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes( ) override;
// XWarningsSupplier
virtual css::uno::Any SAL_CALL getWarnings( ) override;
virtual void SAL_CALL clearWarnings( ) override;
// XPropertySet
virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) override;
// XResultSetUpdate
virtual void SAL_CALL insertRow( ) override;
virtual void SAL_CALL updateRow( ) override;
virtual void SAL_CALL deleteRow( ) override;
virtual void SAL_CALL cancelRowUpdates( ) override;
virtual void SAL_CALL moveToInsertRow( ) override;
virtual void SAL_CALL moveToCurrentRow( ) override;
// XRowUpdate
virtual void SAL_CALL updateNull( sal_Int32 columnIndex ) override;
virtual void SAL_CALL updateBoolean( sal_Int32 columnIndex, sal_Bool x ) override;
virtual void SAL_CALL updateByte( sal_Int32 columnIndex, sal_Int8 x ) override;
virtual void SAL_CALL updateShort( sal_Int32 columnIndex, sal_Int16 x ) override;
virtual void SAL_CALL updateInt( sal_Int32 columnIndex, sal_Int32 x ) override;
virtual void SAL_CALL updateLong( sal_Int32 columnIndex, sal_Int64 x ) override;
virtual void SAL_CALL updateFloat( sal_Int32 columnIndex, float x ) override;
virtual void SAL_CALL updateDouble( sal_Int32 columnIndex, double x ) override;
virtual void SAL_CALL updateString( sal_Int32 columnIndex, const OUString& x ) override;
virtual void SAL_CALL updateBytes( sal_Int32 columnIndex, const css::uno::Sequence< sal_Int8 >& x ) override;
virtual void SAL_CALL updateDate( sal_Int32 columnIndex, const css::util::Date& x ) override;
virtual void SAL_CALL updateTime( sal_Int32 columnIndex, const css::util::Time& x ) override;
virtual void SAL_CALL updateTimestamp( sal_Int32 columnIndex, const css::util::DateTime& x ) override;
virtual void SAL_CALL updateBinaryStream( sal_Int32 columnIndex, const css::uno::Reference< css::io::XInputStream >& x, sal_Int32 length ) override;
virtual void SAL_CALL updateCharacterStream( sal_Int32 columnIndex, const css::uno::Reference< css::io::XInputStream >& x, sal_Int32 length ) override;
virtual void SAL_CALL updateObject( sal_Int32 columnIndex, const css::uno::Any& x ) override;
virtual void SAL_CALL updateNumericObject( sal_Int32 columnIndex, const css::uno::Any& x, sal_Int32 scale ) override;
// XResultSet
virtual sal_Bool SAL_CALL isBeforeFirst( ) override;
virtual sal_Bool SAL_CALL isAfterLast( ) override;
virtual sal_Bool SAL_CALL isFirst( ) override;
virtual sal_Bool SAL_CALL isLast( ) override;
virtual void SAL_CALL beforeFirst( ) override;
virtual void SAL_CALL afterLast( ) override;
virtual sal_Bool SAL_CALL first( ) override;
virtual sal_Bool SAL_CALL last( ) override;
virtual sal_Int32 SAL_CALL getRow( ) override;
virtual sal_Bool SAL_CALL absolute( sal_Int32 row ) override;
virtual sal_Bool SAL_CALL relative( sal_Int32 rows ) override;
virtual sal_Bool SAL_CALL next( ) override;
virtual sal_Bool SAL_CALL previous( ) override;
virtual void SAL_CALL refreshRow( ) override;
virtual sal_Bool SAL_CALL rowUpdated( ) override;
virtual sal_Bool SAL_CALL rowInserted( ) override;
virtual sal_Bool SAL_CALL rowDeleted( ) override;
virtual css::uno::Reference< css::uno::XInterface > SAL_CALL getStatement( ) override;
// XColumnLocate
virtual sal_Int32 SAL_CALL findColumn( const OUString& columnName ) override;
// XRow
virtual sal_Bool SAL_CALL wasNull( ) override;
virtual OUString SAL_CALL getString( sal_Int32 columnIndex ) override;
virtual sal_Bool SAL_CALL getBoolean( sal_Int32 columnIndex ) override;
virtual sal_Int8 SAL_CALL getByte( sal_Int32 columnIndex ) override;
virtual sal_Int16 SAL_CALL getShort( sal_Int32 columnIndex ) override;
virtual sal_Int32 SAL_CALL getInt( sal_Int32 columnIndex ) override;
virtual sal_Int64 SAL_CALL getLong( sal_Int32 columnIndex ) override;
virtual float SAL_CALL getFloat( sal_Int32 columnIndex ) override;
virtual double SAL_CALL getDouble( sal_Int32 columnIndex ) override;
virtual css::uno::Sequence< sal_Int8 > SAL_CALL getBytes( sal_Int32 columnIndex ) override;
virtual css::util::Date SAL_CALL getDate( sal_Int32 columnIndex ) override;
virtual css::util::Time SAL_CALL getTime( sal_Int32 columnIndex ) override;
virtual css::util::DateTime SAL_CALL getTimestamp( sal_Int32 columnIndex ) override;
virtual css::uno::Reference< css::io::XInputStream > SAL_CALL getBinaryStream( sal_Int32 columnIndex ) override;
virtual css::uno::Reference< css::io::XInputStream > SAL_CALL getCharacterStream( sal_Int32 columnIndex ) override;
virtual css::uno::Any SAL_CALL getObject( sal_Int32 columnIndex, const css::uno::Reference< css::container::XNameAccess >& typeMap ) override;
virtual css::uno::Reference< css::sdbc::XRef > SAL_CALL getRef( sal_Int32 columnIndex ) override;
virtual css::uno::Reference< css::sdbc::XBlob > SAL_CALL getBlob( sal_Int32 columnIndex ) override;
virtual css::uno::Reference< css::sdbc::XClob > SAL_CALL getClob( sal_Int32 columnIndex ) override;
virtual css::uno::Reference< css::sdbc::XArray > SAL_CALL getArray( sal_Int32 columnIndex ) override;
// XRowLocate
virtual css::uno::Any SAL_CALL getBookmark( ) override;
virtual sal_Bool SAL_CALL moveToBookmark( const css::uno::Any& bookmark ) override;
virtual sal_Bool SAL_CALL moveRelativeToBookmark( const css::uno::Any& bookmark, sal_Int32 rows ) override;
virtual sal_Int32 SAL_CALL compareBookmarks( const css::uno::Any& firstItem, const css::uno::Any& secondItem ) override;
virtual sal_Bool SAL_CALL hasOrderedBookmarks( ) override;
virtual sal_Int32 SAL_CALL hashBookmark( const css::uno::Any& bookmark ) override;
// XResultSetMetaDataSupplier
virtual css::uno::Reference< css::sdbc::XResultSetMetaData > SAL_CALL getMetaData( ) override;
// XCancellable
virtual void SAL_CALL cancel( ) override;
// XCloseable
virtual void SAL_CALL close( ) override;
// XWarningsSupplier
virtual css::uno::Any SAL_CALL getWarnings( ) override;
virtual void SAL_CALL clearWarnings( ) override;
// XResultSetUpdate
virtual void SAL_CALL insertRow( ) override;
virtual void SAL_CALL updateRow( ) override;
virtual void SAL_CALL deleteRow( ) override;
virtual void SAL_CALL cancelRowUpdates( ) override;
virtual void SAL_CALL moveToInsertRow( ) override;
virtual void SAL_CALL moveToCurrentRow( ) override;
// XRowUpdate
virtual void SAL_CALL updateNull( sal_Int32 columnIndex ) override;
virtual void SAL_CALL updateBoolean( sal_Int32 columnIndex, sal_Bool x ) override;
virtual void SAL_CALL updateByte( sal_Int32 columnIndex, sal_Int8 x ) override;
virtual void SAL_CALL updateShort( sal_Int32 columnIndex, sal_Int16 x ) override;
virtual void SAL_CALL updateInt( sal_Int32 columnIndex, sal_Int32 x ) override;
virtual void SAL_CALL updateLong( sal_Int32 columnIndex, sal_Int64 x ) override;
virtual void SAL_CALL updateFloat( sal_Int32 columnIndex, float x ) override;
virtual void SAL_CALL updateDouble( sal_Int32 columnIndex, double x ) override;
virtual void SAL_CALL updateString( sal_Int32 columnIndex, const OUString& x ) override;
virtual void SAL_CALL updateBytes( sal_Int32 columnIndex, const css::uno::Sequence< sal_Int8 >& x ) override;
virtual void SAL_CALL updateDate( sal_Int32 columnIndex, const css::util::Date& x ) override;
virtual void SAL_CALL updateTime( sal_Int32 columnIndex, const css::util::Time& x ) override;
virtual void SAL_CALL updateTimestamp( sal_Int32 columnIndex, const css::util::DateTime& x ) override;
virtual void SAL_CALL updateBinaryStream( sal_Int32 columnIndex, const css::uno::Reference< css::io::XInputStream >& x, sal_Int32 length ) override;
virtual void SAL_CALL updateCharacterStream( sal_Int32 columnIndex, const css::uno::Reference< css::io::XInputStream >& x, sal_Int32 length ) override;
virtual void SAL_CALL updateObject( sal_Int32 columnIndex, const css::uno::Any& x ) override;
virtual void SAL_CALL updateNumericObject( sal_Int32 columnIndex, const css::uno::Any& x, sal_Int32 scale ) override;
// XColumnLocate
virtual sal_Int32 SAL_CALL findColumn( const OUString& columnName ) override;
// XRowLocate
virtual css::uno::Any SAL_CALL getBookmark( ) override;
virtual sal_Bool SAL_CALL moveToBookmark( const css::uno::Any& bookmark ) override;
virtual sal_Bool SAL_CALL moveRelativeToBookmark( const css::uno::Any& bookmark, sal_Int32 rows ) override;
virtual sal_Int32 SAL_CALL compareBookmarks( const css::uno::Any& firstItem, const css::uno::Any& secondItem ) override;
virtual sal_Bool SAL_CALL hasOrderedBookmarks( ) override;
virtual sal_Int32 SAL_CALL hashBookmark( const css::uno::Any& bookmark ) override;
// XDeleteRows
virtual css::uno::Sequence< sal_Int32 > SAL_CALL deleteRows( const css::uno::Sequence< css::uno::Any >& rows ) override;
};
// XDeleteRows
virtual css::uno::Sequence< sal_Int32 > SAL_CALL deleteRows( const css::uno::Sequence< css::uno::Any >& rows ) override;
};
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
@@ -27,54 +27,54 @@
namespace connectivity::macab
{
/*
** MacabResultSetMetaData
*/
class MacabResultSetMetaData : public ::cppu::WeakImplHelper< css::sdbc::XResultSetMetaData>
{
MacabConnection* m_pConnection;
OUString m_sTableName;
std::vector<sal_Int32> m_aMacabFields; // for each selected column, contains the number
// of the corresponding AddressBook field
/*
** MacabResultSetMetaData
*/
class MacabResultSetMetaData : public ::cppu::WeakImplHelper< css::sdbc::XResultSetMetaData>
{
MacabConnection* m_pConnection;
OUString m_sTableName;
std::vector<sal_Int32> m_aMacabFields; // for each selected column, contains the number
// of the corresponding AddressBook field
protected:
virtual ~MacabResultSetMetaData() override;
protected:
virtual ~MacabResultSetMetaData() override;
public:
MacabResultSetMetaData(MacabConnection* _pConnection, OUString const & _sTableName);
public:
MacabResultSetMetaData(MacabConnection* _pConnection, OUString const & _sTableName);
// avoid ambiguous cast error from the compiler
operator css::uno::Reference< css::sdbc::XResultSetMetaData > () noexcept
{ return this; }
// avoid ambiguous cast error from the compiler
operator css::uno::Reference< css::sdbc::XResultSetMetaData > () noexcept
{ return this; }
/// @throws css::sdbc::SQLException
void setMacabFields(
const ::rtl::Reference<connectivity::OSQLColumns> &xColumns);
sal_uInt32 fieldAtColumn(sal_Int32 columnIndex) const
{ return m_aMacabFields[columnIndex - 1]; }
/// @throws css::sdbc::SQLException
void setMacabFields(
const ::rtl::Reference<connectivity::OSQLColumns> &xColumns);
sal_uInt32 fieldAtColumn(sal_Int32 columnIndex) const
{ return m_aMacabFields[columnIndex - 1]; }
virtual sal_Int32 SAL_CALL getColumnCount( ) override;
virtual sal_Bool SAL_CALL isAutoIncrement( sal_Int32 column ) override;
virtual sal_Bool SAL_CALL isCaseSensitive( sal_Int32 column ) override;
virtual sal_Bool SAL_CALL isSearchable( sal_Int32 column ) override;
virtual sal_Bool SAL_CALL isCurrency( sal_Int32 column ) override;
virtual sal_Int32 SAL_CALL isNullable( sal_Int32 column ) override;
virtual sal_Bool SAL_CALL isSigned( sal_Int32 column ) override;
virtual sal_Int32 SAL_CALL getColumnDisplaySize( sal_Int32 column ) override;
virtual OUString SAL_CALL getColumnLabel( sal_Int32 column ) override;
virtual OUString SAL_CALL getColumnName( sal_Int32 column ) override;
virtual OUString SAL_CALL getSchemaName( sal_Int32 column ) override;
virtual sal_Int32 SAL_CALL getPrecision( sal_Int32 column ) override;
virtual sal_Int32 SAL_CALL getScale( sal_Int32 column ) override;
virtual OUString SAL_CALL getTableName( sal_Int32 column ) override;
virtual OUString SAL_CALL getCatalogName( sal_Int32 column ) override;
virtual sal_Int32 SAL_CALL getColumnType( sal_Int32 column ) override;
virtual OUString SAL_CALL getColumnTypeName( sal_Int32 column ) override;
virtual sal_Bool SAL_CALL isReadOnly( sal_Int32 column ) override;
virtual sal_Bool SAL_CALL isWritable( sal_Int32 column ) override;
virtual sal_Bool SAL_CALL isDefinitelyWritable( sal_Int32 column ) override;
virtual OUString SAL_CALL getColumnServiceName( sal_Int32 column ) override;
};
virtual sal_Int32 SAL_CALL getColumnCount( ) override;
virtual sal_Bool SAL_CALL isAutoIncrement( sal_Int32 column ) override;
virtual sal_Bool SAL_CALL isCaseSensitive( sal_Int32 column ) override;
virtual sal_Bool SAL_CALL isSearchable( sal_Int32 column ) override;
virtual sal_Bool SAL_CALL isCurrency( sal_Int32 column ) override;
virtual sal_Int32 SAL_CALL isNullable( sal_Int32 column ) override;
virtual sal_Bool SAL_CALL isSigned( sal_Int32 column ) override;
virtual sal_Int32 SAL_CALL getColumnDisplaySize( sal_Int32 column ) override;
virtual OUString SAL_CALL getColumnLabel( sal_Int32 column ) override;
virtual OUString SAL_CALL getColumnName( sal_Int32 column ) override;
virtual OUString SAL_CALL getSchemaName( sal_Int32 column ) override;
virtual sal_Int32 SAL_CALL getPrecision( sal_Int32 column ) override;
virtual sal_Int32 SAL_CALL getScale( sal_Int32 column ) override;
virtual OUString SAL_CALL getTableName( sal_Int32 column ) override;
virtual OUString SAL_CALL getCatalogName( sal_Int32 column ) override;
virtual sal_Int32 SAL_CALL getColumnType( sal_Int32 column ) override;
virtual OUString SAL_CALL getColumnTypeName( sal_Int32 column ) override;
virtual sal_Bool SAL_CALL isReadOnly( sal_Int32 column ) override;
virtual sal_Bool SAL_CALL isWritable( sal_Int32 column ) override;
virtual sal_Bool SAL_CALL isDefinitelyWritable( sal_Int32 column ) override;
virtual OUString SAL_CALL getColumnServiceName( sal_Int32 column ) override;
};
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
@@ -33,137 +33,137 @@
namespace connectivity::macab
{
typedef ::cppu::WeakComponentImplHelper< css::sdbc::XStatement,
css::sdbc::XWarningsSupplier,
css::util::XCancellable,
css::sdbc::XCloseable> MacabCommonStatement_BASE;
typedef ::cppu::WeakComponentImplHelper< css::sdbc::XStatement,
css::sdbc::XWarningsSupplier,
css::util::XCancellable,
css::sdbc::XCloseable> MacabCommonStatement_BASE;
// Class MacabCommonStatement
// is a base class for the normal statement and for the prepared statement
// Class MacabCommonStatement
// is a base class for the normal statement and for the prepared statement
class MacabCommonStatement : public cppu::BaseMutex,
public MacabCommonStatement_BASE,
public ::cppu::OPropertySetHelper,
public comphelper::OPropertyArrayUsageHelper<MacabCommonStatement>
class MacabCommonStatement : public cppu::BaseMutex,
public MacabCommonStatement_BASE,
public ::cppu::OPropertySetHelper,
public comphelper::OPropertyArrayUsageHelper<MacabCommonStatement>
{
css::sdbc::SQLWarning m_aLastWarning;
{
css::sdbc::SQLWarning m_aLastWarning;
protected:
connectivity::OSQLParser m_aParser;
connectivity::OSQLParseTreeIterator m_aSQLIterator;
connectivity::OSQLParseNode* m_pParseTree;
MacabConnection* m_pConnection; // The owning Connection object
MacabHeader* m_pHeader; // The header of the address book on which to run queries (provided by m_pConnection)
css::uno::WeakReference< css::sdbc::XResultSet> m_xResultSet; // The last ResultSet created
protected:
connectivity::OSQLParser m_aParser;
connectivity::OSQLParseTreeIterator m_aSQLIterator;
connectivity::OSQLParseNode* m_pParseTree;
MacabConnection* m_pConnection; // The owning Connection object
MacabHeader* m_pHeader; // The header of the address book on which to run queries (provided by m_pConnection)
css::uno::WeakReference< css::sdbc::XResultSet> m_xResultSet; // The last ResultSet created
protected:
/// @throws css::sdbc::SQLException
class MacabCondition *analyseWhereClause(
const OSQLParseNode *pParseNode) const;
/// @throws css::sdbc::SQLException
class MacabOrder *analyseOrderByClause(
const OSQLParseNode *pParseNode) const;
OUString getTableName( ) const;
/// @throws css::sdbc::SQLException
void setMacabFields(class MacabResultSet *pResult) const;
/// @throws css::sdbc::SQLException
void selectRecords(MacabResultSet *pResult) const;
/// @throws css::sdbc::SQLException
void sortRecords(MacabResultSet *pResult) const;
protected:
/// @throws css::sdbc::SQLException
class MacabCondition *analyseWhereClause(
const OSQLParseNode *pParseNode) const;
/// @throws css::sdbc::SQLException
class MacabOrder *analyseOrderByClause(
const OSQLParseNode *pParseNode) const;
OUString getTableName( ) const;
/// @throws css::sdbc::SQLException
void setMacabFields(class MacabResultSet *pResult) const;
/// @throws css::sdbc::SQLException
void selectRecords(MacabResultSet *pResult) const;
/// @throws css::sdbc::SQLException
void sortRecords(MacabResultSet *pResult) const;
// OPropertyArrayUsageHelper
virtual ::cppu::IPropertyArrayHelper* createArrayHelper() const override;
// OPropertyArrayUsageHelper
virtual ::cppu::IPropertyArrayHelper* createArrayHelper() const override;
// OPropertySetHelper
virtual ::cppu::IPropertyArrayHelper & SAL_CALL getInfoHelper() override;
virtual sal_Bool SAL_CALL convertFastPropertyValue(
css::uno::Any & rConvertedValue,
css::uno::Any & rOldValue,
sal_Int32 nHandle,
const css::uno::Any& rValue) override;
virtual void SAL_CALL setFastPropertyValue_NoBroadcast(
sal_Int32 nHandle,
const css::uno::Any& rValue) override;
virtual void SAL_CALL getFastPropertyValue(
css::uno::Any& rValue,
sal_Int32 nHandle) const override;
// OPropertySetHelper
virtual ::cppu::IPropertyArrayHelper & SAL_CALL getInfoHelper() override;
virtual sal_Bool SAL_CALL convertFastPropertyValue(
css::uno::Any & rConvertedValue,
css::uno::Any & rOldValue,
sal_Int32 nHandle,
const css::uno::Any& rValue) override;
virtual void SAL_CALL setFastPropertyValue_NoBroadcast(
sal_Int32 nHandle,
const css::uno::Any& rValue) override;
virtual void SAL_CALL getFastPropertyValue(
css::uno::Any& rValue,
sal_Int32 nHandle) const override;
/// @throws css::sdbc::SQLException
virtual void resetParameters() const;
/// @throws css::sdbc::SQLException
virtual void getNextParameter(OUString &rParameter) const;
virtual ~MacabCommonStatement() override;
/// @throws css::sdbc::SQLException
virtual void resetParameters() const;
/// @throws css::sdbc::SQLException
virtual void getNextParameter(OUString &rParameter) const;
virtual ~MacabCommonStatement() override;
public:
using MacabCommonStatement_BASE::rBHelper;
public:
using MacabCommonStatement_BASE::rBHelper;
explicit MacabCommonStatement(MacabConnection *_pConnection);
using MacabCommonStatement_BASE::operator css::uno::Reference< css::uno::XInterface >;
explicit MacabCommonStatement(MacabConnection *_pConnection);
using MacabCommonStatement_BASE::operator css::uno::Reference< css::uno::XInterface >;
// OComponentHelper
using MacabCommonStatement_BASE::disposing;
// OComponentHelper
using MacabCommonStatement_BASE::disposing;
// XInterface
virtual void SAL_CALL release() noexcept override;
virtual void SAL_CALL acquire() noexcept override;
virtual css::uno::Any SAL_CALL queryInterface(
const css::uno::Type & rType
) override;
// XInterface
virtual void SAL_CALL release() noexcept override;
virtual void SAL_CALL acquire() noexcept override;
virtual css::uno::Any SAL_CALL queryInterface(
const css::uno::Type & rType
) override;
// XTypeProvider
virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes(
) override;
// XTypeProvider
virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes(
) override;
// XPropertySet
virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo(
) override;
// XPropertySet
virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo(
) override;
// XStatement
virtual css::uno::Reference< css::sdbc::XResultSet > SAL_CALL executeQuery(
const OUString& sql ) override;
virtual sal_Int32 SAL_CALL executeUpdate(
const OUString& sql ) override;
virtual sal_Bool SAL_CALL execute(
const OUString& sql ) override;
virtual css::uno::Reference< css::sdbc::XConnection > SAL_CALL getConnection(
) override;
// XStatement
virtual css::uno::Reference< css::sdbc::XResultSet > SAL_CALL executeQuery(
const OUString& sql ) override;
virtual sal_Int32 SAL_CALL executeUpdate(
const OUString& sql ) override;
virtual sal_Bool SAL_CALL execute(
const OUString& sql ) override;
virtual css::uno::Reference< css::sdbc::XConnection > SAL_CALL getConnection(
) override;
// XWarningsSupplier
virtual css::uno::Any SAL_CALL getWarnings(
) override;
virtual void SAL_CALL clearWarnings(
) override;
// XWarningsSupplier
virtual css::uno::Any SAL_CALL getWarnings(
) override;
virtual void SAL_CALL clearWarnings(
) override;
// XCancellable
virtual void SAL_CALL cancel(
) override;
// XCancellable
virtual void SAL_CALL cancel(
) override;
// XCloseable
virtual void SAL_CALL close(
) override;
// XCloseable
virtual void SAL_CALL close(
) override;
// other methods
MacabConnection* getOwnConnection() const { return m_pConnection; }
};
// other methods
MacabConnection* getOwnConnection() const { return m_pConnection; }
};
// Class MacabStatement
// Class MacabStatement
typedef ::cppu::ImplInheritanceHelper<
MacabCommonStatement, css::lang::XServiceInfo > MacabStatement_BASE;
typedef ::cppu::ImplInheritanceHelper<
MacabCommonStatement, css::lang::XServiceInfo > MacabStatement_BASE;
class MacabStatement : public MacabStatement_BASE
{
protected:
virtual ~MacabStatement() override { }
class MacabStatement : public MacabStatement_BASE
{
protected:
virtual ~MacabStatement() override { }
public:
explicit MacabStatement(MacabConnection* _pConnection);
DECLARE_SERVICE_INFO();
};
public:
explicit MacabStatement(MacabConnection* _pConnection);
DECLARE_SERVICE_INFO();
};
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
@@ -24,31 +24,31 @@
namespace connectivity::macab
{
typedef connectivity::sdbcx::OTable MacabTable_TYPEDEF;
typedef connectivity::sdbcx::OTable MacabTable_TYPEDEF;
class MacabTable : public MacabTable_TYPEDEF
{
css::uno::Reference< css::sdbc::XDatabaseMetaData > m_xMetaData;
MacabConnection* m_pConnection;
class MacabTable : public MacabTable_TYPEDEF
{
css::uno::Reference< css::sdbc::XDatabaseMetaData > m_xMetaData;
MacabConnection* m_pConnection;
public:
MacabTable( sdbcx::OCollection* _pTables, MacabConnection* _pConnection);
MacabTable( sdbcx::OCollection* _pTables,
MacabConnection* _pConnection,
const OUString& Name,
const OUString& Type,
const OUString& Description = OUString(),
const OUString& SchemaName = OUString(),
const OUString& CatalogName = OUString()
);
public:
MacabTable( sdbcx::OCollection* _pTables, MacabConnection* _pConnection);
MacabTable( sdbcx::OCollection* _pTables,
MacabConnection* _pConnection,
const OUString& Name,
const OUString& Type,
const OUString& Description = OUString(),
const OUString& SchemaName = OUString(),
const OUString& CatalogName = OUString()
);
MacabConnection* getConnection() { return m_pConnection;}
MacabConnection* getConnection() { return m_pConnection;}
virtual void refreshColumns() override;
virtual void refreshColumns() override;
OUString const & getTableName() const { return m_Name; }
OUString const & getSchema() const { return m_SchemaName; }
};
OUString const & getTableName() const { return m_Name; }
OUString const & getSchema() const { return m_SchemaName; }
};
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
@@ -24,26 +24,26 @@
namespace connectivity::macab
{
class MacabTables : public sdbcx::OCollection
{
css::uno::Reference< css::sdbc::XDatabaseMetaData > m_xMetaData;
class MacabTables : public sdbcx::OCollection
{
css::uno::Reference< css::sdbc::XDatabaseMetaData > m_xMetaData;
protected:
virtual css::uno::Reference< css::beans::XPropertySet > createObject(const OUString& _rName) override;
virtual void impl_refresh() override;
protected:
virtual css::uno::Reference< css::beans::XPropertySet > createObject(const OUString& _rName) override;
virtual void impl_refresh() override;
public:
MacabTables(
const css::uno::Reference< css::sdbc::XDatabaseMetaData >& _rMetaData,
::cppu::OWeakObject& _rParent,
::osl::Mutex& _rMutex,
const ::std::vector< OUString> &_rVector)
: sdbcx::OCollection(_rParent,true,_rMutex,_rVector),
m_xMetaData(_rMetaData)
{ }
public:
MacabTables(
const css::uno::Reference< css::sdbc::XDatabaseMetaData >& _rMetaData,
::cppu::OWeakObject& _rParent,
::osl::Mutex& _rMutex,
const ::std::vector< OUString> &_rVector)
: sdbcx::OCollection(_rParent,true,_rMutex,_rVector),
m_xMetaData(_rMetaData)
{ }
virtual void disposing() override;
};
virtual void disposing() override;
};
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
@@ -29,36 +29,36 @@
namespace connectivity::macab
{
class MacabOrder
{
public:
virtual ~MacabOrder();
class MacabOrder
{
public:
virtual ~MacabOrder();
virtual sal_Int32 compare(const MacabRecord *record1, const MacabRecord *record2) const = 0;
};
virtual sal_Int32 compare(const MacabRecord *record1, const MacabRecord *record2) const = 0;
};
class MacabSimpleOrder : public MacabOrder
{
sal_Int32 m_nFieldNumber;
bool m_bAscending;
class MacabSimpleOrder : public MacabOrder
{
sal_Int32 m_nFieldNumber;
bool m_bAscending;
public:
MacabSimpleOrder(MacabHeader const *header, std::u16string_view sColumnName, bool bAscending);
public:
MacabSimpleOrder(MacabHeader const *header, std::u16string_view sColumnName, bool bAscending);
virtual sal_Int32 compare(const MacabRecord *record1, const MacabRecord *record2) const override;
};
virtual sal_Int32 compare(const MacabRecord *record1, const MacabRecord *record2) const override;
};
class MacabComplexOrder : public MacabOrder
{
std::vector<std::unique_ptr<MacabOrder>> m_aOrders;
class MacabComplexOrder : public MacabOrder
{
std::vector<std::unique_ptr<MacabOrder>> m_aOrders;
public:
MacabComplexOrder();
virtual ~MacabComplexOrder() override;
public:
MacabComplexOrder();
virtual ~MacabComplexOrder() override;
void addOrder(MacabOrder *pOrder);
virtual sal_Int32 compare(const MacabRecord *record1, const MacabRecord *record2) const override;
};
void addOrder(MacabOrder *pOrder);
virtual sal_Int32 compare(const MacabRecord *record1, const MacabRecord *record2) const override;
};
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
@@ -36,107 +36,107 @@
namespace connectivity::macab
{
inline OUString CFStringToOUString(const CFStringRef sOrig)
{
/* Copied all-but directly from code by Florian Heckl in
* cws_src680_aquafilepicker01
* File was: fpicker/source/aqua/CFStringUtilities
* I only removed commented debugging lines and changed variable
* names.
inline OUString CFStringToOUString(const CFStringRef sOrig)
{
/* Copied all-but directly from code by Florian Heckl in
* cws_src680_aquafilepicker01
* File was: fpicker/source/aqua/CFStringUtilities
* I only removed commented debugging lines and changed variable
* names.
*/
if (nullptr == sOrig) {
return OUString();
}
CFRetain(sOrig);
CFIndex nStringLength = CFStringGetLength(sOrig);
auto const unichars = std::make_unique<UniChar[]>(nStringLength+1);
//'close' the string buffer correctly
unichars[nStringLength] = '\0';
CFStringGetCharacters (sOrig, CFRangeMake(0,nStringLength), unichars.get());
CFRelease(sOrig);
return OUString(reinterpret_cast<sal_Unicode *>(unichars.get()));
}
inline CFStringRef OUStringToCFString(const OUString& aString)
{
/* Copied directly from code by Florian Heckl in
* cws_src680_aquafilepicker01
* File was: fpicker/source/aqua/CFStringUtilities
*/
CFStringRef ref = CFStringCreateWithCharacters(kCFAllocatorDefault, reinterpret_cast<UniChar const *>(aString.getStr()), aString.getLength());
return ref;
}
inline css::util::DateTime CFDateToDateTime(const CFDateRef _cfDate)
{
/* Carbon can give us the time since 2001 of any CFDateRef,
* and it also stores the time since 1970 as a constant,
* basically allowing us to get the unixtime of any
* CFDateRef. From there, it is just a matter of choosing what
* we want to do with it.
*/
if (nullptr == sOrig) {
return OUString();
}
CFRetain(sOrig);
CFIndex nStringLength = CFStringGetLength(sOrig);
auto const unichars = std::make_unique<UniChar[]>(nStringLength+1);
//'close' the string buffer correctly
unichars[nStringLength] = '\0';
CFStringGetCharacters (sOrig, CFRangeMake(0,nStringLength), unichars.get());
CFRelease(sOrig);
return OUString(reinterpret_cast<sal_Unicode *>(unichars.get()));
}
css::util::DateTime nRet;
double timeSince2001 = CFDateGetAbsoluteTime(_cfDate);
time_t unixtime = timeSince2001+kCFAbsoluteTimeIntervalSince1970;
struct tm *ptm = localtime(&unixtime);
nRet.Year = ptm->tm_year+1900;
nRet.Month = ptm->tm_mon+1;
nRet.Day = ptm->tm_mday;
nRet.Hours = ptm->tm_hour;
nRet.Minutes = ptm->tm_min;
nRet.Seconds = ptm->tm_sec;
nRet.NanoSeconds = 0;
return nRet;
}
inline CFStringRef OUStringToCFString(const OUString& aString)
inline OUString fixLabel(const OUString& _originalLabel)
{
/* Get the length, and make sure that there is actually a string
* here.
*/
if(_originalLabel.startsWith("_$!<"))
{
/* Copied directly from code by Florian Heckl in
* cws_src680_aquafilepicker01
* File was: fpicker/source/aqua/CFStringUtilities
*/
CFStringRef ref = CFStringCreateWithCharacters(kCFAllocatorDefault, reinterpret_cast<UniChar const *>(aString.getStr()), aString.getLength());
return ref;
return _originalLabel.copy(4,_originalLabel.getLength()-8);
}
return _originalLabel;
}
inline css::util::DateTime CFDateToDateTime(const CFDateRef _cfDate)
inline sal_Int32 ABTypeToDataType(const ABPropertyType _abType)
{
sal_Int32 dataType;
switch(_abType)
{
/* Carbon can give us the time since 2001 of any CFDateRef,
* and it also stores the time since 1970 as a constant,
* basically allowing us to get the unixtime of any
* CFDateRef. From there, it is just a matter of choosing what
* we want to do with it.
*/
css::util::DateTime nRet;
double timeSince2001 = CFDateGetAbsoluteTime(_cfDate);
time_t unixtime = timeSince2001+kCFAbsoluteTimeIntervalSince1970;
struct tm *ptm = localtime(&unixtime);
nRet.Year = ptm->tm_year+1900;
nRet.Month = ptm->tm_mon+1;
nRet.Day = ptm->tm_mday;
nRet.Hours = ptm->tm_hour;
nRet.Minutes = ptm->tm_min;
nRet.Seconds = ptm->tm_sec;
nRet.NanoSeconds = 0;
return nRet;
case kABStringProperty:
dataType = css::sdbc::DataType::CHAR;
break;
case kABDateProperty:
dataType = css::sdbc::DataType::TIMESTAMP;
break;
case kABIntegerProperty:
dataType = css::sdbc::DataType::INTEGER;
break;
case kABRealProperty:
dataType = css::sdbc::DataType::FLOAT;
break;
default:
dataType = -1;
}
return dataType;
}
inline OUString fixLabel(const OUString& _originalLabel)
{
/* Get the length, and make sure that there is actually a string
* here.
*/
if(_originalLabel.startsWith("_$!<"))
{
return _originalLabel.copy(4,_originalLabel.getLength()-8);
}
return _originalLabel;
}
inline sal_Int32 ABTypeToDataType(const ABPropertyType _abType)
{
sal_Int32 dataType;
switch(_abType)
{
case kABStringProperty:
dataType = css::sdbc::DataType::CHAR;
break;
case kABDateProperty:
dataType = css::sdbc::DataType::TIMESTAMP;
break;
case kABIntegerProperty:
dataType = css::sdbc::DataType::INTEGER;
break;
case kABRealProperty:
dataType = css::sdbc::DataType::FLOAT;
break;
default:
dataType = -1;
}
return dataType;
}
void impl_throwError(TranslateId pErrorId);
void impl_throwError(TranslateId pErrorId);
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
@@ -29,49 +29,49 @@
namespace connectivity::mozab
{
typedef ::cppu::WeakComponentImplHelper< css::mozilla::XMozillaBootstrap,
css::lang::XServiceInfo > OMozillaBootstrap_BASE;
class ProfileAccess;
class ProfileManager;
class MozillaBootstrap : public OMozillaBootstrap_BASE
{
private:
::osl::Mutex m_aMutex; // mutex is need to control member access
virtual ~MozillaBootstrap() override;
std::unique_ptr<ProfileAccess> m_ProfileAccess;
public:
typedef ::cppu::WeakComponentImplHelper< css::mozilla::XMozillaBootstrap,
css::lang::XServiceInfo > OMozillaBootstrap_BASE;
class ProfileAccess;
class ProfileManager;
class MozillaBootstrap : public OMozillaBootstrap_BASE
{
private:
::osl::Mutex m_aMutex; // mutex is need to control member access
virtual ~MozillaBootstrap() override;
std::unique_ptr<ProfileAccess> m_ProfileAccess;
public:
MozillaBootstrap();
MozillaBootstrap();
// OComponentHelper
virtual void SAL_CALL disposing() override;
// OComponentHelper
virtual void SAL_CALL disposing() override;
// XServiceInfo
virtual OUString SAL_CALL getImplementationName( ) override;
virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) override;
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames( ) override;
// XServiceInfo
virtual OUString SAL_CALL getImplementationName( ) override;
virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) override;
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames( ) override;
// XMozillaBootstrap
// XMozillaBootstrap
// XProfileDiscover
virtual ::sal_Int32 SAL_CALL getProfileCount( css::mozilla::MozillaProductType product) override;
virtual ::sal_Int32 SAL_CALL getProfileList( css::mozilla::MozillaProductType product, css::uno::Sequence< OUString >& list ) override;
virtual OUString SAL_CALL getDefaultProfile( css::mozilla::MozillaProductType product ) override;
virtual OUString SAL_CALL getProfilePath( css::mozilla::MozillaProductType product, const OUString& profileName ) override;
virtual sal_Bool SAL_CALL isProfileLocked( css::mozilla::MozillaProductType product, const OUString& profileName ) override;
virtual sal_Bool SAL_CALL getProfileExists( css::mozilla::MozillaProductType product, const OUString& profileName ) override;
// XProfileDiscover
virtual ::sal_Int32 SAL_CALL getProfileCount( css::mozilla::MozillaProductType product) override;
virtual ::sal_Int32 SAL_CALL getProfileList( css::mozilla::MozillaProductType product, css::uno::Sequence< OUString >& list ) override;
virtual OUString SAL_CALL getDefaultProfile( css::mozilla::MozillaProductType product ) override;
virtual OUString SAL_CALL getProfilePath( css::mozilla::MozillaProductType product, const OUString& profileName ) override;
virtual sal_Bool SAL_CALL isProfileLocked( css::mozilla::MozillaProductType product, const OUString& profileName ) override;
virtual sal_Bool SAL_CALL getProfileExists( css::mozilla::MozillaProductType product, const OUString& profileName ) override;
// XProfileManager
virtual ::sal_Int32 SAL_CALL bootupProfile( css::mozilla::MozillaProductType product, const OUString& profileName ) override;
virtual ::sal_Int32 SAL_CALL shutdownProfile( ) override;
virtual css::mozilla::MozillaProductType SAL_CALL getCurrentProduct( ) override;
virtual OUString SAL_CALL getCurrentProfile( ) override;
virtual sal_Bool SAL_CALL isCurrentProfileLocked( ) override;
virtual OUString SAL_CALL setCurrentProfile( css::mozilla::MozillaProductType product, const OUString& profileName ) override;
// XProfileManager
virtual ::sal_Int32 SAL_CALL bootupProfile( css::mozilla::MozillaProductType product, const OUString& profileName ) override;
virtual ::sal_Int32 SAL_CALL shutdownProfile( ) override;
virtual css::mozilla::MozillaProductType SAL_CALL getCurrentProduct( ) override;
virtual OUString SAL_CALL getCurrentProfile( ) override;
virtual sal_Bool SAL_CALL isCurrentProfileLocked( ) override;
virtual OUString SAL_CALL setCurrentProfile( css::mozilla::MozillaProductType product, const OUString& profileName ) override;
// XProxyRunner
virtual ::sal_Int32 SAL_CALL Run( const css::uno::Reference< css::mozilla::XCodeProxy >& aCode ) override;
};
// XProxyRunner
virtual ::sal_Int32 SAL_CALL Run( const css::uno::Reference< css::mozilla::XCodeProxy >& aCode ) override;
};
}
@@ -32,47 +32,47 @@ namespace connectivity::mozab { class ProfileStruct; }
typedef std::map<OUString, ::connectivity::mozab::ProfileStruct> ProfileList;
namespace connectivity::mozab
{
class ProfileStruct
{
class ProfileStruct
{
public:
ProfileStruct();
ProfileStruct(OUString aProfileName, OUString aProfilePath);
const OUString& getProfileName() const { return profileName;}
const OUString& getProfilePath() const;
private:
OUString profileName;
OUString profilePath;
};
public:
ProfileStruct();
ProfileStruct(OUString aProfileName, OUString aProfilePath);
const OUString& getProfileName() const { return profileName;}
const OUString& getProfilePath() const;
private:
OUString profileName;
OUString profilePath;
};
class ProductStruct
{
public:
OUString mCurrentProfileName;
ProfileList mProfileList;
};
class ProductStruct
{
public:
OUString mCurrentProfileName;
ProfileList mProfileList;
};
//Used to query profiles information
class ProfileAccess final
{
public:
~ProfileAccess();
ProfileAccess();
/// @throws css::uno::RuntimeException
OUString getProfilePath( css::mozilla::MozillaProductType product, const OUString& profileName );
/// @throws css::uno::RuntimeException
::sal_Int32 getProfileCount( css::mozilla::MozillaProductType product );
/// @throws css::uno::RuntimeException
::sal_Int32 getProfileList( css::mozilla::MozillaProductType product, css::uno::Sequence< OUString >& list );
/// @throws css::uno::RuntimeException
OUString getDefaultProfile( css::mozilla::MozillaProductType product );
/// @throws css::uno::RuntimeException
bool getProfileExists( css::mozilla::MozillaProductType product, const OUString& profileName );
private:
ProductStruct m_ProductProfileList[4];
void LoadProductsInfo();
void LoadXPToolkitProfiles(MozillaProductType product);
};
//Used to query profiles information
class ProfileAccess final
{
public:
~ProfileAccess();
ProfileAccess();
/// @throws css::uno::RuntimeException
OUString getProfilePath( css::mozilla::MozillaProductType product, const OUString& profileName );
/// @throws css::uno::RuntimeException
::sal_Int32 getProfileCount( css::mozilla::MozillaProductType product );
/// @throws css::uno::RuntimeException
::sal_Int32 getProfileList( css::mozilla::MozillaProductType product, css::uno::Sequence< OUString >& list );
/// @throws css::uno::RuntimeException
OUString getDefaultProfile( css::mozilla::MozillaProductType product );
/// @throws css::uno::RuntimeException
bool getProfileExists( css::mozilla::MozillaProductType product, const OUString& profileName );
private:
ProductStruct m_ProductProfileList[4];
void LoadProductsInfo();
void LoadXPToolkitProfiles(MozillaProductType product);
};
}
@@ -32,105 +32,105 @@ namespace comphelper { class OEventListenerHelper; }
namespace connectivity
{
class OOO_DLLPUBLIC_DBTOOLS ODatabaseMetaDataBase :
public cppu::BaseMutex,
public ::cppu::WeakImplHelper< css::sdbc::XDatabaseMetaData2,
css::lang::XEventListener>
class OOO_DLLPUBLIC_DBTOOLS ODatabaseMetaDataBase :
public cppu::BaseMutex,
public ::cppu::WeakImplHelper< css::sdbc::XDatabaseMetaData2,
css::lang::XEventListener>
{
private:
css::uno::Sequence< css::beans::PropertyValue > m_aConnectionInfo;
::connectivity::ODatabaseMetaDataResultSet::ORows m_aTypeInfoRows;
// cached database information
std::pair<bool,bool> m_isCatalogAtStart;
std::pair<bool,OUString> m_sCatalogSeparator;
std::pair<bool,OUString> m_sIdentifierQuoteString;
std::pair<bool,bool> m_supportsCatalogsInTableDefinitions;
std::pair<bool,bool> m_supportsSchemasInTableDefinitions;
std::pair<bool,bool> m_supportsCatalogsInDataManipulation;
std::pair<bool,bool> m_supportsSchemasInDataManipulation;
std::pair<bool,bool> m_supportsMixedCaseQuotedIdentifiers;
std::pair<bool,bool> m_supportsAlterTableWithAddColumn;
std::pair<bool,bool> m_supportsAlterTableWithDropColumn;
std::pair<bool,sal_Int32> m_MaxStatements;
std::pair<bool,sal_Int32> m_MaxTablesInSelect;
std::pair<bool,bool> m_storesMixedCaseQuotedIdentifiers;
template <typename T> T callImplMethod(std::pair<bool,T>& _rCache,const std::function<T(ODatabaseMetaDataBase *)>& _pImplMethod)
{
private:
css::uno::Sequence< css::beans::PropertyValue > m_aConnectionInfo;
::connectivity::ODatabaseMetaDataResultSet::ORows m_aTypeInfoRows;
// cached database information
std::pair<bool,bool> m_isCatalogAtStart;
std::pair<bool,OUString> m_sCatalogSeparator;
std::pair<bool,OUString> m_sIdentifierQuoteString;
std::pair<bool,bool> m_supportsCatalogsInTableDefinitions;
std::pair<bool,bool> m_supportsSchemasInTableDefinitions;
std::pair<bool,bool> m_supportsCatalogsInDataManipulation;
std::pair<bool,bool> m_supportsSchemasInDataManipulation;
std::pair<bool,bool> m_supportsMixedCaseQuotedIdentifiers;
std::pair<bool,bool> m_supportsAlterTableWithAddColumn;
std::pair<bool,bool> m_supportsAlterTableWithDropColumn;
std::pair<bool,sal_Int32> m_MaxStatements;
std::pair<bool,sal_Int32> m_MaxTablesInSelect;
std::pair<bool,bool> m_storesMixedCaseQuotedIdentifiers;
template <typename T> T callImplMethod(std::pair<bool,T>& _rCache,const std::function<T(ODatabaseMetaDataBase *)>& _pImplMethod)
::osl::MutexGuard aGuard( m_aMutex );
if ( !_rCache.first )
{
::osl::MutexGuard aGuard( m_aMutex );
if ( !_rCache.first )
{
_rCache.second = _pImplMethod(this);
_rCache.first = true;
}
return _rCache.second;
_rCache.second = _pImplMethod(this);
_rCache.first = true;
}
protected:
css::uno::Reference< css::sdbc::XConnection > m_xConnection;
rtl::Reference< comphelper::OEventListenerHelper> m_xListenerHelper; // forward the calls from the connection to me
return _rCache.second;
}
protected:
css::uno::Reference< css::sdbc::XConnection > m_xConnection;
rtl::Reference< comphelper::OEventListenerHelper> m_xListenerHelper; // forward the calls from the connection to me
virtual ~ODatabaseMetaDataBase() override;
virtual ~ODatabaseMetaDataBase() override;
protected:
virtual css::uno::Reference< css::sdbc::XResultSet > impl_getTypeInfo_throw() = 0;
// cached database information
virtual OUString impl_getIdentifierQuoteString_throw( ) = 0;
virtual bool impl_isCatalogAtStart_throw( ) = 0;
virtual OUString impl_getCatalogSeparator_throw( ) = 0;
virtual bool impl_supportsCatalogsInTableDefinitions_throw( ) = 0;
virtual bool impl_supportsSchemasInTableDefinitions_throw( ) = 0;
virtual bool impl_supportsCatalogsInDataManipulation_throw( ) = 0;
virtual bool impl_supportsSchemasInDataManipulation_throw( ) = 0;
virtual bool impl_supportsMixedCaseQuotedIdentifiers_throw( ) = 0;
virtual bool impl_supportsAlterTableWithAddColumn_throw( ) = 0;
virtual bool impl_supportsAlterTableWithDropColumn_throw( ) = 0;
virtual sal_Int32 impl_getMaxStatements_throw( ) = 0;
virtual sal_Int32 impl_getMaxTablesInSelect_throw( ) = 0;
virtual bool impl_storesMixedCaseQuotedIdentifiers_throw( ) = 0;
protected:
virtual css::uno::Reference< css::sdbc::XResultSet > impl_getTypeInfo_throw() = 0;
// cached database information
virtual OUString impl_getIdentifierQuoteString_throw( ) = 0;
virtual bool impl_isCatalogAtStart_throw( ) = 0;
virtual OUString impl_getCatalogSeparator_throw( ) = 0;
virtual bool impl_supportsCatalogsInTableDefinitions_throw( ) = 0;
virtual bool impl_supportsSchemasInTableDefinitions_throw( ) = 0;
virtual bool impl_supportsCatalogsInDataManipulation_throw( ) = 0;
virtual bool impl_supportsSchemasInDataManipulation_throw( ) = 0;
virtual bool impl_supportsMixedCaseQuotedIdentifiers_throw( ) = 0;
virtual bool impl_supportsAlterTableWithAddColumn_throw( ) = 0;
virtual bool impl_supportsAlterTableWithDropColumn_throw( ) = 0;
virtual sal_Int32 impl_getMaxStatements_throw( ) = 0;
virtual sal_Int32 impl_getMaxTablesInSelect_throw( ) = 0;
virtual bool impl_storesMixedCaseQuotedIdentifiers_throw( ) = 0;
public:
public:
ODatabaseMetaDataBase(const css::uno::Reference< css::sdbc::XConnection >& _rxConnection,const css::uno::Sequence< css::beans::PropertyValue >& _rInfo);
ODatabaseMetaDataBase(const css::uno::Reference< css::sdbc::XConnection >& _rxConnection,const css::uno::Sequence< css::beans::PropertyValue >& _rInfo);
// XDatabaseMetaData2
virtual css::uno::Sequence< css::beans::PropertyValue > SAL_CALL getConnectionInfo( ) override;
// XDatabaseMetaData2
virtual css::uno::Sequence< css::beans::PropertyValue > SAL_CALL getConnectionInfo( ) override;
// XEventListener
virtual void SAL_CALL disposing( const css::lang::EventObject& Source ) override;
// XEventListener
virtual void SAL_CALL disposing( const css::lang::EventObject& Source ) override;
virtual css::uno::Reference< css::sdbc::XResultSet > SAL_CALL getTypeInfo( ) override;
virtual css::uno::Reference< css::sdbc::XResultSet > SAL_CALL getProcedures( const css::uno::Any& catalog, const OUString& schemaPattern, const OUString& procedureNamePattern ) override;
virtual css::uno::Reference< css::sdbc::XResultSet > SAL_CALL getProcedureColumns( const css::uno::Any& catalog, const OUString& schemaPattern, const OUString& procedureNamePattern, const OUString& columnNamePattern ) override;
virtual css::uno::Reference< css::sdbc::XResultSet > SAL_CALL getSchemas( ) override;
virtual css::uno::Reference< css::sdbc::XResultSet > SAL_CALL getCatalogs( ) override;
virtual css::uno::Reference< css::sdbc::XResultSet > SAL_CALL getColumnPrivileges( const css::uno::Any& catalog, const OUString& schema, const OUString& table, const OUString& columnNamePattern ) override;
virtual css::uno::Reference< css::sdbc::XResultSet > SAL_CALL getTablePrivileges( const css::uno::Any& catalog, const OUString& schemaPattern, const OUString& tableNamePattern ) override;
virtual css::uno::Reference< css::sdbc::XResultSet > SAL_CALL getBestRowIdentifier( const css::uno::Any& catalog, const OUString& schema, const OUString& table, sal_Int32 scope, sal_Bool nullable ) override;
virtual css::uno::Reference< css::sdbc::XResultSet > SAL_CALL getVersionColumns( const css::uno::Any& catalog, const OUString& schema, const OUString& table ) override;
virtual css::uno::Reference< css::sdbc::XResultSet > SAL_CALL getPrimaryKeys( const css::uno::Any& catalog, const OUString& schema, const OUString& table ) override;
virtual css::uno::Reference< css::sdbc::XResultSet > SAL_CALL getImportedKeys( const css::uno::Any& catalog, const OUString& schema, const OUString& table ) override;
virtual css::uno::Reference< css::sdbc::XResultSet > SAL_CALL getExportedKeys( const css::uno::Any& catalog, const OUString& schema, const OUString& table ) override;
virtual css::uno::Reference< css::sdbc::XResultSet > SAL_CALL getCrossReference( const css::uno::Any& primaryCatalog, const OUString& primarySchema, const OUString& primaryTable, const css::uno::Any& foreignCatalog, const OUString& foreignSchema, const OUString& foreignTable ) override;
virtual css::uno::Reference< css::sdbc::XResultSet > SAL_CALL getIndexInfo( const css::uno::Any& catalog, const OUString& schema, const OUString& table, sal_Bool unique, sal_Bool approximate ) override;
virtual css::uno::Reference< css::sdbc::XResultSet > SAL_CALL getTypeInfo( ) override;
virtual css::uno::Reference< css::sdbc::XResultSet > SAL_CALL getProcedures( const css::uno::Any& catalog, const OUString& schemaPattern, const OUString& procedureNamePattern ) override;
virtual css::uno::Reference< css::sdbc::XResultSet > SAL_CALL getProcedureColumns( const css::uno::Any& catalog, const OUString& schemaPattern, const OUString& procedureNamePattern, const OUString& columnNamePattern ) override;
virtual css::uno::Reference< css::sdbc::XResultSet > SAL_CALL getSchemas( ) override;
virtual css::uno::Reference< css::sdbc::XResultSet > SAL_CALL getCatalogs( ) override;
virtual css::uno::Reference< css::sdbc::XResultSet > SAL_CALL getColumnPrivileges( const css::uno::Any& catalog, const OUString& schema, const OUString& table, const OUString& columnNamePattern ) override;
virtual css::uno::Reference< css::sdbc::XResultSet > SAL_CALL getTablePrivileges( const css::uno::Any& catalog, const OUString& schemaPattern, const OUString& tableNamePattern ) override;
virtual css::uno::Reference< css::sdbc::XResultSet > SAL_CALL getBestRowIdentifier( const css::uno::Any& catalog, const OUString& schema, const OUString& table, sal_Int32 scope, sal_Bool nullable ) override;
virtual css::uno::Reference< css::sdbc::XResultSet > SAL_CALL getVersionColumns( const css::uno::Any& catalog, const OUString& schema, const OUString& table ) override;
virtual css::uno::Reference< css::sdbc::XResultSet > SAL_CALL getPrimaryKeys( const css::uno::Any& catalog, const OUString& schema, const OUString& table ) override;
virtual css::uno::Reference< css::sdbc::XResultSet > SAL_CALL getImportedKeys( const css::uno::Any& catalog, const OUString& schema, const OUString& table ) override;
virtual css::uno::Reference< css::sdbc::XResultSet > SAL_CALL getExportedKeys( const css::uno::Any& catalog, const OUString& schema, const OUString& table ) override;
virtual css::uno::Reference< css::sdbc::XResultSet > SAL_CALL getCrossReference( const css::uno::Any& primaryCatalog, const OUString& primarySchema, const OUString& primaryTable, const css::uno::Any& foreignCatalog, const OUString& foreignSchema, const OUString& foreignTable ) override;
virtual css::uno::Reference< css::sdbc::XResultSet > SAL_CALL getIndexInfo( const css::uno::Any& catalog, const OUString& schema, const OUString& table, sal_Bool unique, sal_Bool approximate ) override;
virtual css::uno::Reference< css::sdbc::XConnection > SAL_CALL getConnection( ) override;
// cached database information
virtual OUString SAL_CALL getIdentifierQuoteString( ) override;
virtual sal_Bool SAL_CALL isCatalogAtStart( ) override;
virtual OUString SAL_CALL getCatalogSeparator( ) override;
virtual sal_Bool SAL_CALL supportsCatalogsInTableDefinitions( ) override;
virtual sal_Bool SAL_CALL supportsSchemasInTableDefinitions( ) override;
virtual sal_Bool SAL_CALL supportsCatalogsInDataManipulation( ) override;
virtual sal_Bool SAL_CALL supportsSchemasInDataManipulation( ) override;
virtual sal_Bool SAL_CALL supportsMixedCaseQuotedIdentifiers( ) override;
virtual sal_Bool SAL_CALL supportsAlterTableWithAddColumn( ) override;
virtual sal_Bool SAL_CALL supportsAlterTableWithDropColumn( ) override;
virtual sal_Int32 SAL_CALL getMaxStatements( ) override;
virtual sal_Int32 SAL_CALL getMaxTablesInSelect( ) override;
virtual sal_Bool SAL_CALL storesMixedCaseQuotedIdentifiers( ) override;
};
virtual css::uno::Reference< css::sdbc::XConnection > SAL_CALL getConnection( ) override;
// cached database information
virtual OUString SAL_CALL getIdentifierQuoteString( ) override;
virtual sal_Bool SAL_CALL isCatalogAtStart( ) override;
virtual OUString SAL_CALL getCatalogSeparator( ) override;
virtual sal_Bool SAL_CALL supportsCatalogsInTableDefinitions( ) override;
virtual sal_Bool SAL_CALL supportsSchemasInTableDefinitions( ) override;
virtual sal_Bool SAL_CALL supportsCatalogsInDataManipulation( ) override;
virtual sal_Bool SAL_CALL supportsSchemasInDataManipulation( ) override;
virtual sal_Bool SAL_CALL supportsMixedCaseQuotedIdentifiers( ) override;
virtual sal_Bool SAL_CALL supportsAlterTableWithAddColumn( ) override;
virtual sal_Bool SAL_CALL supportsAlterTableWithDropColumn( ) override;
virtual sal_Int32 SAL_CALL getMaxStatements( ) override;
virtual sal_Int32 SAL_CALL getMaxTablesInSelect( ) override;
virtual sal_Bool SAL_CALL storesMixedCaseQuotedIdentifiers( ) override;
};
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
@@ -27,49 +27,49 @@
namespace connectivity::ado
{
//************ Class: java.sql.CallableStatement
//************ Class: java.sql.CallableStatement
class OCallableStatement : public OPreparedStatement,
public css::sdbc::XRow,
public css::sdbc::XOutParameters
{
OLEVariant m_aValue;
public:
DECLARE_SERVICE_INFO();
class OCallableStatement : public OPreparedStatement,
public css::sdbc::XRow,
public css::sdbc::XOutParameters
{
OLEVariant m_aValue;
public:
DECLARE_SERVICE_INFO();
// a Constructor, that is needed for when Returning the Object is needed:
OCallableStatement( OConnection* _pConnection, const OUString& sql );
// a Constructor, that is needed for when Returning the Object is needed:
OCallableStatement( OConnection* _pConnection, const OUString& sql );
virtual css::uno::Any SAL_CALL queryInterface( const css::uno::Type & rType ) override;
virtual void SAL_CALL acquire() noexcept override;
virtual void SAL_CALL release() noexcept override;
virtual css::uno::Any SAL_CALL queryInterface( const css::uno::Type & rType ) override;
virtual void SAL_CALL acquire() noexcept override;
virtual void SAL_CALL release() noexcept override;
// XRow
virtual sal_Bool SAL_CALL wasNull( ) override;
virtual OUString SAL_CALL getString( sal_Int32 columnIndex ) override;
virtual sal_Bool SAL_CALL getBoolean( sal_Int32 columnIndex ) override;
virtual sal_Int8 SAL_CALL getByte( sal_Int32 columnIndex ) override;
virtual sal_Int16 SAL_CALL getShort( sal_Int32 columnIndex ) override;
virtual sal_Int32 SAL_CALL getInt( sal_Int32 columnIndex ) override;
virtual sal_Int64 SAL_CALL getLong( sal_Int32 columnIndex ) override;
virtual float SAL_CALL getFloat( sal_Int32 columnIndex ) override;
virtual double SAL_CALL getDouble( sal_Int32 columnIndex ) override;
virtual css::uno::Sequence< sal_Int8 > SAL_CALL getBytes( sal_Int32 columnIndex ) override;
virtual css::util::Date SAL_CALL getDate( sal_Int32 columnIndex ) override;
virtual css::util::Time SAL_CALL getTime( sal_Int32 columnIndex ) override;
virtual css::util::DateTime SAL_CALL getTimestamp( sal_Int32 columnIndex ) override;
virtual css::uno::Reference< css::io::XInputStream > SAL_CALL getBinaryStream( sal_Int32 columnIndex ) override;
virtual css::uno::Reference< css::io::XInputStream > SAL_CALL getCharacterStream( sal_Int32 columnIndex ) override;
virtual css::uno::Any SAL_CALL getObject( sal_Int32 columnIndex, const css::uno::Reference< css::container::XNameAccess >& typeMap ) override;
virtual css::uno::Reference< css::sdbc::XRef > SAL_CALL getRef( sal_Int32 columnIndex ) override;
virtual css::uno::Reference< css::sdbc::XBlob > SAL_CALL getBlob( sal_Int32 columnIndex ) override;
virtual css::uno::Reference< css::sdbc::XClob > SAL_CALL getClob( sal_Int32 columnIndex ) override;
virtual css::uno::Reference< css::sdbc::XArray > SAL_CALL getArray( sal_Int32 columnIndex ) override;
// XOutParameters
virtual void SAL_CALL registerOutParameter( sal_Int32 parameterIndex, sal_Int32 sqlType, const OUString& typeName ) override;
virtual void SAL_CALL registerNumericOutParameter( sal_Int32 parameterIndex, sal_Int32 sqlType, sal_Int32 scale ) override;
};
// XRow
virtual sal_Bool SAL_CALL wasNull( ) override;
virtual OUString SAL_CALL getString( sal_Int32 columnIndex ) override;
virtual sal_Bool SAL_CALL getBoolean( sal_Int32 columnIndex ) override;
virtual sal_Int8 SAL_CALL getByte( sal_Int32 columnIndex ) override;
virtual sal_Int16 SAL_CALL getShort( sal_Int32 columnIndex ) override;
virtual sal_Int32 SAL_CALL getInt( sal_Int32 columnIndex ) override;
virtual sal_Int64 SAL_CALL getLong( sal_Int32 columnIndex ) override;
virtual float SAL_CALL getFloat( sal_Int32 columnIndex ) override;
virtual double SAL_CALL getDouble( sal_Int32 columnIndex ) override;
virtual css::uno::Sequence< sal_Int8 > SAL_CALL getBytes( sal_Int32 columnIndex ) override;
virtual css::util::Date SAL_CALL getDate( sal_Int32 columnIndex ) override;
virtual css::util::Time SAL_CALL getTime( sal_Int32 columnIndex ) override;
virtual css::util::DateTime SAL_CALL getTimestamp( sal_Int32 columnIndex ) override;
virtual css::uno::Reference< css::io::XInputStream > SAL_CALL getBinaryStream( sal_Int32 columnIndex ) override;
virtual css::uno::Reference< css::io::XInputStream > SAL_CALL getCharacterStream( sal_Int32 columnIndex ) override;
virtual css::uno::Any SAL_CALL getObject( sal_Int32 columnIndex, const css::uno::Reference< css::container::XNameAccess >& typeMap ) override;
virtual css::uno::Reference< css::sdbc::XRef > SAL_CALL getRef( sal_Int32 columnIndex ) override;
virtual css::uno::Reference< css::sdbc::XBlob > SAL_CALL getBlob( sal_Int32 columnIndex ) override;
virtual css::uno::Reference< css::sdbc::XClob > SAL_CALL getClob( sal_Int32 columnIndex ) override;
virtual css::uno::Reference< css::sdbc::XArray > SAL_CALL getArray( sal_Int32 columnIndex ) override;
// XOutParameters
virtual void SAL_CALL registerOutParameter( sal_Int32 parameterIndex, sal_Int32 sqlType, const OUString& typeName ) override;
virtual void SAL_CALL registerNumericOutParameter( sal_Int32 parameterIndex, sal_Int32 sqlType, sal_Int32 scale ) override;
};
}
+17 -17
View File
@@ -23,27 +23,27 @@
namespace connectivity::ado
{
class OConnection;
class OConnection;
class OCatalog : public connectivity::sdbcx::OCatalog
{
WpADOCatalog m_aCatalog;
OConnection* m_pConnection;
class OCatalog : public connectivity::sdbcx::OCatalog
{
WpADOCatalog m_aCatalog;
OConnection* m_pConnection;
public:
virtual void refreshTables() override;
virtual void refreshViews() override;
virtual void refreshGroups() override;
virtual void refreshUsers() override;
public:
virtual void refreshTables() override;
virtual void refreshViews() override;
virtual void refreshGroups() override;
virtual void refreshUsers() override;
public:
OCatalog(_ADOCatalog* _pCatalog,OConnection* _pCon);
~OCatalog() override;
public:
OCatalog(_ADOCatalog* _pCatalog,OConnection* _pCon);
~OCatalog() override;
OConnection* getConnection() const { return m_pConnection; }
sdbcx::OCollection* getPrivateTables() const { return m_pTables.get(); }
WpADOCatalog getCatalog() const { return m_aCatalog; }
};
OConnection* getConnection() const { return m_pConnection; }
sdbcx::OCollection* getPrivateTables() const { return m_pTables.get(); }
WpADOCatalog getCatalog() const { return m_aCatalog; }
};
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+21 -21
View File
@@ -24,29 +24,29 @@
namespace connectivity::ado
{
class OConnection;
typedef sdbcx::OColumn OColumn_ADO;
class OAdoColumn : public OColumn_ADO
{
WpADOColumn m_aColumn;
OConnection* m_pConnection;
OUString m_ReferencedColumn;
bool m_IsAscending;
class OConnection;
typedef sdbcx::OColumn OColumn_ADO;
class OAdoColumn : public OColumn_ADO
{
WpADOColumn m_aColumn;
OConnection* m_pConnection;
OUString m_ReferencedColumn;
bool m_IsAscending;
void fillPropertyValues();
protected:
virtual void SAL_CALL setFastPropertyValue_NoBroadcast(
sal_Int32 nHandle,
const css::uno::Any& rValue
) override;
public:
OAdoColumn(bool _bCase,OConnection* _pConnection,_ADOColumn* _pColumn);
OAdoColumn(bool _bCase,OConnection* _pConnection);
// ODescriptor
virtual void construct() override;
void fillPropertyValues();
protected:
virtual void SAL_CALL setFastPropertyValue_NoBroadcast(
sal_Int32 nHandle,
const css::uno::Any& rValue
) override;
public:
OAdoColumn(bool _bCase,OConnection* _pConnection,_ADOColumn* _pColumn);
OAdoColumn(bool _bCase,OConnection* _pConnection);
// ODescriptor
virtual void construct() override;
WpADOColumn getColumnImpl() const;
};
WpADOColumn getColumnImpl() const;
};
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+23 -23
View File
@@ -26,31 +26,31 @@
namespace connectivity::ado
{
class OConnection;
class OColumns : public sdbcx::OCollection
class OConnection;
class OColumns : public sdbcx::OCollection
{
protected:
WpADOColumns m_aCollection;
OConnection* m_pConnection;
virtual css::uno::Reference< css::beans::XPropertySet > createObject(const OUString& _rName) override;
virtual void impl_refresh() override;
virtual css::uno::Reference< css::beans::XPropertySet > createDescriptor() override;
virtual css::uno::Reference< css::beans::XPropertySet > appendObject( const OUString& _rForName, const css::uno::Reference< css::beans::XPropertySet >& descriptor ) override;
virtual void dropObject(sal_Int32 _nPos,const OUString& _sElementName) override;
public:
OColumns( ::cppu::OWeakObject& _rParent,
::osl::Mutex& _rMutex,
const ::std::vector< OUString> &_rVector,
const WpADOColumns& _rCollection,
bool _bCase,
OConnection* _pConnection) : sdbcx::OCollection(_rParent,_bCase,_rMutex,_rVector)
,m_aCollection(_rCollection)
,m_pConnection(_pConnection)
{
protected:
WpADOColumns m_aCollection;
OConnection* m_pConnection;
}
virtual css::uno::Reference< css::beans::XPropertySet > createObject(const OUString& _rName) override;
virtual void impl_refresh() override;
virtual css::uno::Reference< css::beans::XPropertySet > createDescriptor() override;
virtual css::uno::Reference< css::beans::XPropertySet > appendObject( const OUString& _rForName, const css::uno::Reference< css::beans::XPropertySet >& descriptor ) override;
virtual void dropObject(sal_Int32 _nPos,const OUString& _sElementName) override;
public:
OColumns( ::cppu::OWeakObject& _rParent,
::osl::Mutex& _rMutex,
const ::std::vector< OUString> &_rVector,
const WpADOColumns& _rCollection,
bool _bCase,
OConnection* _pConnection) : sdbcx::OCollection(_rParent,_bCase,_rMutex,_rVector)
,m_aCollection(_rCollection)
,m_pConnection(_pConnection)
{
}
};
};
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+91 -91
View File
@@ -32,100 +32,100 @@
namespace connectivity::ado
{
struct OExtendedTypeInfo
struct OExtendedTypeInfo
{
::connectivity::OTypeInfo aSimpleType; // the general type info
DataTypeEnum eType;
OUString getDBName() const { return aSimpleType.aTypeName; }
};
class WpADOConnection;
class ODriver;
typedef std::multimap<DataTypeEnum, OExtendedTypeInfo*> OTypeInfoMap;
typedef connectivity::OMetaConnection OConnection_BASE;
class OConnection : public OConnection_BASE
{
protected:
// Data attributes
OTypeInfoMap m_aTypeInfo; // vector containing an entry
// for each row returned by
// DatabaseMetaData.getTypeInfo.
unotools::WeakReference<OCatalog> m_xCatalog;
ODriver* m_pDriver;
private:
WpADOConnection m_aAdoConnection;
sal_Int32 m_nEngineType;
bool m_bClosed;
bool m_bAutocommit;
protected:
/// @throws css::sdbc::SQLException
void buildTypeInfo();
public:
/// @throws css::sdbc::SQLException
/// @throws css::uno::RuntimeException
OConnection(ODriver* _pDriver);
// OConnection(const SQLHANDLE _pConnectionHandle);
~OConnection() override;
void construct(std::u16string_view url,const css::uno::Sequence< css::beans::PropertyValue >& info);
//XUnoTunnel
virtual sal_Int64 SAL_CALL getSomething( const css::uno::Sequence< sal_Int8 >& aIdentifier ) override;
static css::uno::Sequence< sal_Int8 > getUnoTunnelId();
// XServiceInfo
DECLARE_SERVICE_INFO();
// OComponentHelper
virtual void SAL_CALL disposing() override;
// XConnection
virtual css::uno::Reference< css::sdbc::XStatement > SAL_CALL createStatement( ) override;
virtual css::uno::Reference< css::sdbc::XPreparedStatement > SAL_CALL prepareStatement( const OUString& sql ) override;
virtual css::uno::Reference< css::sdbc::XPreparedStatement > SAL_CALL prepareCall( const OUString& sql ) override;
virtual OUString SAL_CALL nativeSQL( const OUString& sql ) override;
virtual void SAL_CALL setAutoCommit( sal_Bool autoCommit ) override;
virtual sal_Bool SAL_CALL getAutoCommit( ) override;
virtual void SAL_CALL commit( ) override;
virtual void SAL_CALL rollback( ) override;
virtual sal_Bool SAL_CALL isClosed( ) override;
virtual css::uno::Reference< css::sdbc::XDatabaseMetaData > SAL_CALL getMetaData( ) override;
virtual void SAL_CALL setReadOnly( sal_Bool readOnly ) override;
virtual sal_Bool SAL_CALL isReadOnly( ) override;
virtual void SAL_CALL setCatalog( const OUString& catalog ) override;
virtual OUString SAL_CALL getCatalog( ) override;
virtual void SAL_CALL setTransactionIsolation( sal_Int32 level ) override;
virtual sal_Int32 SAL_CALL getTransactionIsolation( ) override;
virtual css::uno::Reference< css::container::XNameAccess > SAL_CALL getTypeMap( ) override;
virtual void SAL_CALL setTypeMap( const css::uno::Reference< css::container::XNameAccess >& typeMap ) override;
// XCloseable
virtual void SAL_CALL close( ) override;
// XWarningsSupplier
virtual css::uno::Any SAL_CALL getWarnings( ) override;
virtual void SAL_CALL clearWarnings( ) override;
WpADOConnection& getConnection() { return m_aAdoConnection; }
void setCatalog(OCatalog* _pCatalog) { m_xCatalog = _pCatalog; }
const OTypeInfoMap* getTypeInfo() const { return &m_aTypeInfo;}
OCatalog* getAdoCatalog() const
{
::connectivity::OTypeInfo aSimpleType; // the general type info
DataTypeEnum eType;
return m_xCatalog.get().get();
}
OUString getDBName() const { return aSimpleType.aTypeName; }
};
sal_Int32 getEngineType() const { return m_nEngineType; }
ODriver* getDriver() const { return m_pDriver; }
class WpADOConnection;
class ODriver;
typedef std::multimap<DataTypeEnum, OExtendedTypeInfo*> OTypeInfoMap;
typedef connectivity::OMetaConnection OConnection_BASE;
class OConnection : public OConnection_BASE
{
protected:
// Data attributes
OTypeInfoMap m_aTypeInfo; // vector containing an entry
// for each row returned by
// DatabaseMetaData.getTypeInfo.
unotools::WeakReference<OCatalog> m_xCatalog;
ODriver* m_pDriver;
private:
WpADOConnection m_aAdoConnection;
sal_Int32 m_nEngineType;
bool m_bClosed;
bool m_bAutocommit;
protected:
/// @throws css::sdbc::SQLException
void buildTypeInfo();
public:
/// @throws css::sdbc::SQLException
/// @throws css::uno::RuntimeException
OConnection(ODriver* _pDriver);
// OConnection(const SQLHANDLE _pConnectionHandle);
~OConnection() override;
void construct(std::u16string_view url,const css::uno::Sequence< css::beans::PropertyValue >& info);
//XUnoTunnel
virtual sal_Int64 SAL_CALL getSomething( const css::uno::Sequence< sal_Int8 >& aIdentifier ) override;
static css::uno::Sequence< sal_Int8 > getUnoTunnelId();
// XServiceInfo
DECLARE_SERVICE_INFO();
// OComponentHelper
virtual void SAL_CALL disposing() override;
// XConnection
virtual css::uno::Reference< css::sdbc::XStatement > SAL_CALL createStatement( ) override;
virtual css::uno::Reference< css::sdbc::XPreparedStatement > SAL_CALL prepareStatement( const OUString& sql ) override;
virtual css::uno::Reference< css::sdbc::XPreparedStatement > SAL_CALL prepareCall( const OUString& sql ) override;
virtual OUString SAL_CALL nativeSQL( const OUString& sql ) override;
virtual void SAL_CALL setAutoCommit( sal_Bool autoCommit ) override;
virtual sal_Bool SAL_CALL getAutoCommit( ) override;
virtual void SAL_CALL commit( ) override;
virtual void SAL_CALL rollback( ) override;
virtual sal_Bool SAL_CALL isClosed( ) override;
virtual css::uno::Reference< css::sdbc::XDatabaseMetaData > SAL_CALL getMetaData( ) override;
virtual void SAL_CALL setReadOnly( sal_Bool readOnly ) override;
virtual sal_Bool SAL_CALL isReadOnly( ) override;
virtual void SAL_CALL setCatalog( const OUString& catalog ) override;
virtual OUString SAL_CALL getCatalog( ) override;
virtual void SAL_CALL setTransactionIsolation( sal_Int32 level ) override;
virtual sal_Int32 SAL_CALL getTransactionIsolation( ) override;
virtual css::uno::Reference< css::container::XNameAccess > SAL_CALL getTypeMap( ) override;
virtual void SAL_CALL setTypeMap( const css::uno::Reference< css::container::XNameAccess >& typeMap ) override;
// XCloseable
virtual void SAL_CALL close( ) override;
// XWarningsSupplier
virtual css::uno::Any SAL_CALL getWarnings( ) override;
virtual void SAL_CALL clearWarnings( ) override;
WpADOConnection& getConnection() { return m_aAdoConnection; }
void setCatalog(OCatalog* _pCatalog) { m_xCatalog = _pCatalog; }
const OTypeInfoMap* getTypeInfo() const { return &m_aTypeInfo;}
OCatalog* getAdoCatalog() const
{
return m_xCatalog.get().get();
}
sal_Int32 getEngineType() const { return m_nEngineType; }
ODriver* getDriver() const { return m_pDriver; }
static const OExtendedTypeInfo* getTypeInfoFromType(const OTypeInfoMap& _rTypeInfo,
DataTypeEnum _nType,
const OUString& _sTypeName,
sal_Int32 _nPrecision,
sal_Int32 _nScale,
bool& _brForceToType);
};
static const OExtendedTypeInfo* getTypeInfoFromType(const OTypeInfoMap& _rTypeInfo,
DataTypeEnum _nType,
const OUString& _sTypeName,
sal_Int32 _nPrecision,
sal_Int32 _nScale,
bool& _brForceToType);
};
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+186 -186
View File
@@ -24,197 +24,197 @@
namespace connectivity::ado
{
class WpADOConnection;
class OConnection;
class WpADOConnection;
class OConnection;
//************ Class: ODatabaseMetaData
//************ Class: ODatabaseMetaData
class ODatabaseMetaData : public ODatabaseMetaDataBase
class ODatabaseMetaData : public ODatabaseMetaDataBase
{
struct LiteralInfo
{
struct LiteralInfo
{
OUString pwszLiteralValue;
sal_uInt32 cchMaxLen;
bool fSupported;
};
std::map<sal_uInt32,LiteralInfo> m_aLiteralInfo;
WpADOConnection& m_rADOConnection;
OConnection* m_pConnection;
void fillLiterals();
// get information out of rowset
sal_Int32 getMaxSize(sal_uInt32 _nId);
bool isCapable(sal_uInt32 _nId);
OUString getLiteral(sal_uInt32 _nProperty);
// get info out of properties
/// @throws css::sdbc::SQLException
/// @throws css::uno::RuntimeException
OUString getStringProperty(const OUString& _aProperty);
/// @throws css::sdbc::SQLException
/// @throws css::uno::RuntimeException
sal_Int32 getInt32Property(const OUString& _aProperty);
/// @throws css::sdbc::SQLException
/// @throws css::uno::RuntimeException
bool getBoolProperty(const OUString& _aProperty);
virtual css::uno::Reference< css::sdbc::XResultSet > impl_getTypeInfo_throw() override;
// cached database information
virtual OUString impl_getIdentifierQuoteString_throw( ) override;
virtual bool impl_isCatalogAtStart_throw( ) override;
virtual OUString impl_getCatalogSeparator_throw( ) override;
virtual bool impl_supportsCatalogsInTableDefinitions_throw( ) override;
virtual bool impl_supportsSchemasInTableDefinitions_throw( ) override;
virtual bool impl_supportsCatalogsInDataManipulation_throw( ) override;
virtual bool impl_supportsSchemasInDataManipulation_throw( ) override;
virtual bool impl_supportsMixedCaseQuotedIdentifiers_throw( ) override;
virtual bool impl_supportsAlterTableWithAddColumn_throw( ) override;
virtual bool impl_supportsAlterTableWithDropColumn_throw( ) override;
virtual sal_Int32 impl_getMaxStatements_throw( ) override;
virtual sal_Int32 impl_getMaxTablesInSelect_throw( ) override;
virtual bool impl_storesMixedCaseQuotedIdentifiers_throw( ) override;
public:
ODatabaseMetaData(OConnection* _pCon);
// XDatabaseMetaData
virtual sal_Bool SAL_CALL allProceduresAreCallable( ) override;
virtual sal_Bool SAL_CALL allTablesAreSelectable( ) override;
virtual OUString SAL_CALL getURL( ) override;
virtual OUString SAL_CALL getUserName( ) override;
virtual sal_Bool SAL_CALL isReadOnly( ) override;
virtual sal_Bool SAL_CALL nullsAreSortedHigh( ) override;
virtual sal_Bool SAL_CALL nullsAreSortedLow( ) override;
virtual sal_Bool SAL_CALL nullsAreSortedAtStart( ) override;
virtual sal_Bool SAL_CALL nullsAreSortedAtEnd( ) override;
virtual OUString SAL_CALL getDatabaseProductName( ) override;
virtual OUString SAL_CALL getDatabaseProductVersion( ) override;
virtual OUString SAL_CALL getDriverName( ) override;
virtual OUString SAL_CALL getDriverVersion( ) override;
virtual sal_Int32 SAL_CALL getDriverMajorVersion( ) override;
virtual sal_Int32 SAL_CALL getDriverMinorVersion( ) override;
virtual sal_Bool SAL_CALL usesLocalFiles( ) override;
virtual sal_Bool SAL_CALL usesLocalFilePerTable( ) override;
virtual sal_Bool SAL_CALL supportsMixedCaseIdentifiers( ) override;
virtual sal_Bool SAL_CALL storesUpperCaseIdentifiers( ) override;
virtual sal_Bool SAL_CALL storesLowerCaseIdentifiers( ) override;
virtual sal_Bool SAL_CALL storesMixedCaseIdentifiers( ) override;
virtual sal_Bool SAL_CALL storesUpperCaseQuotedIdentifiers( ) override;
virtual sal_Bool SAL_CALL storesLowerCaseQuotedIdentifiers( ) override;
virtual OUString SAL_CALL getSQLKeywords( ) override;
virtual OUString SAL_CALL getNumericFunctions( ) override;
virtual OUString SAL_CALL getStringFunctions( ) override;
virtual OUString SAL_CALL getSystemFunctions( ) override;
virtual OUString SAL_CALL getTimeDateFunctions( ) override;
virtual OUString SAL_CALL getSearchStringEscape( ) override;
virtual OUString SAL_CALL getExtraNameCharacters( ) override;
virtual sal_Bool SAL_CALL supportsColumnAliasing( ) override;
virtual sal_Bool SAL_CALL nullPlusNonNullIsNull( ) override;
virtual sal_Bool SAL_CALL supportsTypeConversion( ) override;
virtual sal_Bool SAL_CALL supportsConvert( sal_Int32 fromType, sal_Int32 toType ) override;
virtual sal_Bool SAL_CALL supportsTableCorrelationNames( ) override;
virtual sal_Bool SAL_CALL supportsDifferentTableCorrelationNames( ) override;
virtual sal_Bool SAL_CALL supportsExpressionsInOrderBy( ) override;
virtual sal_Bool SAL_CALL supportsOrderByUnrelated( ) override;
virtual sal_Bool SAL_CALL supportsGroupBy( ) override;
virtual sal_Bool SAL_CALL supportsGroupByUnrelated( ) override;
virtual sal_Bool SAL_CALL supportsGroupByBeyondSelect( ) override;
virtual sal_Bool SAL_CALL supportsLikeEscapeClause( ) override;
virtual sal_Bool SAL_CALL supportsMultipleResultSets( ) override;
virtual sal_Bool SAL_CALL supportsMultipleTransactions( ) override;
virtual sal_Bool SAL_CALL supportsNonNullableColumns( ) override;
virtual sal_Bool SAL_CALL supportsMinimumSQLGrammar( ) override;
virtual sal_Bool SAL_CALL supportsCoreSQLGrammar( ) override;
virtual sal_Bool SAL_CALL supportsExtendedSQLGrammar( ) override;
virtual sal_Bool SAL_CALL supportsANSI92EntryLevelSQL( ) override;
virtual sal_Bool SAL_CALL supportsANSI92IntermediateSQL( ) override;
virtual sal_Bool SAL_CALL supportsANSI92FullSQL( ) override;
virtual sal_Bool SAL_CALL supportsIntegrityEnhancementFacility( ) override;
virtual sal_Bool SAL_CALL supportsOuterJoins( ) override;
virtual sal_Bool SAL_CALL supportsFullOuterJoins( ) override;
virtual sal_Bool SAL_CALL supportsLimitedOuterJoins( ) override;
virtual OUString SAL_CALL getSchemaTerm( ) override;
virtual OUString SAL_CALL getProcedureTerm( ) override;
virtual OUString SAL_CALL getCatalogTerm( ) override;
virtual sal_Bool SAL_CALL supportsSchemasInProcedureCalls( ) override;
virtual sal_Bool SAL_CALL supportsSchemasInIndexDefinitions( ) override;
virtual sal_Bool SAL_CALL supportsSchemasInPrivilegeDefinitions( ) override;
virtual sal_Bool SAL_CALL supportsCatalogsInProcedureCalls( ) override;
virtual sal_Bool SAL_CALL supportsCatalogsInIndexDefinitions( ) override;
virtual sal_Bool SAL_CALL supportsCatalogsInPrivilegeDefinitions( ) override;
virtual sal_Bool SAL_CALL supportsPositionedDelete( ) override;
virtual sal_Bool SAL_CALL supportsPositionedUpdate( ) override;
virtual sal_Bool SAL_CALL supportsSelectForUpdate( ) override;
virtual sal_Bool SAL_CALL supportsStoredProcedures( ) override;
virtual sal_Bool SAL_CALL supportsSubqueriesInComparisons( ) override;
virtual sal_Bool SAL_CALL supportsSubqueriesInExists( ) override;
virtual sal_Bool SAL_CALL supportsSubqueriesInIns( ) override;
virtual sal_Bool SAL_CALL supportsSubqueriesInQuantifieds( ) override;
virtual sal_Bool SAL_CALL supportsCorrelatedSubqueries( ) override;
virtual sal_Bool SAL_CALL supportsUnion( ) override;
virtual sal_Bool SAL_CALL supportsUnionAll( ) override;
virtual sal_Bool SAL_CALL supportsOpenCursorsAcrossCommit( ) override;
virtual sal_Bool SAL_CALL supportsOpenCursorsAcrossRollback( ) override;
virtual sal_Bool SAL_CALL supportsOpenStatementsAcrossCommit( ) override;
virtual sal_Bool SAL_CALL supportsOpenStatementsAcrossRollback( ) override;
virtual sal_Int32 SAL_CALL getMaxBinaryLiteralLength( ) override;
virtual sal_Int32 SAL_CALL getMaxCharLiteralLength( ) override;
virtual sal_Int32 SAL_CALL getMaxColumnNameLength( ) override;
virtual sal_Int32 SAL_CALL getMaxColumnsInGroupBy( ) override;
virtual sal_Int32 SAL_CALL getMaxColumnsInIndex( ) override;
virtual sal_Int32 SAL_CALL getMaxColumnsInOrderBy( ) override;
virtual sal_Int32 SAL_CALL getMaxColumnsInSelect( ) override;
virtual sal_Int32 SAL_CALL getMaxColumnsInTable( ) override;
virtual sal_Int32 SAL_CALL getMaxConnections( ) override;
virtual sal_Int32 SAL_CALL getMaxCursorNameLength( ) override;
virtual sal_Int32 SAL_CALL getMaxIndexLength( ) override;
virtual sal_Int32 SAL_CALL getMaxSchemaNameLength( ) override;
virtual sal_Int32 SAL_CALL getMaxProcedureNameLength( ) override;
virtual sal_Int32 SAL_CALL getMaxCatalogNameLength( ) override;
virtual sal_Int32 SAL_CALL getMaxRowSize( ) override;
virtual sal_Bool SAL_CALL doesMaxRowSizeIncludeBlobs( ) override;
virtual sal_Int32 SAL_CALL getMaxStatementLength( ) override;
virtual sal_Int32 SAL_CALL getMaxTableNameLength( ) override;
virtual sal_Int32 SAL_CALL getMaxUserNameLength( ) override;
virtual sal_Int32 SAL_CALL getDefaultTransactionIsolation( ) override;
virtual sal_Bool SAL_CALL supportsTransactions( ) override;
virtual sal_Bool SAL_CALL supportsTransactionIsolationLevel( sal_Int32 level ) override;
virtual sal_Bool SAL_CALL supportsDataDefinitionAndDataManipulationTransactions( ) override;
virtual sal_Bool SAL_CALL supportsDataManipulationTransactionsOnly( ) override;
virtual sal_Bool SAL_CALL dataDefinitionCausesTransactionCommit( ) override;
virtual sal_Bool SAL_CALL dataDefinitionIgnoredInTransactions( ) override;
virtual css::uno::Reference< css::sdbc::XResultSet > SAL_CALL getProcedures( const css::uno::Any& catalog, const OUString& schemaPattern, const OUString& procedureNamePattern ) override;
virtual css::uno::Reference< css::sdbc::XResultSet > SAL_CALL getProcedureColumns( const css::uno::Any& catalog, const OUString& schemaPattern, const OUString& procedureNamePattern, const OUString& columnNamePattern ) override;
virtual css::uno::Reference< css::sdbc::XResultSet > SAL_CALL getTables( const css::uno::Any& catalog, const OUString& schemaPattern, const OUString& tableNamePattern, const css::uno::Sequence< OUString >& types ) override;
virtual css::uno::Reference< css::sdbc::XResultSet > SAL_CALL getSchemas( ) override;
virtual css::uno::Reference< css::sdbc::XResultSet > SAL_CALL getCatalogs( ) override;
virtual css::uno::Reference< css::sdbc::XResultSet > SAL_CALL getTableTypes( ) override;
virtual css::uno::Reference< css::sdbc::XResultSet > SAL_CALL getColumns( const css::uno::Any& catalog, const OUString& schemaPattern, const OUString& tableNamePattern, const OUString& columnNamePattern ) override;
virtual css::uno::Reference< css::sdbc::XResultSet > SAL_CALL getColumnPrivileges( const css::uno::Any& catalog, const OUString& schema, const OUString& table, const OUString& columnNamePattern ) override;
virtual css::uno::Reference< css::sdbc::XResultSet > SAL_CALL getTablePrivileges( const css::uno::Any& catalog, const OUString& schemaPattern, const OUString& tableNamePattern ) override;
virtual css::uno::Reference< css::sdbc::XResultSet > SAL_CALL getPrimaryKeys( const css::uno::Any& catalog, const OUString& schema, const OUString& table ) override;
virtual css::uno::Reference< css::sdbc::XResultSet > SAL_CALL getImportedKeys( const css::uno::Any& catalog, const OUString& schema, const OUString& table ) override;
virtual css::uno::Reference< css::sdbc::XResultSet > SAL_CALL getExportedKeys( const css::uno::Any& catalog, const OUString& schema, const OUString& table ) override;
virtual css::uno::Reference< css::sdbc::XResultSet > SAL_CALL getCrossReference( const css::uno::Any& primaryCatalog, const OUString& primarySchema, const OUString& primaryTable, const css::uno::Any& foreignCatalog, const OUString& foreignSchema, const OUString& foreignTable ) override;
virtual css::uno::Reference< css::sdbc::XResultSet > SAL_CALL getIndexInfo( const css::uno::Any& catalog, const OUString& schema, const OUString& table, sal_Bool unique, sal_Bool approximate ) override;
virtual sal_Bool SAL_CALL supportsResultSetType( sal_Int32 setType ) override;
virtual sal_Bool SAL_CALL supportsResultSetConcurrency( sal_Int32 setType, sal_Int32 concurrency ) override;
virtual sal_Bool SAL_CALL ownUpdatesAreVisible( sal_Int32 setType ) override;
virtual sal_Bool SAL_CALL ownDeletesAreVisible( sal_Int32 setType ) override;
virtual sal_Bool SAL_CALL ownInsertsAreVisible( sal_Int32 setType ) override;
virtual sal_Bool SAL_CALL othersUpdatesAreVisible( sal_Int32 setType ) override;
virtual sal_Bool SAL_CALL othersDeletesAreVisible( sal_Int32 setType ) override;
virtual sal_Bool SAL_CALL othersInsertsAreVisible( sal_Int32 setType ) override;
virtual sal_Bool SAL_CALL updatesAreDetected( sal_Int32 setType ) override;
virtual sal_Bool SAL_CALL deletesAreDetected( sal_Int32 setType ) override;
virtual sal_Bool SAL_CALL insertsAreDetected( sal_Int32 setType ) override;
virtual sal_Bool SAL_CALL supportsBatchUpdates( ) override;
virtual css::uno::Reference< css::sdbc::XResultSet > SAL_CALL getUDTs( const css::uno::Any& catalog, const OUString& schemaPattern, const OUString& typeNamePattern, const css::uno::Sequence< sal_Int32 >& types ) override;
OUString pwszLiteralValue;
sal_uInt32 cchMaxLen;
bool fSupported;
};
std::map<sal_uInt32,LiteralInfo> m_aLiteralInfo;
WpADOConnection& m_rADOConnection;
OConnection* m_pConnection;
void fillLiterals();
// get information out of rowset
sal_Int32 getMaxSize(sal_uInt32 _nId);
bool isCapable(sal_uInt32 _nId);
OUString getLiteral(sal_uInt32 _nProperty);
// get info out of properties
/// @throws css::sdbc::SQLException
/// @throws css::uno::RuntimeException
OUString getStringProperty(const OUString& _aProperty);
/// @throws css::sdbc::SQLException
/// @throws css::uno::RuntimeException
sal_Int32 getInt32Property(const OUString& _aProperty);
/// @throws css::sdbc::SQLException
/// @throws css::uno::RuntimeException
bool getBoolProperty(const OUString& _aProperty);
virtual css::uno::Reference< css::sdbc::XResultSet > impl_getTypeInfo_throw() override;
// cached database information
virtual OUString impl_getIdentifierQuoteString_throw( ) override;
virtual bool impl_isCatalogAtStart_throw( ) override;
virtual OUString impl_getCatalogSeparator_throw( ) override;
virtual bool impl_supportsCatalogsInTableDefinitions_throw( ) override;
virtual bool impl_supportsSchemasInTableDefinitions_throw( ) override;
virtual bool impl_supportsCatalogsInDataManipulation_throw( ) override;
virtual bool impl_supportsSchemasInDataManipulation_throw( ) override;
virtual bool impl_supportsMixedCaseQuotedIdentifiers_throw( ) override;
virtual bool impl_supportsAlterTableWithAddColumn_throw( ) override;
virtual bool impl_supportsAlterTableWithDropColumn_throw( ) override;
virtual sal_Int32 impl_getMaxStatements_throw( ) override;
virtual sal_Int32 impl_getMaxTablesInSelect_throw( ) override;
virtual bool impl_storesMixedCaseQuotedIdentifiers_throw( ) override;
public:
ODatabaseMetaData(OConnection* _pCon);
// XDatabaseMetaData
virtual sal_Bool SAL_CALL allProceduresAreCallable( ) override;
virtual sal_Bool SAL_CALL allTablesAreSelectable( ) override;
virtual OUString SAL_CALL getURL( ) override;
virtual OUString SAL_CALL getUserName( ) override;
virtual sal_Bool SAL_CALL isReadOnly( ) override;
virtual sal_Bool SAL_CALL nullsAreSortedHigh( ) override;
virtual sal_Bool SAL_CALL nullsAreSortedLow( ) override;
virtual sal_Bool SAL_CALL nullsAreSortedAtStart( ) override;
virtual sal_Bool SAL_CALL nullsAreSortedAtEnd( ) override;
virtual OUString SAL_CALL getDatabaseProductName( ) override;
virtual OUString SAL_CALL getDatabaseProductVersion( ) override;
virtual OUString SAL_CALL getDriverName( ) override;
virtual OUString SAL_CALL getDriverVersion( ) override;
virtual sal_Int32 SAL_CALL getDriverMajorVersion( ) override;
virtual sal_Int32 SAL_CALL getDriverMinorVersion( ) override;
virtual sal_Bool SAL_CALL usesLocalFiles( ) override;
virtual sal_Bool SAL_CALL usesLocalFilePerTable( ) override;
virtual sal_Bool SAL_CALL supportsMixedCaseIdentifiers( ) override;
virtual sal_Bool SAL_CALL storesUpperCaseIdentifiers( ) override;
virtual sal_Bool SAL_CALL storesLowerCaseIdentifiers( ) override;
virtual sal_Bool SAL_CALL storesMixedCaseIdentifiers( ) override;
virtual sal_Bool SAL_CALL storesUpperCaseQuotedIdentifiers( ) override;
virtual sal_Bool SAL_CALL storesLowerCaseQuotedIdentifiers( ) override;
virtual OUString SAL_CALL getSQLKeywords( ) override;
virtual OUString SAL_CALL getNumericFunctions( ) override;
virtual OUString SAL_CALL getStringFunctions( ) override;
virtual OUString SAL_CALL getSystemFunctions( ) override;
virtual OUString SAL_CALL getTimeDateFunctions( ) override;
virtual OUString SAL_CALL getSearchStringEscape( ) override;
virtual OUString SAL_CALL getExtraNameCharacters( ) override;
virtual sal_Bool SAL_CALL supportsColumnAliasing( ) override;
virtual sal_Bool SAL_CALL nullPlusNonNullIsNull( ) override;
virtual sal_Bool SAL_CALL supportsTypeConversion( ) override;
virtual sal_Bool SAL_CALL supportsConvert( sal_Int32 fromType, sal_Int32 toType ) override;
virtual sal_Bool SAL_CALL supportsTableCorrelationNames( ) override;
virtual sal_Bool SAL_CALL supportsDifferentTableCorrelationNames( ) override;
virtual sal_Bool SAL_CALL supportsExpressionsInOrderBy( ) override;
virtual sal_Bool SAL_CALL supportsOrderByUnrelated( ) override;
virtual sal_Bool SAL_CALL supportsGroupBy( ) override;
virtual sal_Bool SAL_CALL supportsGroupByUnrelated( ) override;
virtual sal_Bool SAL_CALL supportsGroupByBeyondSelect( ) override;
virtual sal_Bool SAL_CALL supportsLikeEscapeClause( ) override;
virtual sal_Bool SAL_CALL supportsMultipleResultSets( ) override;
virtual sal_Bool SAL_CALL supportsMultipleTransactions( ) override;
virtual sal_Bool SAL_CALL supportsNonNullableColumns( ) override;
virtual sal_Bool SAL_CALL supportsMinimumSQLGrammar( ) override;
virtual sal_Bool SAL_CALL supportsCoreSQLGrammar( ) override;
virtual sal_Bool SAL_CALL supportsExtendedSQLGrammar( ) override;
virtual sal_Bool SAL_CALL supportsANSI92EntryLevelSQL( ) override;
virtual sal_Bool SAL_CALL supportsANSI92IntermediateSQL( ) override;
virtual sal_Bool SAL_CALL supportsANSI92FullSQL( ) override;
virtual sal_Bool SAL_CALL supportsIntegrityEnhancementFacility( ) override;
virtual sal_Bool SAL_CALL supportsOuterJoins( ) override;
virtual sal_Bool SAL_CALL supportsFullOuterJoins( ) override;
virtual sal_Bool SAL_CALL supportsLimitedOuterJoins( ) override;
virtual OUString SAL_CALL getSchemaTerm( ) override;
virtual OUString SAL_CALL getProcedureTerm( ) override;
virtual OUString SAL_CALL getCatalogTerm( ) override;
virtual sal_Bool SAL_CALL supportsSchemasInProcedureCalls( ) override;
virtual sal_Bool SAL_CALL supportsSchemasInIndexDefinitions( ) override;
virtual sal_Bool SAL_CALL supportsSchemasInPrivilegeDefinitions( ) override;
virtual sal_Bool SAL_CALL supportsCatalogsInProcedureCalls( ) override;
virtual sal_Bool SAL_CALL supportsCatalogsInIndexDefinitions( ) override;
virtual sal_Bool SAL_CALL supportsCatalogsInPrivilegeDefinitions( ) override;
virtual sal_Bool SAL_CALL supportsPositionedDelete( ) override;
virtual sal_Bool SAL_CALL supportsPositionedUpdate( ) override;
virtual sal_Bool SAL_CALL supportsSelectForUpdate( ) override;
virtual sal_Bool SAL_CALL supportsStoredProcedures( ) override;
virtual sal_Bool SAL_CALL supportsSubqueriesInComparisons( ) override;
virtual sal_Bool SAL_CALL supportsSubqueriesInExists( ) override;
virtual sal_Bool SAL_CALL supportsSubqueriesInIns( ) override;
virtual sal_Bool SAL_CALL supportsSubqueriesInQuantifieds( ) override;
virtual sal_Bool SAL_CALL supportsCorrelatedSubqueries( ) override;
virtual sal_Bool SAL_CALL supportsUnion( ) override;
virtual sal_Bool SAL_CALL supportsUnionAll( ) override;
virtual sal_Bool SAL_CALL supportsOpenCursorsAcrossCommit( ) override;
virtual sal_Bool SAL_CALL supportsOpenCursorsAcrossRollback( ) override;
virtual sal_Bool SAL_CALL supportsOpenStatementsAcrossCommit( ) override;
virtual sal_Bool SAL_CALL supportsOpenStatementsAcrossRollback( ) override;
virtual sal_Int32 SAL_CALL getMaxBinaryLiteralLength( ) override;
virtual sal_Int32 SAL_CALL getMaxCharLiteralLength( ) override;
virtual sal_Int32 SAL_CALL getMaxColumnNameLength( ) override;
virtual sal_Int32 SAL_CALL getMaxColumnsInGroupBy( ) override;
virtual sal_Int32 SAL_CALL getMaxColumnsInIndex( ) override;
virtual sal_Int32 SAL_CALL getMaxColumnsInOrderBy( ) override;
virtual sal_Int32 SAL_CALL getMaxColumnsInSelect( ) override;
virtual sal_Int32 SAL_CALL getMaxColumnsInTable( ) override;
virtual sal_Int32 SAL_CALL getMaxConnections( ) override;
virtual sal_Int32 SAL_CALL getMaxCursorNameLength( ) override;
virtual sal_Int32 SAL_CALL getMaxIndexLength( ) override;
virtual sal_Int32 SAL_CALL getMaxSchemaNameLength( ) override;
virtual sal_Int32 SAL_CALL getMaxProcedureNameLength( ) override;
virtual sal_Int32 SAL_CALL getMaxCatalogNameLength( ) override;
virtual sal_Int32 SAL_CALL getMaxRowSize( ) override;
virtual sal_Bool SAL_CALL doesMaxRowSizeIncludeBlobs( ) override;
virtual sal_Int32 SAL_CALL getMaxStatementLength( ) override;
virtual sal_Int32 SAL_CALL getMaxTableNameLength( ) override;
virtual sal_Int32 SAL_CALL getMaxUserNameLength( ) override;
virtual sal_Int32 SAL_CALL getDefaultTransactionIsolation( ) override;
virtual sal_Bool SAL_CALL supportsTransactions( ) override;
virtual sal_Bool SAL_CALL supportsTransactionIsolationLevel( sal_Int32 level ) override;
virtual sal_Bool SAL_CALL supportsDataDefinitionAndDataManipulationTransactions( ) override;
virtual sal_Bool SAL_CALL supportsDataManipulationTransactionsOnly( ) override;
virtual sal_Bool SAL_CALL dataDefinitionCausesTransactionCommit( ) override;
virtual sal_Bool SAL_CALL dataDefinitionIgnoredInTransactions( ) override;
virtual css::uno::Reference< css::sdbc::XResultSet > SAL_CALL getProcedures( const css::uno::Any& catalog, const OUString& schemaPattern, const OUString& procedureNamePattern ) override;
virtual css::uno::Reference< css::sdbc::XResultSet > SAL_CALL getProcedureColumns( const css::uno::Any& catalog, const OUString& schemaPattern, const OUString& procedureNamePattern, const OUString& columnNamePattern ) override;
virtual css::uno::Reference< css::sdbc::XResultSet > SAL_CALL getTables( const css::uno::Any& catalog, const OUString& schemaPattern, const OUString& tableNamePattern, const css::uno::Sequence< OUString >& types ) override;
virtual css::uno::Reference< css::sdbc::XResultSet > SAL_CALL getSchemas( ) override;
virtual css::uno::Reference< css::sdbc::XResultSet > SAL_CALL getCatalogs( ) override;
virtual css::uno::Reference< css::sdbc::XResultSet > SAL_CALL getTableTypes( ) override;
virtual css::uno::Reference< css::sdbc::XResultSet > SAL_CALL getColumns( const css::uno::Any& catalog, const OUString& schemaPattern, const OUString& tableNamePattern, const OUString& columnNamePattern ) override;
virtual css::uno::Reference< css::sdbc::XResultSet > SAL_CALL getColumnPrivileges( const css::uno::Any& catalog, const OUString& schema, const OUString& table, const OUString& columnNamePattern ) override;
virtual css::uno::Reference< css::sdbc::XResultSet > SAL_CALL getTablePrivileges( const css::uno::Any& catalog, const OUString& schemaPattern, const OUString& tableNamePattern ) override;
virtual css::uno::Reference< css::sdbc::XResultSet > SAL_CALL getPrimaryKeys( const css::uno::Any& catalog, const OUString& schema, const OUString& table ) override;
virtual css::uno::Reference< css::sdbc::XResultSet > SAL_CALL getImportedKeys( const css::uno::Any& catalog, const OUString& schema, const OUString& table ) override;
virtual css::uno::Reference< css::sdbc::XResultSet > SAL_CALL getExportedKeys( const css::uno::Any& catalog, const OUString& schema, const OUString& table ) override;
virtual css::uno::Reference< css::sdbc::XResultSet > SAL_CALL getCrossReference( const css::uno::Any& primaryCatalog, const OUString& primarySchema, const OUString& primaryTable, const css::uno::Any& foreignCatalog, const OUString& foreignSchema, const OUString& foreignTable ) override;
virtual css::uno::Reference< css::sdbc::XResultSet > SAL_CALL getIndexInfo( const css::uno::Any& catalog, const OUString& schema, const OUString& table, sal_Bool unique, sal_Bool approximate ) override;
virtual sal_Bool SAL_CALL supportsResultSetType( sal_Int32 setType ) override;
virtual sal_Bool SAL_CALL supportsResultSetConcurrency( sal_Int32 setType, sal_Int32 concurrency ) override;
virtual sal_Bool SAL_CALL ownUpdatesAreVisible( sal_Int32 setType ) override;
virtual sal_Bool SAL_CALL ownDeletesAreVisible( sal_Int32 setType ) override;
virtual sal_Bool SAL_CALL ownInsertsAreVisible( sal_Int32 setType ) override;
virtual sal_Bool SAL_CALL othersUpdatesAreVisible( sal_Int32 setType ) override;
virtual sal_Bool SAL_CALL othersDeletesAreVisible( sal_Int32 setType ) override;
virtual sal_Bool SAL_CALL othersInsertsAreVisible( sal_Int32 setType ) override;
virtual sal_Bool SAL_CALL updatesAreDetected( sal_Int32 setType ) override;
virtual sal_Bool SAL_CALL deletesAreDetected( sal_Int32 setType ) override;
virtual sal_Bool SAL_CALL insertsAreDetected( sal_Int32 setType ) override;
virtual sal_Bool SAL_CALL supportsBatchUpdates( ) override;
virtual css::uno::Reference< css::sdbc::XResultSet > SAL_CALL getUDTs( const css::uno::Any& catalog, const OUString& schemaPattern, const OUString& typeNamePattern, const css::uno::Sequence< sal_Int32 >& types ) override;
};
}
@@ -35,191 +35,191 @@
namespace connectivity::ado
{
/*
** java_sql_ResultSet
*/
typedef ::cppu::WeakComponentImplHelper< css::sdbc::XResultSet,
css::sdbc::XRow,
css::sdbc::XResultSetMetaDataSupplier,
css::util::XCancellable,
css::sdbc::XWarningsSupplier,
css::sdbc::XCloseable,
css::sdbc::XColumnLocate> ODatabaseMetaDataResultSet_BASE;
/*
** java_sql_ResultSet
*/
typedef ::cppu::WeakComponentImplHelper< css::sdbc::XResultSet,
css::sdbc::XRow,
css::sdbc::XResultSetMetaDataSupplier,
css::util::XCancellable,
css::sdbc::XWarningsSupplier,
css::sdbc::XCloseable,
css::sdbc::XColumnLocate> ODatabaseMetaDataResultSet_BASE;
class ODatabaseMetaDataResultSet : public cppu::BaseMutex,
public ODatabaseMetaDataResultSet_BASE,
public ::cppu::OPropertySetHelper,
public ::comphelper::OPropertyArrayUsageHelper<ODatabaseMetaDataResultSet>
{
std::vector<sal_Int32> m_aColMapping; // pos 0 is unused so we don't have to decrement 1 every time
class ODatabaseMetaDataResultSet : public cppu::BaseMutex,
public ODatabaseMetaDataResultSet_BASE,
public ::cppu::OPropertySetHelper,
public ::comphelper::OPropertyArrayUsageHelper<ODatabaseMetaDataResultSet>
{
std::vector<sal_Int32> m_aColMapping; // pos 0 is unused so we don't have to decrement 1 every time
std::map<sal_Int32, ::std::map<sal_Int32,sal_Int32> > m_aValueRange;
std::map<sal_Int32, ::std::map<sal_Int32,sal_Int32> >::iterator m_aValueRangeIter;
std::map<sal_Int32, ::std::map<sal_Int32,sal_Int32> > m_aValueRange;
std::map<sal_Int32, ::std::map<sal_Int32,sal_Int32> >::iterator m_aValueRangeIter;
std::map<sal_Int32, std::map< OUString,sal_Int32> > m_aStrValueRange;
std::map<sal_Int32, std::map< OUString,sal_Int32> >::iterator m_aStrValueRangeIter;
std::map<sal_Int32, std::map< OUString,sal_Int32> > m_aStrValueRange;
std::map<sal_Int32, std::map< OUString,sal_Int32> >::iterator m_aStrValueRangeIter;
std::map<sal_Int32, std::map< sal_Int32,OUString> > m_aIntValueRange;
std::map<sal_Int32, std::map< sal_Int32,OUString> >::iterator m_aIntValueRangeIter;
std::map<sal_Int32, std::map< sal_Int32,OUString> > m_aIntValueRange;
std::map<sal_Int32, std::map< sal_Int32,OUString> >::iterator m_aIntValueRangeIter;
ADORecordset* m_pRecordSet;
css::uno::WeakReferenceHelper m_aStatement1;
css::uno::Reference< css::sdbc::XResultSetMetaData> m_xMetaData;
OLEVariant m_aValue;
sal_Int32 m_nRowPos;
bool m_bWasNull;
bool m_bEOF;
bool m_bOnFirstAfterOpen;
ADORecordset* m_pRecordSet;
css::uno::WeakReferenceHelper m_aStatement1;
css::uno::Reference< css::sdbc::XResultSetMetaData> m_xMetaData;
OLEVariant m_aValue;
sal_Int32 m_nRowPos;
bool m_bWasNull;
bool m_bEOF;
bool m_bOnFirstAfterOpen;
/// @throws css::sdbc::SQLException
/// @throws css::uno::RuntimeException
static sal_Int32 getResultSetConcurrency();
/// @throws css::sdbc::SQLException
/// @throws css::uno::RuntimeException
static sal_Int32 getResultSetType();
/// @throws css::sdbc::SQLException
/// @throws css::uno::RuntimeException
static sal_Int32 getFetchDirection();
/// @throws css::sdbc::SQLException
/// @throws css::uno::RuntimeException
sal_Int32 getFetchSize() const;
/// @throws css::sdbc::SQLException
/// @throws css::uno::RuntimeException
static OUString getCursorName();
/// @throws css::sdbc::SQLException
/// @throws css::uno::RuntimeException
static sal_Int32 getResultSetConcurrency();
/// @throws css::sdbc::SQLException
/// @throws css::uno::RuntimeException
static sal_Int32 getResultSetType();
/// @throws css::sdbc::SQLException
/// @throws css::uno::RuntimeException
static sal_Int32 getFetchDirection();
/// @throws css::sdbc::SQLException
/// @throws css::uno::RuntimeException
sal_Int32 getFetchSize() const;
/// @throws css::sdbc::SQLException
/// @throws css::uno::RuntimeException
static OUString getCursorName();
/// @throws css::sdbc::SQLException
/// @throws css::uno::RuntimeException
void setFetchDirection(sal_Int32 _par0);
/// @throws css::sdbc::SQLException
/// @throws css::uno::RuntimeException
void setFetchSize(sal_Int32 _par0);
/// @throws css::sdbc::SQLException
/// @throws css::uno::RuntimeException
void setFetchDirection(sal_Int32 _par0);
/// @throws css::sdbc::SQLException
/// @throws css::uno::RuntimeException
void setFetchSize(sal_Int32 _par0);
inline sal_Int32 mapColumn (sal_Int32 column);
/// @throws css::sdbc::SQLException
void checkRecordSet();
/// @throws css::sdbc::SQLException
/// @throws css::uno::RuntimeException
OLEVariant getValue(sal_Int32 columnIndex );
inline sal_Int32 mapColumn (sal_Int32 column);
/// @throws css::sdbc::SQLException
void checkRecordSet();
/// @throws css::sdbc::SQLException
/// @throws css::uno::RuntimeException
OLEVariant getValue(sal_Int32 columnIndex );
protected:
protected:
// OPropertyArrayUsageHelper
virtual ::cppu::IPropertyArrayHelper* createArrayHelper( ) const override;
// OPropertySetHelper
virtual ::cppu::IPropertyArrayHelper & SAL_CALL getInfoHelper() override;
// OPropertyArrayUsageHelper
virtual ::cppu::IPropertyArrayHelper* createArrayHelper( ) const override;
// OPropertySetHelper
virtual ::cppu::IPropertyArrayHelper & SAL_CALL getInfoHelper() override;
virtual sal_Bool SAL_CALL convertFastPropertyValue(
css::uno::Any & rConvertedValue,
css::uno::Any & rOldValue,
virtual sal_Bool SAL_CALL convertFastPropertyValue(
css::uno::Any & rConvertedValue,
css::uno::Any & rOldValue,
sal_Int32 nHandle,
const css::uno::Any& rValue ) override;
virtual void SAL_CALL setFastPropertyValue_NoBroadcast(
sal_Int32 nHandle,
const css::uno::Any& rValue ) override;
virtual void SAL_CALL setFastPropertyValue_NoBroadcast(
sal_Int32 nHandle,
const css::uno::Any& rValue
) override;
virtual void SAL_CALL getFastPropertyValue(
css::uno::Any& rValue,
sal_Int32 nHandle
) const override;
public:
// a Constructor, that is needed for when Returning the Object is needed:
ODatabaseMetaDataResultSet( ADORecordset* _pRecordSet);
~ODatabaseMetaDataResultSet() override;
const css::uno::Any& rValue
) override;
virtual void SAL_CALL getFastPropertyValue(
css::uno::Any& rValue,
sal_Int32 nHandle
) const override;
public:
// a Constructor, that is needed for when Returning the Object is needed:
ODatabaseMetaDataResultSet( ADORecordset* _pRecordSet);
~ODatabaseMetaDataResultSet() override;
// ::cppu::OComponentHelper
virtual void SAL_CALL disposing() override;
// XInterface
virtual css::uno::Any SAL_CALL queryInterface( const css::uno::Type & rType ) override;
virtual void SAL_CALL acquire() noexcept override;
virtual void SAL_CALL release() noexcept override;
//XTypeProvider
virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes( ) override;
// XPropertySet
virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) override;
// XResultSet
virtual sal_Bool SAL_CALL next( ) override;
virtual sal_Bool SAL_CALL isBeforeFirst( ) override;
virtual sal_Bool SAL_CALL isAfterLast( ) override;
virtual sal_Bool SAL_CALL isFirst( ) override;
virtual sal_Bool SAL_CALL isLast( ) override;
virtual void SAL_CALL beforeFirst( ) override;
virtual void SAL_CALL afterLast( ) override;
virtual sal_Bool SAL_CALL first( ) override;
virtual sal_Bool SAL_CALL last( ) override;
virtual sal_Int32 SAL_CALL getRow( ) override;
virtual sal_Bool SAL_CALL absolute( sal_Int32 row ) override;
virtual sal_Bool SAL_CALL relative( sal_Int32 rows ) override;
virtual sal_Bool SAL_CALL previous( ) override;
virtual void SAL_CALL refreshRow( ) override;
virtual sal_Bool SAL_CALL rowUpdated( ) override;
virtual sal_Bool SAL_CALL rowInserted( ) override;
virtual sal_Bool SAL_CALL rowDeleted( ) override;
virtual css::uno::Reference< css::uno::XInterface > SAL_CALL getStatement( ) override;
// XRow
virtual sal_Bool SAL_CALL wasNull( ) override;
virtual OUString SAL_CALL getString( sal_Int32 columnIndex ) override;
virtual sal_Bool SAL_CALL getBoolean( sal_Int32 columnIndex ) override;
virtual sal_Int8 SAL_CALL getByte( sal_Int32 columnIndex ) override;
virtual sal_Int16 SAL_CALL getShort( sal_Int32 columnIndex ) override;
virtual sal_Int32 SAL_CALL getInt( sal_Int32 columnIndex ) override;
virtual sal_Int64 SAL_CALL getLong( sal_Int32 columnIndex ) override;
virtual float SAL_CALL getFloat( sal_Int32 columnIndex ) override;
virtual double SAL_CALL getDouble( sal_Int32 columnIndex ) override;
virtual css::uno::Sequence< sal_Int8 > SAL_CALL getBytes( sal_Int32 columnIndex ) override;
virtual css::util::Date SAL_CALL getDate( sal_Int32 columnIndex ) override;
virtual css::util::Time SAL_CALL getTime( sal_Int32 columnIndex ) override;
virtual css::util::DateTime SAL_CALL getTimestamp( sal_Int32 columnIndex ) override;
virtual css::uno::Reference< css::io::XInputStream > SAL_CALL getBinaryStream( sal_Int32 columnIndex ) override;
virtual css::uno::Reference< css::io::XInputStream > SAL_CALL getCharacterStream( sal_Int32 columnIndex ) override;
virtual css::uno::Any SAL_CALL getObject( sal_Int32 columnIndex, const css::uno::Reference< css::container::XNameAccess >& typeMap ) override;
virtual css::uno::Reference< css::sdbc::XRef > SAL_CALL getRef( sal_Int32 columnIndex ) override;
virtual css::uno::Reference< css::sdbc::XBlob > SAL_CALL getBlob( sal_Int32 columnIndex ) override;
virtual css::uno::Reference< css::sdbc::XClob > SAL_CALL getClob( sal_Int32 columnIndex ) override;
virtual css::uno::Reference< css::sdbc::XArray > SAL_CALL getArray( sal_Int32 columnIndex ) override;
// XResultSetMetaDataSupplier
virtual css::uno::Reference< css::sdbc::XResultSetMetaData > SAL_CALL getMetaData( ) override;
// XCancellable
virtual void SAL_CALL cancel( ) override;
// XCloseable
virtual void SAL_CALL close( ) override;
// XWarningsSupplier
virtual css::uno::Any SAL_CALL getWarnings( ) override;
virtual void SAL_CALL clearWarnings( ) override;
// XColumnLocate
virtual sal_Int32 SAL_CALL findColumn( const OUString& columnName ) override;
// ::cppu::OComponentHelper
virtual void SAL_CALL disposing() override;
// XInterface
virtual css::uno::Any SAL_CALL queryInterface( const css::uno::Type & rType ) override;
virtual void SAL_CALL acquire() noexcept override;
virtual void SAL_CALL release() noexcept override;
//XTypeProvider
virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes( ) override;
// XPropertySet
virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) override;
// XResultSet
virtual sal_Bool SAL_CALL next( ) override;
virtual sal_Bool SAL_CALL isBeforeFirst( ) override;
virtual sal_Bool SAL_CALL isAfterLast( ) override;
virtual sal_Bool SAL_CALL isFirst( ) override;
virtual sal_Bool SAL_CALL isLast( ) override;
virtual void SAL_CALL beforeFirst( ) override;
virtual void SAL_CALL afterLast( ) override;
virtual sal_Bool SAL_CALL first( ) override;
virtual sal_Bool SAL_CALL last( ) override;
virtual sal_Int32 SAL_CALL getRow( ) override;
virtual sal_Bool SAL_CALL absolute( sal_Int32 row ) override;
virtual sal_Bool SAL_CALL relative( sal_Int32 rows ) override;
virtual sal_Bool SAL_CALL previous( ) override;
virtual void SAL_CALL refreshRow( ) override;
virtual sal_Bool SAL_CALL rowUpdated( ) override;
virtual sal_Bool SAL_CALL rowInserted( ) override;
virtual sal_Bool SAL_CALL rowDeleted( ) override;
virtual css::uno::Reference< css::uno::XInterface > SAL_CALL getStatement( ) override;
// XRow
virtual sal_Bool SAL_CALL wasNull( ) override;
virtual OUString SAL_CALL getString( sal_Int32 columnIndex ) override;
virtual sal_Bool SAL_CALL getBoolean( sal_Int32 columnIndex ) override;
virtual sal_Int8 SAL_CALL getByte( sal_Int32 columnIndex ) override;
virtual sal_Int16 SAL_CALL getShort( sal_Int32 columnIndex ) override;
virtual sal_Int32 SAL_CALL getInt( sal_Int32 columnIndex ) override;
virtual sal_Int64 SAL_CALL getLong( sal_Int32 columnIndex ) override;
virtual float SAL_CALL getFloat( sal_Int32 columnIndex ) override;
virtual double SAL_CALL getDouble( sal_Int32 columnIndex ) override;
virtual css::uno::Sequence< sal_Int8 > SAL_CALL getBytes( sal_Int32 columnIndex ) override;
virtual css::util::Date SAL_CALL getDate( sal_Int32 columnIndex ) override;
virtual css::util::Time SAL_CALL getTime( sal_Int32 columnIndex ) override;
virtual css::util::DateTime SAL_CALL getTimestamp( sal_Int32 columnIndex ) override;
virtual css::uno::Reference< css::io::XInputStream > SAL_CALL getBinaryStream( sal_Int32 columnIndex ) override;
virtual css::uno::Reference< css::io::XInputStream > SAL_CALL getCharacterStream( sal_Int32 columnIndex ) override;
virtual css::uno::Any SAL_CALL getObject( sal_Int32 columnIndex, const css::uno::Reference< css::container::XNameAccess >& typeMap ) override;
virtual css::uno::Reference< css::sdbc::XRef > SAL_CALL getRef( sal_Int32 columnIndex ) override;
virtual css::uno::Reference< css::sdbc::XBlob > SAL_CALL getBlob( sal_Int32 columnIndex ) override;
virtual css::uno::Reference< css::sdbc::XClob > SAL_CALL getClob( sal_Int32 columnIndex ) override;
virtual css::uno::Reference< css::sdbc::XArray > SAL_CALL getArray( sal_Int32 columnIndex ) override;
// XResultSetMetaDataSupplier
virtual css::uno::Reference< css::sdbc::XResultSetMetaData > SAL_CALL getMetaData( ) override;
// XCancellable
virtual void SAL_CALL cancel( ) override;
// XCloseable
virtual void SAL_CALL close( ) override;
// XWarningsSupplier
virtual css::uno::Any SAL_CALL getWarnings( ) override;
virtual void SAL_CALL clearWarnings( ) override;
// XColumnLocate
virtual sal_Int32 SAL_CALL findColumn( const OUString& columnName ) override;
const std::vector<sal_Int32>& getColumnMapping() { return m_aColMapping; }
const std::vector<sal_Int32>& getColumnMapping() { return m_aColMapping; }
void setCatalogsMap();
void setSchemasMap();
void setColumnPrivilegesMap();
void setColumnsMap();
void setTablesMap();
void setProcedureColumnsMap();
void setProceduresMap();
void setExportedKeysMap();
void setImportedKeysMap();
void setPrimaryKeysMap();
void setIndexInfoMap();
void setTablePrivilegesMap();
void setCrossReferenceMap();
void setTypeInfoMap(bool _bJetEngine);
};
void setCatalogsMap();
void setSchemasMap();
void setColumnPrivilegesMap();
void setColumnsMap();
void setTablesMap();
void setProcedureColumnsMap();
void setProceduresMap();
void setExportedKeysMap();
void setImportedKeysMap();
void setPrimaryKeysMap();
void setIndexInfoMap();
void setTablePrivilegesMap();
void setCrossReferenceMap();
void setTypeInfoMap(bool _bJetEngine);
};
inline sal_Int32 ODatabaseMetaDataResultSet::mapColumn (sal_Int32 column)
inline sal_Int32 ODatabaseMetaDataResultSet::mapColumn (sal_Int32 column)
{
sal_Int32 map = column;
if (!m_aColMapping.empty())
{
sal_Int32 map = column;
if (!m_aColMapping.empty())
{
// Validate column number
map = m_aColMapping[column];
}
return map;
// Validate column number
map = m_aColMapping[column];
}
return map;
}
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
@@ -29,74 +29,74 @@
namespace connectivity::ado
{
//************ Class: ResultSetMetaData
//************ Class: ResultSetMetaData
typedef ::cppu::WeakImplHelper< css::sdbc::XResultSetMetaData> ODatabaseMetaResultSetMetaData_BASE;
typedef ::cppu::WeakImplHelper< css::sdbc::XResultSetMetaData> ODatabaseMetaResultSetMetaData_BASE;
class ODatabaseMetaDataResultSetMetaData : public ODatabaseMetaResultSetMetaData_BASE
class ODatabaseMetaDataResultSetMetaData : public ODatabaseMetaResultSetMetaData_BASE
{
friend class ODatabaseMetaDataResultSet;
const std::vector<sal_Int32> &m_vMapping; // when not every column is needed
std::map<sal_Int32,connectivity::OColumn> m_mColumns;
std::map<sal_Int32,connectivity::OColumn>::const_iterator m_mColumnsIter;
ADORecordset* m_pRecordSet;
sal_Int32 m_nColCount;
private:
ODatabaseMetaDataResultSetMetaData( const ODatabaseMetaDataResultSetMetaData& ); // never implemented
ODatabaseMetaDataResultSetMetaData& operator=( const ODatabaseMetaDataResultSetMetaData& ); // never implemented
protected:
void setColumnPrivilegesMap();
void setColumnsMap();
void setTablesMap();
void setProcedureColumnsMap();
void setPrimaryKeysMap();
void setIndexInfoMap();
void setTablePrivilegesMap();
void setCrossReferenceMap();
void setTypeInfoMap();
void setProceduresMap();
public:
// a Constructor, that is needed for when Returning the Object is needed:
ODatabaseMetaDataResultSetMetaData( ADORecordset* _pRecordSet ,ODatabaseMetaDataResultSet* _pRes)
: m_vMapping(_pRes->getColumnMapping()),
m_pRecordSet(_pRecordSet),
m_nColCount(m_vMapping.size()-1)
{
friend class ODatabaseMetaDataResultSet;
if(m_pRecordSet)
m_pRecordSet->AddRef();
}
~ODatabaseMetaDataResultSetMetaData() override;
const std::vector<sal_Int32> &m_vMapping; // when not every column is needed
std::map<sal_Int32,connectivity::OColumn> m_mColumns;
std::map<sal_Int32,connectivity::OColumn>::const_iterator m_mColumnsIter;
/// Avoid ambiguous cast error from the compiler.
operator css::uno::Reference< css::sdbc::XResultSetMetaData > () noexcept
{ return this; }
ADORecordset* m_pRecordSet;
sal_Int32 m_nColCount;
private:
ODatabaseMetaDataResultSetMetaData( const ODatabaseMetaDataResultSetMetaData& ); // never implemented
ODatabaseMetaDataResultSetMetaData& operator=( const ODatabaseMetaDataResultSetMetaData& ); // never implemented
protected:
void setColumnPrivilegesMap();
void setColumnsMap();
void setTablesMap();
void setProcedureColumnsMap();
void setPrimaryKeysMap();
void setIndexInfoMap();
void setTablePrivilegesMap();
void setCrossReferenceMap();
void setTypeInfoMap();
void setProceduresMap();
public:
// a Constructor, that is needed for when Returning the Object is needed:
ODatabaseMetaDataResultSetMetaData( ADORecordset* _pRecordSet ,ODatabaseMetaDataResultSet* _pRes)
: m_vMapping(_pRes->getColumnMapping()),
m_pRecordSet(_pRecordSet),
m_nColCount(m_vMapping.size()-1)
{
if(m_pRecordSet)
m_pRecordSet->AddRef();
}
~ODatabaseMetaDataResultSetMetaData() override;
/// Avoid ambiguous cast error from the compiler.
operator css::uno::Reference< css::sdbc::XResultSetMetaData > () noexcept
{ return this; }
virtual sal_Int32 SAL_CALL getColumnCount( ) override;
virtual sal_Bool SAL_CALL isAutoIncrement( sal_Int32 column ) override;
virtual sal_Bool SAL_CALL isCaseSensitive( sal_Int32 column ) override;
virtual sal_Bool SAL_CALL isSearchable( sal_Int32 column ) override;
virtual sal_Bool SAL_CALL isCurrency( sal_Int32 column ) override;
virtual sal_Int32 SAL_CALL isNullable( sal_Int32 column ) override;
virtual sal_Bool SAL_CALL isSigned( sal_Int32 column ) override;
virtual sal_Int32 SAL_CALL getColumnDisplaySize( sal_Int32 column ) override;
virtual OUString SAL_CALL getColumnLabel( sal_Int32 column ) override;
virtual OUString SAL_CALL getColumnName( sal_Int32 column ) override;
virtual OUString SAL_CALL getSchemaName( sal_Int32 column ) override;
virtual sal_Int32 SAL_CALL getPrecision( sal_Int32 column ) override;
virtual sal_Int32 SAL_CALL getScale( sal_Int32 column ) override;
virtual OUString SAL_CALL getTableName( sal_Int32 column ) override;
virtual OUString SAL_CALL getCatalogName( sal_Int32 column ) override;
virtual sal_Int32 SAL_CALL getColumnType( sal_Int32 column ) override;
virtual OUString SAL_CALL getColumnTypeName( sal_Int32 column ) override;
virtual sal_Bool SAL_CALL isReadOnly( sal_Int32 column ) override;
virtual sal_Bool SAL_CALL isWritable( sal_Int32 column ) override;
virtual sal_Bool SAL_CALL isDefinitelyWritable( sal_Int32 column ) override;
virtual OUString SAL_CALL getColumnServiceName( sal_Int32 column ) override;
};
virtual sal_Int32 SAL_CALL getColumnCount( ) override;
virtual sal_Bool SAL_CALL isAutoIncrement( sal_Int32 column ) override;
virtual sal_Bool SAL_CALL isCaseSensitive( sal_Int32 column ) override;
virtual sal_Bool SAL_CALL isSearchable( sal_Int32 column ) override;
virtual sal_Bool SAL_CALL isCurrency( sal_Int32 column ) override;
virtual sal_Int32 SAL_CALL isNullable( sal_Int32 column ) override;
virtual sal_Bool SAL_CALL isSigned( sal_Int32 column ) override;
virtual sal_Int32 SAL_CALL getColumnDisplaySize( sal_Int32 column ) override;
virtual OUString SAL_CALL getColumnLabel( sal_Int32 column ) override;
virtual OUString SAL_CALL getColumnName( sal_Int32 column ) override;
virtual OUString SAL_CALL getSchemaName( sal_Int32 column ) override;
virtual sal_Int32 SAL_CALL getPrecision( sal_Int32 column ) override;
virtual sal_Int32 SAL_CALL getScale( sal_Int32 column ) override;
virtual OUString SAL_CALL getTableName( sal_Int32 column ) override;
virtual OUString SAL_CALL getCatalogName( sal_Int32 column ) override;
virtual sal_Int32 SAL_CALL getColumnType( sal_Int32 column ) override;
virtual OUString SAL_CALL getColumnTypeName( sal_Int32 column ) override;
virtual sal_Bool SAL_CALL isReadOnly( sal_Int32 column ) override;
virtual sal_Bool SAL_CALL isWritable( sal_Int32 column ) override;
virtual sal_Bool SAL_CALL isDefinitelyWritable( sal_Int32 column ) override;
virtual OUString SAL_CALL getColumnServiceName( sal_Int32 column ) override;
};
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+37 -37
View File
@@ -30,53 +30,53 @@ namespace com::sun::star::uno { class XComponentContext; }
namespace connectivity::ado
{
class OConnection;
class OConnection;
typedef ::cppu::WeakComponentImplHelper< css::sdbc::XDriver,
css::sdbcx::XDataDefinitionSupplier,
css::lang::XServiceInfo
> ODriver_BASE;
class ODriver : public ODriver_BASE
{
::osl::Mutex m_aMutex;
typedef ::cppu::WeakComponentImplHelper< css::sdbc::XDriver,
css::sdbcx::XDataDefinitionSupplier,
css::lang::XServiceInfo
> ODriver_BASE;
class ODriver : public ODriver_BASE
{
::osl::Mutex m_aMutex;
std::vector<unotools::WeakReference<OConnection>>
m_xConnections; // vector containing a list
// of all the Connection objects
// for this Driver
css::uno::Reference< css::uno::XComponentContext > m_xContext;
std::vector<unotools::WeakReference<OConnection>>
m_xConnections; // vector containing a list
// of all the Connection objects
// for this Driver
css::uno::Reference< css::uno::XComponentContext > m_xContext;
// to put back all the inits with COINIT_MULTITHREADED if needed
int mnNbCallCoInitializeExForReinit;
// to put back all the inits with COINIT_MULTITHREADED if needed
int mnNbCallCoInitializeExForReinit;
public:
ODriver(const css::uno::Reference< css::uno::XComponentContext >& xContext);
~ODriver() override;
public:
ODriver(const css::uno::Reference< css::uno::XComponentContext >& xContext);
~ODriver() override;
// OComponentHelper
virtual void SAL_CALL disposing() override;
// OComponentHelper
virtual void SAL_CALL disposing() override;
css::uno::Reference< css::uno::XComponentContext > getContext() const { return m_xContext; }
css::uno::Reference< css::uno::XComponentContext > getContext() const { return m_xContext; }
private:
void impl_checkURL_throw(const OUString& _sUrl);
private:
void impl_checkURL_throw(const OUString& _sUrl);
// XServiceInfo
virtual OUString SAL_CALL getImplementationName( ) override;
virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) override;
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames( ) override;
// XServiceInfo
virtual OUString SAL_CALL getImplementationName( ) override;
virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) override;
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames( ) override;
// XDriver
virtual css::uno::Reference< css::sdbc::XConnection > SAL_CALL connect( const OUString& url, const css::uno::Sequence< css::beans::PropertyValue >& info ) override;
virtual sal_Bool SAL_CALL acceptsURL( const OUString& url ) override;
virtual css::uno::Sequence< css::sdbc::DriverPropertyInfo > SAL_CALL getPropertyInfo( const OUString& url, const css::uno::Sequence< css::beans::PropertyValue >& info ) override;
virtual sal_Int32 SAL_CALL getMajorVersion( ) override;
virtual sal_Int32 SAL_CALL getMinorVersion( ) override;
// XDriver
virtual css::uno::Reference< css::sdbc::XConnection > SAL_CALL connect( const OUString& url, const css::uno::Sequence< css::beans::PropertyValue >& info ) override;
virtual sal_Bool SAL_CALL acceptsURL( const OUString& url ) override;
virtual css::uno::Sequence< css::sdbc::DriverPropertyInfo > SAL_CALL getPropertyInfo( const OUString& url, const css::uno::Sequence< css::beans::PropertyValue >& info ) override;
virtual sal_Int32 SAL_CALL getMajorVersion( ) override;
virtual sal_Int32 SAL_CALL getMinorVersion( ) override;
// XDataDefinitionSupplier
virtual css::uno::Reference< css::sdbcx::XTablesSupplier > SAL_CALL getDataDefinitionByConnection( const css::uno::Reference< css::sdbc::XConnection >& connection ) override;
virtual css::uno::Reference< css::sdbcx::XTablesSupplier > SAL_CALL getDataDefinitionByURL( const OUString& url, const css::uno::Sequence< css::beans::PropertyValue >& info ) override;
};
// XDataDefinitionSupplier
virtual css::uno::Reference< css::sdbcx::XTablesSupplier > SAL_CALL getDataDefinitionByConnection( const css::uno::Reference< css::sdbc::XConnection >& connection ) override;
virtual css::uno::Reference< css::sdbcx::XTablesSupplier > SAL_CALL getDataDefinitionByURL( const OUString& url, const css::uno::Sequence< css::beans::PropertyValue >& info ) override;
};
}
+24 -24
View File
@@ -24,35 +24,35 @@
namespace connectivity::ado
{
typedef sdbcx::OGroup OGroup_ADO;
class OCatalog;
typedef sdbcx::OGroup OGroup_ADO;
class OCatalog;
class OAdoGroup : public OGroup_ADO
{
WpADOGroup m_aGroup;
OCatalog* m_pCatalog;
class OAdoGroup : public OGroup_ADO
{
WpADOGroup m_aGroup;
OCatalog* m_pCatalog;
static sal_Int32 MapRight(RightsEnum _eNum);
static RightsEnum Map2Right(sal_Int32 _eNum);
static ObjectTypeEnum MapObjectType(sal_Int32 ObjType);
protected:
virtual void SAL_CALL getFastPropertyValue(css::uno::Any& rValue,sal_Int32 nHandle) const override;
virtual void SAL_CALL setFastPropertyValue_NoBroadcast(sal_Int32 nHandle,const css::uno::Any& rValue) override;
static sal_Int32 MapRight(RightsEnum _eNum);
static RightsEnum Map2Right(sal_Int32 _eNum);
static ObjectTypeEnum MapObjectType(sal_Int32 ObjType);
protected:
virtual void SAL_CALL getFastPropertyValue(css::uno::Any& rValue,sal_Int32 nHandle) const override;
virtual void SAL_CALL setFastPropertyValue_NoBroadcast(sal_Int32 nHandle,const css::uno::Any& rValue) override;
public:
virtual void refreshUsers() override;
public:
OAdoGroup(OCatalog* _pParent,bool _bCase, ADOGroup* _pGroup=nullptr);
OAdoGroup(OCatalog* _pParent,bool _bCase, const OUString& Name);
public:
virtual void refreshUsers() override;
public:
OAdoGroup(OCatalog* _pParent,bool _bCase, ADOGroup* _pGroup=nullptr);
OAdoGroup(OCatalog* _pParent,bool _bCase, const OUString& Name);
// XAuthorizable
virtual sal_Int32 SAL_CALL getPrivileges( const OUString& objName, sal_Int32 objType ) override;
virtual sal_Int32 SAL_CALL getGrantablePrivileges( const OUString& objName, sal_Int32 objType ) override;
virtual void SAL_CALL grantPrivileges( const OUString& objName, sal_Int32 objType, sal_Int32 objPrivileges ) override;
virtual void SAL_CALL revokePrivileges( const OUString& objName, sal_Int32 objType, sal_Int32 objPrivileges ) override;
// XAuthorizable
virtual sal_Int32 SAL_CALL getPrivileges( const OUString& objName, sal_Int32 objType ) override;
virtual sal_Int32 SAL_CALL getGrantablePrivileges( const OUString& objName, sal_Int32 objType ) override;
virtual void SAL_CALL grantPrivileges( const OUString& objName, sal_Int32 objType, sal_Int32 objPrivileges ) override;
virtual void SAL_CALL revokePrivileges( const OUString& objName, sal_Int32 objType, sal_Int32 objPrivileges ) override;
WpADOGroup getImpl() const { return m_aGroup; }
};
WpADOGroup getImpl() const { return m_aGroup; }
};
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+20 -20
View File
@@ -25,27 +25,27 @@
namespace connectivity::ado
{
class OGroups : public sdbcx::OCollection
{
WpADOGroups m_aCollection;
OCatalog* m_pCatalog;
protected:
class OGroups : public sdbcx::OCollection
{
WpADOGroups m_aCollection;
OCatalog* m_pCatalog;
protected:
virtual css::uno::Reference< css::beans::XPropertySet > createObject(const OUString& _rName) override;
virtual void impl_refresh() override;
virtual css::uno::Reference< css::beans::XPropertySet > createDescriptor() override;
virtual css::uno::Reference< css::beans::XPropertySet > appendObject( const OUString& _rForName, const css::uno::Reference< css::beans::XPropertySet >& descriptor ) override;
virtual void dropObject(sal_Int32 _nPos,const OUString& _sElementName) override;
public:
OGroups(OCatalog* _pParent,
::osl::Mutex& _rMutex,
const ::std::vector< OUString> &_rVector,
const WpADOGroups& _rCollection,bool _bCase) : sdbcx::OCollection(*_pParent,_bCase,_rMutex,_rVector)
,m_aCollection(_rCollection)
,m_pCatalog(_pParent)
{
}
};
virtual css::uno::Reference< css::beans::XPropertySet > createObject(const OUString& _rName) override;
virtual void impl_refresh() override;
virtual css::uno::Reference< css::beans::XPropertySet > createDescriptor() override;
virtual css::uno::Reference< css::beans::XPropertySet > appendObject( const OUString& _rForName, const css::uno::Reference< css::beans::XPropertySet >& descriptor ) override;
virtual void dropObject(sal_Int32 _nPos,const OUString& _sElementName) override;
public:
OGroups(OCatalog* _pParent,
::osl::Mutex& _rMutex,
const ::std::vector< OUString> &_rVector,
const WpADOGroups& _rCollection,bool _bCase) : sdbcx::OCollection(*_pParent,_bCase,_rMutex,_rVector)
,m_aCollection(_rCollection)
,m_pCatalog(_pParent)
{
}
};
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+15 -15
View File
@@ -25,22 +25,22 @@
namespace connectivity::ado
{
class OConnection;
class OAdoIndex : public sdbcx::OIndex
{
WpADOIndex m_aIndex;
OConnection* m_pConnection;
protected:
void fillPropertyValues();
virtual void SAL_CALL setFastPropertyValue_NoBroadcast(sal_Int32 nHandle,const css::uno::Any& rValue) override;
public:
virtual void refreshColumns() override;
public:
OAdoIndex(bool _bCase, OConnection* _pConnection,ADOIndex* _pIndex);
OAdoIndex(bool _bCase, OConnection* _pConnection);
class OConnection;
class OAdoIndex : public sdbcx::OIndex
{
WpADOIndex m_aIndex;
OConnection* m_pConnection;
protected:
void fillPropertyValues();
virtual void SAL_CALL setFastPropertyValue_NoBroadcast(sal_Int32 nHandle,const css::uno::Any& rValue) override;
public:
virtual void refreshColumns() override;
public:
OAdoIndex(bool _bCase, OConnection* _pConnection,ADOIndex* _pIndex);
OAdoIndex(bool _bCase, OConnection* _pConnection);
WpADOIndex getImpl() const { return m_aIndex;}
};
WpADOIndex getImpl() const { return m_aIndex;}
};
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+23 -23
View File
@@ -24,30 +24,30 @@
namespace connectivity::ado
{
class OConnection;
class OIndexes : public sdbcx::OCollection
class OConnection;
class OIndexes : public sdbcx::OCollection
{
WpADOIndexes m_aCollection;
OConnection* m_pConnection;
protected:
virtual css::uno::Reference< css::beans::XPropertySet > createObject(const OUString& _rName) override;
virtual void impl_refresh() override;
virtual css::uno::Reference< css::beans::XPropertySet > createDescriptor() override;
virtual css::uno::Reference< css::beans::XPropertySet > appendObject( const OUString& _rForName, const css::uno::Reference< css::beans::XPropertySet >& descriptor ) override;
virtual void dropObject(sal_Int32 _nPos,const OUString& _sElementName) override;
public:
OIndexes(::cppu::OWeakObject& _rParent,
::osl::Mutex& _rMutex,
const ::std::vector< OUString> &_rVector,
const WpADOIndexes& _rCollection,
bool _bCase,
OConnection* _pConnection)
: sdbcx::OCollection(_rParent,_bCase,_rMutex,_rVector)
, m_aCollection(_rCollection)
, m_pConnection(_pConnection)
{
WpADOIndexes m_aCollection;
OConnection* m_pConnection;
protected:
virtual css::uno::Reference< css::beans::XPropertySet > createObject(const OUString& _rName) override;
virtual void impl_refresh() override;
virtual css::uno::Reference< css::beans::XPropertySet > createDescriptor() override;
virtual css::uno::Reference< css::beans::XPropertySet > appendObject( const OUString& _rForName, const css::uno::Reference< css::beans::XPropertySet >& descriptor ) override;
virtual void dropObject(sal_Int32 _nPos,const OUString& _sElementName) override;
public:
OIndexes(::cppu::OWeakObject& _rParent,
::osl::Mutex& _rMutex,
const ::std::vector< OUString> &_rVector,
const WpADOIndexes& _rCollection,
bool _bCase,
OConnection* _pConnection)
: sdbcx::OCollection(_rParent,_bCase,_rMutex,_rVector)
, m_aCollection(_rCollection)
, m_pConnection(_pConnection)
{
}
};
}
};
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+22 -22
View File
@@ -25,31 +25,31 @@
namespace connectivity::ado
{
typedef sdbcx::OKey OKey_ADO;
typedef sdbcx::OKey OKey_ADO;
class OConnection;
class OAdoKey : public OKey_ADO
{
WpADOKey m_aKey;
OConnection* m_pConnection;
protected:
void fillPropertyValues();
virtual void SAL_CALL setFastPropertyValue_NoBroadcast(sal_Int32 nHandle,const css::uno::Any& rValue) override;
public:
virtual void refreshColumns() override;
public:
OAdoKey(bool _bCase,OConnection* _pConnection,ADOKey* _pKey);
OAdoKey(bool _bCase,OConnection* _pConnection);
class OConnection;
class OAdoKey : public OKey_ADO
{
WpADOKey m_aKey;
OConnection* m_pConnection;
protected:
void fillPropertyValues();
virtual void SAL_CALL setFastPropertyValue_NoBroadcast(sal_Int32 nHandle,const css::uno::Any& rValue) override;
public:
virtual void refreshColumns() override;
public:
OAdoKey(bool _bCase,OConnection* _pConnection,ADOKey* _pKey);
OAdoKey(bool _bCase,OConnection* _pConnection);
WpADOKey getImpl() const { return m_aKey;}
// map the update/delete rules
static RuleEnum Map2Rule(sal_Int32 _eNum);
static sal_Int32 MapRule(const RuleEnum& _eNum);
WpADOKey getImpl() const { return m_aKey;}
// map the update/delete rules
static RuleEnum Map2Rule(sal_Int32 _eNum);
static sal_Int32 MapRule(const RuleEnum& _eNum);
// map the keytypes
static sal_Int32 MapKeyRule(const KeyTypeEnum& _eNum);
static KeyTypeEnum Map2KeyRule(sal_Int32 _eNum);
};
// map the keytypes
static sal_Int32 MapKeyRule(const KeyTypeEnum& _eNum);
static KeyTypeEnum Map2KeyRule(sal_Int32 _eNum);
};
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+23 -23
View File
@@ -24,30 +24,30 @@
namespace connectivity::ado
{
class OConnection;
class OKeys : public sdbcx::OCollection
{
WpADOKeys m_aCollection;
OConnection* m_pConnection;
class OConnection;
class OKeys : public sdbcx::OCollection
{
WpADOKeys m_aCollection;
OConnection* m_pConnection;
protected:
virtual css::uno::Reference< css::beans::XPropertySet > createObject(const OUString& _rName) override;
virtual void impl_refresh() override;
virtual css::uno::Reference< css::beans::XPropertySet > createDescriptor() override;
virtual css::uno::Reference< css::beans::XPropertySet > appendObject( const OUString& _rForName, const css::uno::Reference< css::beans::XPropertySet >& descriptor ) override;
virtual void dropObject(sal_Int32 _nPos,const OUString& _sElementName) override;
public:
OKeys(::cppu::OWeakObject& _rParent,
::osl::Mutex& _rMutex,
const ::std::vector< OUString> &_rVector,
const WpADOKeys& _rCollection,
bool _bCase,
OConnection* _pConnection) : sdbcx::OCollection(_rParent,_bCase,_rMutex,_rVector)
,m_aCollection(_rCollection)
,m_pConnection(_pConnection)
{
}
};
protected:
virtual css::uno::Reference< css::beans::XPropertySet > createObject(const OUString& _rName) override;
virtual void impl_refresh() override;
virtual css::uno::Reference< css::beans::XPropertySet > createDescriptor() override;
virtual css::uno::Reference< css::beans::XPropertySet > appendObject( const OUString& _rForName, const css::uno::Reference< css::beans::XPropertySet >& descriptor ) override;
virtual void dropObject(sal_Int32 _nPos,const OUString& _sElementName) override;
public:
OKeys(::cppu::OWeakObject& _rParent,
::osl::Mutex& _rMutex,
const ::std::vector< OUString> &_rVector,
const WpADOKeys& _rCollection,
bool _bCase,
OConnection* _pConnection) : sdbcx::OCollection(_rParent,_bCase,_rMutex,_rVector)
,m_aCollection(_rCollection)
,m_pConnection(_pConnection)
{
}
};
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+178 -178
View File
@@ -38,195 +38,195 @@
namespace connectivity::ado
{
/*
** java_sql_ResultSet
*/
typedef ::cppu::WeakComponentImplHelper< css::sdbc::XResultSet,
css::sdbc::XRow,
css::sdbc::XResultSetMetaDataSupplier,
css::util::XCancellable,
css::sdbc::XWarningsSupplier,
css::sdbc::XResultSetUpdate,
css::sdbc::XRowUpdate,
css::sdbc::XCloseable,
css::sdbc::XColumnLocate,
css::sdbcx::XRowLocate,
css::sdbcx::XDeleteRows,
css::lang::XServiceInfo> OResultSet_BASE;
/*
** java_sql_ResultSet
*/
typedef ::cppu::WeakComponentImplHelper< css::sdbc::XResultSet,
css::sdbc::XRow,
css::sdbc::XResultSetMetaDataSupplier,
css::util::XCancellable,
css::sdbc::XWarningsSupplier,
css::sdbc::XResultSetUpdate,
css::sdbc::XRowUpdate,
css::sdbc::XCloseable,
css::sdbc::XColumnLocate,
css::sdbcx::XRowLocate,
css::sdbcx::XDeleteRows,
css::lang::XServiceInfo> OResultSet_BASE;
class OResultSet : public cppu::BaseMutex,
public OResultSet_BASE,
public ::cppu::OPropertySetHelper,
public ::comphelper::OPropertyArrayUsageHelper<OResultSet>
{
class OResultSet : public cppu::BaseMutex,
public OResultSet_BASE,
public ::cppu::OPropertySetHelper,
public ::comphelper::OPropertyArrayUsageHelper<OResultSet>
{
ADORecordset* m_pRecordSet;
OStatement_Base* m_pStmt;
css::uno::Reference< css::uno::XInterface> m_xStatement;
css::uno::Reference< css::sdbc::XResultSetMetaData> m_xMetaData;
std::vector<OLEVariant> m_aBookmarks;
OLEVariant m_aValue;
long m_nRowPos;
bool m_bEOF;
bool m_bOnFirstAfterOpen;
ADORecordset* m_pRecordSet;
OStatement_Base* m_pStmt;
css::uno::Reference< css::uno::XInterface> m_xStatement;
css::uno::Reference< css::sdbc::XResultSetMetaData> m_xMetaData;
std::vector<OLEVariant> m_aBookmarks;
OLEVariant m_aValue;
long m_nRowPos;
bool m_bEOF;
bool m_bOnFirstAfterOpen;
/// @throws css::sdbc::SQLException
/// @throws css::uno::RuntimeException
sal_Int32 getResultSetConcurrency() const;
/// @throws css::sdbc::SQLException
/// @throws css::uno::RuntimeException
sal_Int32 getResultSetType() const;
/// @throws css::sdbc::SQLException
/// @throws css::uno::RuntimeException
static sal_Int32 getFetchDirection();
/// @throws css::sdbc::SQLException
/// @throws css::uno::RuntimeException
sal_Int32 getFetchSize() const;
/// @throws css::sdbc::SQLException
/// @throws css::uno::RuntimeException
static OUString getCursorName();
/// @throws css::sdbc::SQLException
/// @throws css::uno::RuntimeException
sal_Int32 getResultSetConcurrency() const;
/// @throws css::sdbc::SQLException
/// @throws css::uno::RuntimeException
sal_Int32 getResultSetType() const;
/// @throws css::sdbc::SQLException
/// @throws css::uno::RuntimeException
static sal_Int32 getFetchDirection();
/// @throws css::sdbc::SQLException
/// @throws css::uno::RuntimeException
sal_Int32 getFetchSize() const;
/// @throws css::sdbc::SQLException
/// @throws css::uno::RuntimeException
static OUString getCursorName();
/// @throws css::sdbc::SQLException
/// @throws css::uno::RuntimeException
void setFetchDirection(sal_Int32 _par0);
/// @throws css::sdbc::SQLException
/// @throws css::uno::RuntimeException
void setFetchSize(sal_Int32 _par0);
void updateValue(sal_Int32 columnIndex,const OLEVariant& x);
/// @throws css::sdbc::SQLException
/// @throws css::uno::RuntimeException
OLEVariant getValue(sal_Int32 columnIndex );
/// @throws css::sdbc::SQLException
/// @throws css::uno::RuntimeException
void setFetchDirection(sal_Int32 _par0);
/// @throws css::sdbc::SQLException
/// @throws css::uno::RuntimeException
void setFetchSize(sal_Int32 _par0);
void updateValue(sal_Int32 columnIndex,const OLEVariant& x);
/// @throws css::sdbc::SQLException
/// @throws css::uno::RuntimeException
OLEVariant getValue(sal_Int32 columnIndex );
protected:
protected:
// OPropertyArrayUsageHelper
virtual ::cppu::IPropertyArrayHelper* createArrayHelper( ) const override;
// OPropertySetHelper
virtual ::cppu::IPropertyArrayHelper & SAL_CALL getInfoHelper() override;
virtual sal_Bool SAL_CALL convertFastPropertyValue(
css::uno::Any & rConvertedValue,
css::uno::Any & rOldValue,
// OPropertyArrayUsageHelper
virtual ::cppu::IPropertyArrayHelper* createArrayHelper( ) const override;
// OPropertySetHelper
virtual ::cppu::IPropertyArrayHelper & SAL_CALL getInfoHelper() override;
virtual sal_Bool SAL_CALL convertFastPropertyValue(
css::uno::Any & rConvertedValue,
css::uno::Any & rOldValue,
sal_Int32 nHandle,
const css::uno::Any& rValue ) override;
virtual void SAL_CALL setFastPropertyValue_NoBroadcast(
sal_Int32 nHandle,
const css::uno::Any& rValue ) override;
virtual void SAL_CALL setFastPropertyValue_NoBroadcast(
sal_Int32 nHandle,
const css::uno::Any& rValue
) override;
virtual void SAL_CALL getFastPropertyValue(
css::uno::Any& rValue,
sal_Int32 nHandle
) const override;
virtual ~OResultSet() override;
public:
// a Constructor, that is needed for when Returning the Object is needed:
OResultSet( ADORecordset* _pRecordSet,OStatement_Base* pStmt);
OResultSet( ADORecordset* _pRecordSet);
const css::uno::Any& rValue
) override;
virtual void SAL_CALL getFastPropertyValue(
css::uno::Any& rValue,
sal_Int32 nHandle
) const override;
virtual ~OResultSet() override;
public:
// a Constructor, that is needed for when Returning the Object is needed:
OResultSet( ADORecordset* _pRecordSet,OStatement_Base* pStmt);
OResultSet( ADORecordset* _pRecordSet);
// late constructor
void construct();
void setMetaData(const css::uno::Reference< css::sdbc::XResultSetMetaData>& _xMetaData) { m_xMetaData = _xMetaData;}
// late constructor
void construct();
void setMetaData(const css::uno::Reference< css::sdbc::XResultSetMetaData>& _xMetaData) { m_xMetaData = _xMetaData;}
virtual OUString SAL_CALL getImplementationName( ) override;
virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) override;
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames( ) override;
virtual OUString SAL_CALL getImplementationName( ) override;
virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) override;
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames( ) override;
// ::cppu::OComponentHelper
virtual void SAL_CALL disposing() override;
// XInterface
virtual css::uno::Any SAL_CALL queryInterface( const css::uno::Type & rType ) override;
virtual void SAL_CALL acquire() noexcept override;
virtual void SAL_CALL release() noexcept override;
//XTypeProvider
virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes( ) override;
// XPropertySet
virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) override;
// XResultSet
virtual sal_Bool SAL_CALL next( ) override;
virtual sal_Bool SAL_CALL isBeforeFirst( ) override;
virtual sal_Bool SAL_CALL isAfterLast( ) override;
virtual sal_Bool SAL_CALL isFirst( ) override;
virtual sal_Bool SAL_CALL isLast( ) override;
virtual void SAL_CALL beforeFirst( ) override;
virtual void SAL_CALL afterLast( ) override;
virtual sal_Bool SAL_CALL first( ) override;
virtual sal_Bool SAL_CALL last( ) override;
virtual sal_Int32 SAL_CALL getRow( ) override;
virtual sal_Bool SAL_CALL absolute( sal_Int32 row ) override;
virtual sal_Bool SAL_CALL relative( sal_Int32 rows ) override;
virtual sal_Bool SAL_CALL previous( ) override;
virtual void SAL_CALL refreshRow( ) override;
virtual sal_Bool SAL_CALL rowUpdated( ) override;
virtual sal_Bool SAL_CALL rowInserted( ) override;
virtual sal_Bool SAL_CALL rowDeleted( ) override;
virtual css::uno::Reference< css::uno::XInterface > SAL_CALL getStatement( ) override;
// XRow
virtual sal_Bool SAL_CALL wasNull( ) override;
virtual OUString SAL_CALL getString( sal_Int32 columnIndex ) override;
virtual sal_Bool SAL_CALL getBoolean( sal_Int32 columnIndex ) override;
virtual sal_Int8 SAL_CALL getByte( sal_Int32 columnIndex ) override;
virtual sal_Int16 SAL_CALL getShort( sal_Int32 columnIndex ) override;
virtual sal_Int32 SAL_CALL getInt( sal_Int32 columnIndex ) override;
virtual sal_Int64 SAL_CALL getLong( sal_Int32 columnIndex ) override;
virtual float SAL_CALL getFloat( sal_Int32 columnIndex ) override;
virtual double SAL_CALL getDouble( sal_Int32 columnIndex ) override;
virtual css::uno::Sequence< sal_Int8 > SAL_CALL getBytes( sal_Int32 columnIndex ) override;
virtual css::util::Date SAL_CALL getDate( sal_Int32 columnIndex ) override;
virtual css::util::Time SAL_CALL getTime( sal_Int32 columnIndex ) override;
virtual css::util::DateTime SAL_CALL getTimestamp( sal_Int32 columnIndex ) override;
virtual css::uno::Reference< css::io::XInputStream > SAL_CALL getBinaryStream( sal_Int32 columnIndex ) override;
virtual css::uno::Reference< css::io::XInputStream > SAL_CALL getCharacterStream( sal_Int32 columnIndex ) override;
virtual css::uno::Any SAL_CALL getObject( sal_Int32 columnIndex, const css::uno::Reference< css::container::XNameAccess >& typeMap ) override;
virtual css::uno::Reference< css::sdbc::XRef > SAL_CALL getRef( sal_Int32 columnIndex ) override;
virtual css::uno::Reference< css::sdbc::XBlob > SAL_CALL getBlob( sal_Int32 columnIndex ) override;
virtual css::uno::Reference< css::sdbc::XClob > SAL_CALL getClob( sal_Int32 columnIndex ) override;
virtual css::uno::Reference< css::sdbc::XArray > SAL_CALL getArray( sal_Int32 columnIndex ) override;
// XResultSetMetaDataSupplier
virtual css::uno::Reference< css::sdbc::XResultSetMetaData > SAL_CALL getMetaData( ) override;
// XCancellable
virtual void SAL_CALL cancel( ) override;
// XCloseable
virtual void SAL_CALL close( ) override;
// XWarningsSupplier
virtual css::uno::Any SAL_CALL getWarnings( ) override;
virtual void SAL_CALL clearWarnings( ) override;
// XResultSetUpdate
virtual void SAL_CALL insertRow( ) override;
virtual void SAL_CALL updateRow( ) override;
virtual void SAL_CALL deleteRow( ) override;
virtual void SAL_CALL cancelRowUpdates( ) override;
virtual void SAL_CALL moveToInsertRow( ) override;
virtual void SAL_CALL moveToCurrentRow( ) override;
// XRowUpdate
virtual void SAL_CALL updateNull( sal_Int32 columnIndex ) override;
virtual void SAL_CALL updateBoolean( sal_Int32 columnIndex, sal_Bool x ) override;
virtual void SAL_CALL updateByte( sal_Int32 columnIndex, sal_Int8 x ) override;
virtual void SAL_CALL updateShort( sal_Int32 columnIndex, sal_Int16 x ) override;
virtual void SAL_CALL updateInt( sal_Int32 columnIndex, sal_Int32 x ) override;
virtual void SAL_CALL updateLong( sal_Int32 columnIndex, sal_Int64 x ) override;
virtual void SAL_CALL updateFloat( sal_Int32 columnIndex, float x ) override;
virtual void SAL_CALL updateDouble( sal_Int32 columnIndex, double x ) override;
virtual void SAL_CALL updateString( sal_Int32 columnIndex, const OUString& x ) override;
virtual void SAL_CALL updateBytes( sal_Int32 columnIndex, const css::uno::Sequence< sal_Int8 >& x ) override;
virtual void SAL_CALL updateDate( sal_Int32 columnIndex, const css::util::Date& x ) override;
virtual void SAL_CALL updateTime( sal_Int32 columnIndex, const css::util::Time& x ) override;
virtual void SAL_CALL updateTimestamp( sal_Int32 columnIndex, const css::util::DateTime& x ) override;
virtual void SAL_CALL updateBinaryStream( sal_Int32 columnIndex, const css::uno::Reference< css::io::XInputStream >& x, sal_Int32 length ) override;
virtual void SAL_CALL updateCharacterStream( sal_Int32 columnIndex, const css::uno::Reference< css::io::XInputStream >& x, sal_Int32 length ) override;
virtual void SAL_CALL updateObject( sal_Int32 columnIndex, const css::uno::Any& x ) override;
virtual void SAL_CALL updateNumericObject( sal_Int32 columnIndex, const css::uno::Any& x, sal_Int32 scale ) override;
// XColumnLocate
virtual sal_Int32 SAL_CALL findColumn( const OUString& columnName ) override;
// XRowLocate
virtual css::uno::Any SAL_CALL getBookmark( ) override;
virtual sal_Bool SAL_CALL moveToBookmark( const css::uno::Any& bookmark ) override;
virtual sal_Bool SAL_CALL moveRelativeToBookmark( const css::uno::Any& bookmark, sal_Int32 rows ) override;
virtual sal_Int32 SAL_CALL compareBookmarks( const css::uno::Any& first, const css::uno::Any& second ) override;
virtual sal_Bool SAL_CALL hasOrderedBookmarks( ) override;
virtual sal_Int32 SAL_CALL hashBookmark( const css::uno::Any& bookmark ) override;
// XDeleteRows
virtual css::uno::Sequence< sal_Int32 > SAL_CALL deleteRows( const css::uno::Sequence< css::uno::Any >& rows ) override;
// ::cppu::OComponentHelper
virtual void SAL_CALL disposing() override;
// XInterface
virtual css::uno::Any SAL_CALL queryInterface( const css::uno::Type & rType ) override;
virtual void SAL_CALL acquire() noexcept override;
virtual void SAL_CALL release() noexcept override;
//XTypeProvider
virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes( ) override;
// XPropertySet
virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) override;
// XResultSet
virtual sal_Bool SAL_CALL next( ) override;
virtual sal_Bool SAL_CALL isBeforeFirst( ) override;
virtual sal_Bool SAL_CALL isAfterLast( ) override;
virtual sal_Bool SAL_CALL isFirst( ) override;
virtual sal_Bool SAL_CALL isLast( ) override;
virtual void SAL_CALL beforeFirst( ) override;
virtual void SAL_CALL afterLast( ) override;
virtual sal_Bool SAL_CALL first( ) override;
virtual sal_Bool SAL_CALL last( ) override;
virtual sal_Int32 SAL_CALL getRow( ) override;
virtual sal_Bool SAL_CALL absolute( sal_Int32 row ) override;
virtual sal_Bool SAL_CALL relative( sal_Int32 rows ) override;
virtual sal_Bool SAL_CALL previous( ) override;
virtual void SAL_CALL refreshRow( ) override;
virtual sal_Bool SAL_CALL rowUpdated( ) override;
virtual sal_Bool SAL_CALL rowInserted( ) override;
virtual sal_Bool SAL_CALL rowDeleted( ) override;
virtual css::uno::Reference< css::uno::XInterface > SAL_CALL getStatement( ) override;
// XRow
virtual sal_Bool SAL_CALL wasNull( ) override;
virtual OUString SAL_CALL getString( sal_Int32 columnIndex ) override;
virtual sal_Bool SAL_CALL getBoolean( sal_Int32 columnIndex ) override;
virtual sal_Int8 SAL_CALL getByte( sal_Int32 columnIndex ) override;
virtual sal_Int16 SAL_CALL getShort( sal_Int32 columnIndex ) override;
virtual sal_Int32 SAL_CALL getInt( sal_Int32 columnIndex ) override;
virtual sal_Int64 SAL_CALL getLong( sal_Int32 columnIndex ) override;
virtual float SAL_CALL getFloat( sal_Int32 columnIndex ) override;
virtual double SAL_CALL getDouble( sal_Int32 columnIndex ) override;
virtual css::uno::Sequence< sal_Int8 > SAL_CALL getBytes( sal_Int32 columnIndex ) override;
virtual css::util::Date SAL_CALL getDate( sal_Int32 columnIndex ) override;
virtual css::util::Time SAL_CALL getTime( sal_Int32 columnIndex ) override;
virtual css::util::DateTime SAL_CALL getTimestamp( sal_Int32 columnIndex ) override;
virtual css::uno::Reference< css::io::XInputStream > SAL_CALL getBinaryStream( sal_Int32 columnIndex ) override;
virtual css::uno::Reference< css::io::XInputStream > SAL_CALL getCharacterStream( sal_Int32 columnIndex ) override;
virtual css::uno::Any SAL_CALL getObject( sal_Int32 columnIndex, const css::uno::Reference< css::container::XNameAccess >& typeMap ) override;
virtual css::uno::Reference< css::sdbc::XRef > SAL_CALL getRef( sal_Int32 columnIndex ) override;
virtual css::uno::Reference< css::sdbc::XBlob > SAL_CALL getBlob( sal_Int32 columnIndex ) override;
virtual css::uno::Reference< css::sdbc::XClob > SAL_CALL getClob( sal_Int32 columnIndex ) override;
virtual css::uno::Reference< css::sdbc::XArray > SAL_CALL getArray( sal_Int32 columnIndex ) override;
// XResultSetMetaDataSupplier
virtual css::uno::Reference< css::sdbc::XResultSetMetaData > SAL_CALL getMetaData( ) override;
// XCancellable
virtual void SAL_CALL cancel( ) override;
// XCloseable
virtual void SAL_CALL close( ) override;
// XWarningsSupplier
virtual css::uno::Any SAL_CALL getWarnings( ) override;
virtual void SAL_CALL clearWarnings( ) override;
// XResultSetUpdate
virtual void SAL_CALL insertRow( ) override;
virtual void SAL_CALL updateRow( ) override;
virtual void SAL_CALL deleteRow( ) override;
virtual void SAL_CALL cancelRowUpdates( ) override;
virtual void SAL_CALL moveToInsertRow( ) override;
virtual void SAL_CALL moveToCurrentRow( ) override;
// XRowUpdate
virtual void SAL_CALL updateNull( sal_Int32 columnIndex ) override;
virtual void SAL_CALL updateBoolean( sal_Int32 columnIndex, sal_Bool x ) override;
virtual void SAL_CALL updateByte( sal_Int32 columnIndex, sal_Int8 x ) override;
virtual void SAL_CALL updateShort( sal_Int32 columnIndex, sal_Int16 x ) override;
virtual void SAL_CALL updateInt( sal_Int32 columnIndex, sal_Int32 x ) override;
virtual void SAL_CALL updateLong( sal_Int32 columnIndex, sal_Int64 x ) override;
virtual void SAL_CALL updateFloat( sal_Int32 columnIndex, float x ) override;
virtual void SAL_CALL updateDouble( sal_Int32 columnIndex, double x ) override;
virtual void SAL_CALL updateString( sal_Int32 columnIndex, const OUString& x ) override;
virtual void SAL_CALL updateBytes( sal_Int32 columnIndex, const css::uno::Sequence< sal_Int8 >& x ) override;
virtual void SAL_CALL updateDate( sal_Int32 columnIndex, const css::util::Date& x ) override;
virtual void SAL_CALL updateTime( sal_Int32 columnIndex, const css::util::Time& x ) override;
virtual void SAL_CALL updateTimestamp( sal_Int32 columnIndex, const css::util::DateTime& x ) override;
virtual void SAL_CALL updateBinaryStream( sal_Int32 columnIndex, const css::uno::Reference< css::io::XInputStream >& x, sal_Int32 length ) override;
virtual void SAL_CALL updateCharacterStream( sal_Int32 columnIndex, const css::uno::Reference< css::io::XInputStream >& x, sal_Int32 length ) override;
virtual void SAL_CALL updateObject( sal_Int32 columnIndex, const css::uno::Any& x ) override;
virtual void SAL_CALL updateNumericObject( sal_Int32 columnIndex, const css::uno::Any& x, sal_Int32 scale ) override;
// XColumnLocate
virtual sal_Int32 SAL_CALL findColumn( const OUString& columnName ) override;
// XRowLocate
virtual css::uno::Any SAL_CALL getBookmark( ) override;
virtual sal_Bool SAL_CALL moveToBookmark( const css::uno::Any& bookmark ) override;
virtual sal_Bool SAL_CALL moveRelativeToBookmark( const css::uno::Any& bookmark, sal_Int32 rows ) override;
virtual sal_Int32 SAL_CALL compareBookmarks( const css::uno::Any& first, const css::uno::Any& second ) override;
virtual sal_Bool SAL_CALL hasOrderedBookmarks( ) override;
virtual sal_Int32 SAL_CALL hashBookmark( const css::uno::Any& bookmark ) override;
// XDeleteRows
virtual css::uno::Sequence< sal_Int32 > SAL_CALL deleteRows( const css::uno::Sequence< css::uno::Any >& rows ) override;
};
};
}
@@ -30,50 +30,50 @@ namespace connectivity::ado
{
//************ Class: ResultSetMetaData
//************ Class: ResultSetMetaData
typedef ::cppu::WeakImplHelper<css::sdbc::XResultSetMetaData> OResultSetMetaData_BASE;
typedef ::cppu::WeakImplHelper<css::sdbc::XResultSetMetaData> OResultSetMetaData_BASE;
class OResultSetMetaData : public OResultSetMetaData_BASE
{
friend class OResultSet;
class OResultSetMetaData : public OResultSetMetaData_BASE
{
friend class OResultSet;
ADORecordset* m_pRecordSet;
sal_Int32 m_nColCount;
ADORecordset* m_pRecordSet;
sal_Int32 m_nColCount;
sal_Int32 MapADOType2Jdbc(DataTypeEnum eType);
private:
OResultSetMetaData( const OResultSetMetaData& ); // never implemented
OResultSetMetaData& operator=( const OResultSetMetaData& ); // never implemented
sal_Int32 MapADOType2Jdbc(DataTypeEnum eType);
private:
OResultSetMetaData( const OResultSetMetaData& ); // never implemented
OResultSetMetaData& operator=( const OResultSetMetaData& ); // never implemented
protected:
virtual ~OResultSetMetaData() override;
public:
// a Constructor, that is needed for when Returning the Object is needed:
OResultSetMetaData( ADORecordset* _pRecordSet);
protected:
virtual ~OResultSetMetaData() override;
public:
// a Constructor, that is needed for when Returning the Object is needed:
OResultSetMetaData( ADORecordset* _pRecordSet);
virtual sal_Int32 SAL_CALL getColumnCount( ) override;
virtual sal_Bool SAL_CALL isAutoIncrement( sal_Int32 column ) override;
virtual sal_Bool SAL_CALL isCaseSensitive( sal_Int32 column ) override;
virtual sal_Bool SAL_CALL isSearchable( sal_Int32 column ) override;
virtual sal_Bool SAL_CALL isCurrency( sal_Int32 column ) override;
virtual sal_Int32 SAL_CALL isNullable( sal_Int32 column ) override;
virtual sal_Bool SAL_CALL isSigned( sal_Int32 column ) override;
virtual sal_Int32 SAL_CALL getColumnDisplaySize( sal_Int32 column ) override;
virtual OUString SAL_CALL getColumnLabel( sal_Int32 column ) override;
virtual OUString SAL_CALL getColumnName( sal_Int32 column ) override;
virtual OUString SAL_CALL getSchemaName( sal_Int32 column ) override;
virtual sal_Int32 SAL_CALL getPrecision( sal_Int32 column ) override;
virtual sal_Int32 SAL_CALL getScale( sal_Int32 column ) override;
virtual OUString SAL_CALL getTableName( sal_Int32 column ) override;
virtual OUString SAL_CALL getCatalogName( sal_Int32 column ) override;
virtual sal_Int32 SAL_CALL getColumnType( sal_Int32 column ) override;
virtual OUString SAL_CALL getColumnTypeName( sal_Int32 column ) override;
virtual sal_Bool SAL_CALL isReadOnly( sal_Int32 column ) override;
virtual sal_Bool SAL_CALL isWritable( sal_Int32 column ) override;
virtual sal_Bool SAL_CALL isDefinitelyWritable( sal_Int32 column ) override;
virtual OUString SAL_CALL getColumnServiceName( sal_Int32 column ) override;
};
virtual sal_Int32 SAL_CALL getColumnCount( ) override;
virtual sal_Bool SAL_CALL isAutoIncrement( sal_Int32 column ) override;
virtual sal_Bool SAL_CALL isCaseSensitive( sal_Int32 column ) override;
virtual sal_Bool SAL_CALL isSearchable( sal_Int32 column ) override;
virtual sal_Bool SAL_CALL isCurrency( sal_Int32 column ) override;
virtual sal_Int32 SAL_CALL isNullable( sal_Int32 column ) override;
virtual sal_Bool SAL_CALL isSigned( sal_Int32 column ) override;
virtual sal_Int32 SAL_CALL getColumnDisplaySize( sal_Int32 column ) override;
virtual OUString SAL_CALL getColumnLabel( sal_Int32 column ) override;
virtual OUString SAL_CALL getColumnName( sal_Int32 column ) override;
virtual OUString SAL_CALL getSchemaName( sal_Int32 column ) override;
virtual sal_Int32 SAL_CALL getPrecision( sal_Int32 column ) override;
virtual sal_Int32 SAL_CALL getScale( sal_Int32 column ) override;
virtual OUString SAL_CALL getTableName( sal_Int32 column ) override;
virtual OUString SAL_CALL getCatalogName( sal_Int32 column ) override;
virtual sal_Int32 SAL_CALL getColumnType( sal_Int32 column ) override;
virtual OUString SAL_CALL getColumnTypeName( sal_Int32 column ) override;
virtual sal_Bool SAL_CALL isReadOnly( sal_Int32 column ) override;
virtual sal_Bool SAL_CALL isWritable( sal_Int32 column ) override;
virtual sal_Bool SAL_CALL isDefinitelyWritable( sal_Int32 column ) override;
virtual OUString SAL_CALL getColumnServiceName( sal_Int32 column ) override;
};
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+154 -154
View File
@@ -38,181 +38,181 @@
namespace connectivity::ado
{
typedef ::cppu::WeakComponentImplHelper< css::sdbc::XStatement,
css::sdbc::XWarningsSupplier,
css::util::XCancellable,
css::sdbc::XCloseable,
css::sdbc::XMultipleResults> OStatement_BASE;
typedef ::cppu::WeakComponentImplHelper< css::sdbc::XStatement,
css::sdbc::XWarningsSupplier,
css::util::XCancellable,
css::sdbc::XCloseable,
css::sdbc::XMultipleResults> OStatement_BASE;
//************ Class: java.sql.Statement
//************ Class: java.sql.Statement
class OStatement_Base : public cppu::BaseMutex,
public OStatement_BASE,
public ::cppu::OPropertySetHelper,
public ::comphelper::OPropertyArrayUsageHelper<OStatement_Base>
class OStatement_Base : public cppu::BaseMutex,
public OStatement_BASE,
public ::cppu::OPropertySetHelper,
public ::comphelper::OPropertyArrayUsageHelper<OStatement_Base>
{
friend class OResultSet;
{
friend class OResultSet;
css::sdbc::SQLWarning m_aLastWarning;
css::sdbc::SQLWarning m_aLastWarning;
protected:
std::vector< OUString> m_aBatchVector;
protected:
std::vector< OUString> m_aBatchVector;
unotools::WeakReference<OResultSet> m_xResultSet; // The last ResultSet created
// for this Statement
unotools::WeakReference<OResultSet> m_xResultSet; // The last ResultSet created
// for this Statement
OConnection* m_pConnection;// The owning Connection object
WpADOCommand m_Command;
WpADORecordset m_RecordSet;
OLEVariant m_RecordsAffected;
OLEVariant m_Parameters;
std::vector<connectivity::OTypeInfo> m_aTypeInfo; // Hashtable containing an entry
// for each row returned by
// DatabaseMetaData.getTypeInfo.
long m_nMaxRows;
sal_Int32 m_nFetchSize;
LockTypeEnum m_eLockType;
CursorTypeEnum m_eCursorType;
OConnection* m_pConnection;// The owning Connection object
WpADOCommand m_Command;
WpADORecordset m_RecordSet;
OLEVariant m_RecordsAffected;
OLEVariant m_Parameters;
std::vector<connectivity::OTypeInfo> m_aTypeInfo; // Hashtable containing an entry
// for each row returned by
// DatabaseMetaData.getTypeInfo.
long m_nMaxRows;
sal_Int32 m_nFetchSize;
LockTypeEnum m_eLockType;
CursorTypeEnum m_eCursorType;
using OStatement_BASE::rBHelper;
private:
/// @throws css::sdbc::SQLException
/// @throws css::uno::RuntimeException
sal_Int32 getQueryTimeOut() const;
/// @throws css::sdbc::SQLException
/// @throws css::uno::RuntimeException
static sal_Int32 getMaxFieldSize();
/// @throws css::sdbc::SQLException
/// @throws css::uno::RuntimeException
sal_Int32 getMaxRows() const;
/// @throws css::sdbc::SQLException
/// @throws css::uno::RuntimeException
sal_Int32 getResultSetConcurrency() const;
/// @throws css::sdbc::SQLException
/// @throws css::uno::RuntimeException
sal_Int32 getResultSetType() const;
/// @throws css::sdbc::SQLException
/// @throws css::uno::RuntimeException
static sal_Int32 getFetchDirection();
/// @throws css::sdbc::SQLException
/// @throws css::uno::RuntimeException
sal_Int32 getFetchSize() const;
/// @throws css::sdbc::SQLException
/// @throws css::uno::RuntimeException
OUString getCursorName() const;
using OStatement_BASE::rBHelper;
private:
/// @throws css::sdbc::SQLException
/// @throws css::uno::RuntimeException
sal_Int32 getQueryTimeOut() const;
/// @throws css::sdbc::SQLException
/// @throws css::uno::RuntimeException
static sal_Int32 getMaxFieldSize();
/// @throws css::sdbc::SQLException
/// @throws css::uno::RuntimeException
sal_Int32 getMaxRows() const;
/// @throws css::sdbc::SQLException
/// @throws css::uno::RuntimeException
sal_Int32 getResultSetConcurrency() const;
/// @throws css::sdbc::SQLException
/// @throws css::uno::RuntimeException
sal_Int32 getResultSetType() const;
/// @throws css::sdbc::SQLException
/// @throws css::uno::RuntimeException
static sal_Int32 getFetchDirection();
/// @throws css::sdbc::SQLException
/// @throws css::uno::RuntimeException
sal_Int32 getFetchSize() const;
/// @throws css::sdbc::SQLException
/// @throws css::uno::RuntimeException
OUString getCursorName() const;
/// @throws css::sdbc::SQLException
/// @throws css::uno::RuntimeException
void setQueryTimeOut(sal_Int32 _par0);
/// @throws css::sdbc::SQLException
/// @throws css::uno::RuntimeException
void setMaxFieldSize(sal_Int32 _par0);
/// @throws css::sdbc::SQLException
/// @throws css::uno::RuntimeException
void setMaxRows(sal_Int32 _par0);
/// @throws css::sdbc::SQLException
/// @throws css::uno::RuntimeException
void setResultSetConcurrency(sal_Int32 _par0);
/// @throws css::sdbc::SQLException
/// @throws css::uno::RuntimeException
void setResultSetType(sal_Int32 _par0);
/// @throws css::sdbc::SQLException
/// @throws css::uno::RuntimeException
void setFetchDirection(sal_Int32 _par0);
/// @throws css::sdbc::SQLException
/// @throws css::uno::RuntimeException
void setFetchSize(sal_Int32 _par0);
/// @throws css::sdbc::SQLException
/// @throws css::uno::RuntimeException
void setCursorName(std::u16string_view _par0);
/// @throws css::sdbc::SQLException
/// @throws css::uno::RuntimeException
void setQueryTimeOut(sal_Int32 _par0);
/// @throws css::sdbc::SQLException
/// @throws css::uno::RuntimeException
void setMaxFieldSize(sal_Int32 _par0);
/// @throws css::sdbc::SQLException
/// @throws css::uno::RuntimeException
void setMaxRows(sal_Int32 _par0);
/// @throws css::sdbc::SQLException
/// @throws css::uno::RuntimeException
void setResultSetConcurrency(sal_Int32 _par0);
/// @throws css::sdbc::SQLException
/// @throws css::uno::RuntimeException
void setResultSetType(sal_Int32 _par0);
/// @throws css::sdbc::SQLException
/// @throws css::uno::RuntimeException
void setFetchDirection(sal_Int32 _par0);
/// @throws css::sdbc::SQLException
/// @throws css::uno::RuntimeException
void setFetchSize(sal_Int32 _par0);
/// @throws css::sdbc::SQLException
/// @throws css::uno::RuntimeException
void setCursorName(std::u16string_view _par0);
protected:
protected:
void assignRecordSet( ADORecordset* _pRS );
void assignRecordSet( ADORecordset* _pRS );
/// @throws css::sdbc::SQLException
void reset ();
/// @throws css::sdbc::SQLException
void clearMyResultSet ();
/// @throws css::sdbc::SQLException
void setWarning (const css::sdbc::SQLWarning &ex);
/// @throws css::sdbc::SQLException
sal_Int32 getRowCount ();
sal_Int32 getPrecision ( sal_Int32 sqlType);
/// @throws css::sdbc::SQLException
void reset ();
/// @throws css::sdbc::SQLException
void clearMyResultSet ();
/// @throws css::sdbc::SQLException
void setWarning (const css::sdbc::SQLWarning &ex);
/// @throws css::sdbc::SQLException
sal_Int32 getRowCount ();
sal_Int32 getPrecision ( sal_Int32 sqlType);
void disposeResultSet();
void disposeResultSet();
// OPropertyArrayUsageHelper
virtual ::cppu::IPropertyArrayHelper* createArrayHelper( ) const override;
// OPropertySetHelper
virtual ::cppu::IPropertyArrayHelper & SAL_CALL getInfoHelper() override;
virtual sal_Bool SAL_CALL convertFastPropertyValue(
css::uno::Any & rConvertedValue,
css::uno::Any & rOldValue,
// OPropertyArrayUsageHelper
virtual ::cppu::IPropertyArrayHelper* createArrayHelper( ) const override;
// OPropertySetHelper
virtual ::cppu::IPropertyArrayHelper & SAL_CALL getInfoHelper() override;
virtual sal_Bool SAL_CALL convertFastPropertyValue(
css::uno::Any & rConvertedValue,
css::uno::Any & rOldValue,
sal_Int32 nHandle,
const css::uno::Any& rValue ) override;
virtual void SAL_CALL setFastPropertyValue_NoBroadcast(
sal_Int32 nHandle,
const css::uno::Any& rValue ) override;
virtual void SAL_CALL setFastPropertyValue_NoBroadcast(
sal_Int32 nHandle,
const css::uno::Any& rValue
) override;
virtual void SAL_CALL getFastPropertyValue(
css::uno::Any& rValue,
sal_Int32 nHandle
) const override;
public:
OStatement_Base(OConnection* _pConnection );
const css::uno::Any& rValue
) override;
virtual void SAL_CALL getFastPropertyValue(
css::uno::Any& rValue,
sal_Int32 nHandle
) const override;
public:
OStatement_Base(OConnection* _pConnection );
using OStatement_BASE::operator css::uno::Reference< css::uno::XInterface >;
// OComponentHelper
virtual void SAL_CALL disposing() override;
// XInterface
virtual void SAL_CALL acquire() noexcept override;
virtual void SAL_CALL release() noexcept override;
virtual css::uno::Any SAL_CALL queryInterface( const css::uno::Type & rType ) override;
//XTypeProvider
virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes( ) override;
using OStatement_BASE::operator css::uno::Reference< css::uno::XInterface >;
// OComponentHelper
virtual void SAL_CALL disposing() override;
// XInterface
virtual void SAL_CALL acquire() noexcept override;
virtual void SAL_CALL release() noexcept override;
virtual css::uno::Any SAL_CALL queryInterface( const css::uno::Type & rType ) override;
//XTypeProvider
virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes( ) override;
// XPropertySet
virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) override;
// XStatement
virtual css::uno::Reference< css::sdbc::XResultSet > SAL_CALL executeQuery( const OUString& sql ) override;
virtual sal_Int32 SAL_CALL executeUpdate( const OUString& sql ) override;
virtual sal_Bool SAL_CALL execute( const OUString& sql ) override;
virtual css::uno::Reference< css::sdbc::XConnection > SAL_CALL getConnection( ) override;
// XWarningsSupplier
virtual css::uno::Any SAL_CALL getWarnings( ) override;
virtual void SAL_CALL clearWarnings( ) override;
// XCancellable
virtual void SAL_CALL cancel( ) override;
// XCloseable
virtual void SAL_CALL close( ) override;
// XMultipleResults
virtual css::uno::Reference< css::sdbc::XResultSet > SAL_CALL getResultSet( ) override;
virtual sal_Int32 SAL_CALL getUpdateCount( ) override;
virtual sal_Bool SAL_CALL getMoreResults( ) override;
};
// XPropertySet
virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) override;
// XStatement
virtual css::uno::Reference< css::sdbc::XResultSet > SAL_CALL executeQuery( const OUString& sql ) override;
virtual sal_Int32 SAL_CALL executeUpdate( const OUString& sql ) override;
virtual sal_Bool SAL_CALL execute( const OUString& sql ) override;
virtual css::uno::Reference< css::sdbc::XConnection > SAL_CALL getConnection( ) override;
// XWarningsSupplier
virtual css::uno::Any SAL_CALL getWarnings( ) override;
virtual void SAL_CALL clearWarnings( ) override;
// XCancellable
virtual void SAL_CALL cancel( ) override;
// XCloseable
virtual void SAL_CALL close( ) override;
// XMultipleResults
virtual css::uno::Reference< css::sdbc::XResultSet > SAL_CALL getResultSet( ) override;
virtual sal_Int32 SAL_CALL getUpdateCount( ) override;
virtual sal_Bool SAL_CALL getMoreResults( ) override;
};
class OStatement : public OStatement_Base,
public css::sdbc::XBatchExecution,
public css::lang::XServiceInfo
{
public:
// a Constructor, that is needed for when Returning the Object is needed:
OStatement( OConnection* _pConnection) : OStatement_Base( _pConnection){};
~OStatement() override;
class OStatement : public OStatement_Base,
public css::sdbc::XBatchExecution,
public css::lang::XServiceInfo
{
public:
// a Constructor, that is needed for when Returning the Object is needed:
OStatement( OConnection* _pConnection) : OStatement_Base( _pConnection){};
~OStatement() override;
DECLARE_SERVICE_INFO();
DECLARE_SERVICE_INFO();
virtual void SAL_CALL acquire() noexcept override;
virtual void SAL_CALL release() noexcept override;
virtual css::uno::Any SAL_CALL queryInterface( const css::uno::Type & rType ) override;
// XBatchExecution
virtual void SAL_CALL addBatch( const OUString& sql ) override;
virtual void SAL_CALL clearBatch( ) override;
virtual css::uno::Sequence< sal_Int32 > SAL_CALL executeBatch( ) override;
};
virtual void SAL_CALL acquire() noexcept override;
virtual void SAL_CALL release() noexcept override;
virtual css::uno::Any SAL_CALL queryInterface( const css::uno::Type & rType ) override;
// XBatchExecution
virtual void SAL_CALL addBatch( const OUString& sql ) override;
virtual void SAL_CALL clearBatch( ) override;
virtual css::uno::Sequence< sal_Int32 > SAL_CALL executeBatch( ) override;
};
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+29 -29
View File
@@ -25,45 +25,45 @@
namespace connectivity::ado
{
typedef connectivity::sdbcx::OTable OTable_TYPEDEF;
typedef connectivity::sdbcx::OTableDescriptor_BASE OTableDescriptor_BASE_TYPEDEF;
typedef connectivity::sdbcx::OTable OTable_TYPEDEF;
typedef connectivity::sdbcx::OTableDescriptor_BASE OTableDescriptor_BASE_TYPEDEF;
class OAdoTable : public OTable_TYPEDEF
{
WpADOTable m_aTable;
OCatalog* m_pCatalog;
class OAdoTable : public OTable_TYPEDEF
{
WpADOTable m_aTable;
OCatalog* m_pCatalog;
protected:
void fillPropertyValues();
virtual void SAL_CALL setFastPropertyValue_NoBroadcast(sal_Int32 nHandle,const css::uno::Any& rValue) override;
protected:
void fillPropertyValues();
virtual void SAL_CALL setFastPropertyValue_NoBroadcast(sal_Int32 nHandle,const css::uno::Any& rValue) override;
public:
virtual void refreshColumns() override;
virtual void refreshKeys() override;
virtual void refreshIndexes() override;
public:
virtual void refreshColumns() override;
virtual void refreshKeys() override;
virtual void refreshIndexes() override;
// ::cppu::OComponentHelper
virtual void SAL_CALL disposing() override;
// ::cppu::OComponentHelper
virtual void SAL_CALL disposing() override;
public:
OAdoTable(sdbcx::OCollection* _pTables,bool _bCase,OCatalog* _pCatalog,_ADOTable* _pTable);
OAdoTable(sdbcx::OCollection* _pTables,bool _bCase,OCatalog* _pCatalog);
public:
OAdoTable(sdbcx::OCollection* _pTables,bool _bCase,OCatalog* _pCatalog,_ADOTable* _pTable);
OAdoTable(sdbcx::OCollection* _pTables,bool _bCase,OCatalog* _pCatalog);
virtual OUString SAL_CALL getName() override;
OUString getSchema() const { return m_SchemaName; }
virtual css::uno::Reference< css::sdbc::XDatabaseMetaData> getMetaData() const override;
virtual OUString SAL_CALL getName() override;
OUString getSchema() const { return m_SchemaName; }
virtual css::uno::Reference< css::sdbc::XDatabaseMetaData> getMetaData() const override;
// XRename
virtual void SAL_CALL rename( const OUString& newName ) override;
// XRename
virtual void SAL_CALL rename( const OUString& newName ) override;
// XAlterTable
virtual void SAL_CALL alterColumnByName( const OUString& colName, const css::uno::Reference< css::beans::XPropertySet >& descriptor ) override;
virtual void SAL_CALL alterColumnByIndex( sal_Int32 index, const css::uno::Reference< css::beans::XPropertySet >& descriptor ) override;
// XAlterTable
virtual void SAL_CALL alterColumnByName( const OUString& colName, const css::uno::Reference< css::beans::XPropertySet >& descriptor ) override;
virtual void SAL_CALL alterColumnByIndex( sal_Int32 index, const css::uno::Reference< css::beans::XPropertySet >& descriptor ) override;
WpADOTable getImpl() const { return m_aTable;}
OCatalog* getCatalog() const { return m_pCatalog; }
};
WpADOTable getImpl() const { return m_aTable;}
OCatalog* getCatalog() const { return m_pCatalog; }
};
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+22 -22
View File
@@ -24,29 +24,29 @@
namespace connectivity::ado
{
class OCatalog;
class OTables : public sdbcx::OCollection
class OCatalog;
class OTables : public sdbcx::OCollection
{
WpADOTables m_aCollection;
OCatalog* m_pCatalog;
protected:
virtual css::uno::Reference< css::beans::XPropertySet > createObject(const OUString& _rName) override;
virtual void impl_refresh() override;
virtual css::uno::Reference< css::beans::XPropertySet > createDescriptor() override;
virtual css::uno::Reference< css::beans::XPropertySet > appendObject( const OUString& _rForName, const css::uno::Reference< css::beans::XPropertySet >& descriptor ) override;
virtual void dropObject(sal_Int32 _nPos,const OUString& _sElementName) override;
public:
OTables(OCatalog* _pParent, ::osl::Mutex& _rMutex,
const ::std::vector< OUString> &_rVector,
const WpADOTables& _rCollection,
bool _bCase) : sdbcx::OCollection(*_pParent,_bCase,_rMutex,_rVector)
,m_aCollection(_rCollection)
,m_pCatalog(_pParent)
{
WpADOTables m_aCollection;
OCatalog* m_pCatalog;
protected:
virtual css::uno::Reference< css::beans::XPropertySet > createObject(const OUString& _rName) override;
virtual void impl_refresh() override;
virtual css::uno::Reference< css::beans::XPropertySet > createDescriptor() override;
virtual css::uno::Reference< css::beans::XPropertySet > appendObject( const OUString& _rForName, const css::uno::Reference< css::beans::XPropertySet >& descriptor ) override;
virtual void dropObject(sal_Int32 _nPos,const OUString& _sElementName) override;
public:
OTables(OCatalog* _pParent, ::osl::Mutex& _rMutex,
const ::std::vector< OUString> &_rVector,
const WpADOTables& _rCollection,
bool _bCase) : sdbcx::OCollection(*_pParent,_bCase,_rMutex,_rVector)
,m_aCollection(_rCollection)
,m_pCatalog(_pParent)
{
OSL_ENSURE(m_aCollection.IsValid(),"Collection isn't valid");
}
void appendNew(const OUString& _rsNewTable);
};
OSL_ENSURE(m_aCollection.IsValid(),"Collection isn't valid");
}
void appendNew(const OUString& _rsNewTable);
};
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+47 -47
View File
@@ -24,60 +24,60 @@
namespace connectivity::ado
{
class OCatalog;
typedef connectivity::sdbcx::OUser OUser_TYPEDEF;
typedef connectivity::sdbcx::OUser_BASE OUser_BASE_TYPEDEF;
class OCatalog;
typedef connectivity::sdbcx::OUser OUser_TYPEDEF;
typedef connectivity::sdbcx::OUser_BASE OUser_BASE_TYPEDEF;
class OAdoUser : public OUser_TYPEDEF
{
protected:
WpADOUser m_aUser;
OCatalog* m_pCatalog;
class OAdoUser : public OUser_TYPEDEF
{
protected:
WpADOUser m_aUser;
OCatalog* m_pCatalog;
virtual void SAL_CALL setFastPropertyValue_NoBroadcast(
sal_Int32 nHandle,
const css::uno::Any& rValue
) override;
virtual void SAL_CALL getFastPropertyValue(
css::uno::Any& rValue,
sal_Int32 nHandle
) const override;
public:
virtual void refreshGroups() override;
public:
OAdoUser(OCatalog* _pParent,bool _bCase, ADOUser* _pUser=nullptr);
OAdoUser(OCatalog* _pParent,bool _bCase, const OUString& Name);
virtual void SAL_CALL setFastPropertyValue_NoBroadcast(
sal_Int32 nHandle,
const css::uno::Any& rValue
) override;
virtual void SAL_CALL getFastPropertyValue(
css::uno::Any& rValue,
sal_Int32 nHandle
) const override;
public:
virtual void refreshGroups() override;
public:
OAdoUser(OCatalog* _pParent,bool _bCase, ADOUser* _pUser=nullptr);
OAdoUser(OCatalog* _pParent,bool _bCase, const OUString& Name);
// XUser
virtual void SAL_CALL changePassword( const OUString& objPassword, const OUString& newPassword ) override;
// XAuthorizable
virtual sal_Int32 SAL_CALL getPrivileges( const OUString& objName, sal_Int32 objType ) override;
virtual sal_Int32 SAL_CALL getGrantablePrivileges( const OUString& objName, sal_Int32 objType ) override;
virtual void SAL_CALL grantPrivileges( const OUString& objName, sal_Int32 objType, sal_Int32 objPrivileges ) override;
virtual void SAL_CALL revokePrivileges( const OUString& objName, sal_Int32 objType, sal_Int32 objPrivileges ) override;
// XUser
virtual void SAL_CALL changePassword( const OUString& objPassword, const OUString& newPassword ) override;
// XAuthorizable
virtual sal_Int32 SAL_CALL getPrivileges( const OUString& objName, sal_Int32 objType ) override;
virtual sal_Int32 SAL_CALL getGrantablePrivileges( const OUString& objName, sal_Int32 objType ) override;
virtual void SAL_CALL grantPrivileges( const OUString& objName, sal_Int32 objType, sal_Int32 objPrivileges ) override;
virtual void SAL_CALL revokePrivileges( const OUString& objName, sal_Int32 objType, sal_Int32 objPrivileges ) override;
WpADOUser getImpl() const { return m_aUser;}
};
WpADOUser getImpl() const { return m_aUser;}
};
class OUserExtend;
typedef ::comphelper::OPropertyArrayUsageHelper<OUserExtend> OUserExtend_PROP;
class OUserExtend;
typedef ::comphelper::OPropertyArrayUsageHelper<OUserExtend> OUserExtend_PROP;
class OUserExtend : public OAdoUser,
public OUserExtend_PROP
{
protected:
OUString m_Password;
// OPropertyArrayUsageHelper
virtual ::cppu::IPropertyArrayHelper* createArrayHelper() const override;
// OPropertySetHelper
virtual ::cppu::IPropertyArrayHelper & SAL_CALL getInfoHelper() override;
public:
OUserExtend(OCatalog* _pParent,bool _bCase,ADOUser* _pUser=nullptr);
OUserExtend(OCatalog* _pParent,bool _bCase,const OUString& Name);
class OUserExtend : public OAdoUser,
public OUserExtend_PROP
{
protected:
OUString m_Password;
// OPropertyArrayUsageHelper
virtual ::cppu::IPropertyArrayHelper* createArrayHelper() const override;
// OPropertySetHelper
virtual ::cppu::IPropertyArrayHelper & SAL_CALL getInfoHelper() override;
public:
OUserExtend(OCatalog* _pParent,bool _bCase,ADOUser* _pUser=nullptr);
OUserExtend(OCatalog* _pParent,bool _bCase,const OUString& Name);
virtual void construct() override;
OUString getPassword() const { return m_Password;}
};
virtual void construct() override;
OUString getPassword() const { return m_Password;}
};
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+21 -21
View File
@@ -26,28 +26,28 @@
namespace connectivity::ado
{
class OUsers : public sdbcx::OCollection
class OUsers : public sdbcx::OCollection
{
WpADOUsers m_aCollection;
OCatalog* m_pCatalog;
public:
virtual css::uno::Reference< css::beans::XPropertySet > createObject(const OUString& _rName) override;
virtual css::uno::Reference< css::beans::XPropertySet > createDescriptor() override;
virtual void impl_refresh() override;
virtual css::uno::Reference< css::beans::XPropertySet > appendObject( const OUString& _rForName, const css::uno::Reference< css::beans::XPropertySet >& descriptor ) override;
virtual void dropObject(sal_Int32 _nPos,const OUString& _sElementName) override;
public:
OUsers( OCatalog* _pParent,
::osl::Mutex& _rMutex,
const ::std::vector< OUString> &_rVector,
const WpADOUsers& _rCollection,
bool _bCase)
:sdbcx::OCollection(*_pParent,_bCase,_rMutex,_rVector)
,m_aCollection(_rCollection)
,m_pCatalog(_pParent)
{
WpADOUsers m_aCollection;
OCatalog* m_pCatalog;
public:
virtual css::uno::Reference< css::beans::XPropertySet > createObject(const OUString& _rName) override;
virtual css::uno::Reference< css::beans::XPropertySet > createDescriptor() override;
virtual void impl_refresh() override;
virtual css::uno::Reference< css::beans::XPropertySet > appendObject( const OUString& _rForName, const css::uno::Reference< css::beans::XPropertySet >& descriptor ) override;
virtual void dropObject(sal_Int32 _nPos,const OUString& _sElementName) override;
public:
OUsers( OCatalog* _pParent,
::osl::Mutex& _rMutex,
const ::std::vector< OUString> &_rVector,
const WpADOUsers& _rCollection,
bool _bCase)
:sdbcx::OCollection(*_pParent,_bCase,_rMutex,_rVector)
,m_aCollection(_rCollection)
,m_pCatalog(_pParent)
{
}
};
}
};
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+14 -14
View File
@@ -25,23 +25,23 @@
namespace connectivity::ado
{
typedef sdbcx::OView OView_ADO;
typedef sdbcx::OView OView_ADO;
class OAdoView : public OView_ADO
{
WpADOView m_aView;
class OAdoView : public OView_ADO
{
WpADOView m_aView;
protected:
// OPropertySetHelper
virtual void SAL_CALL getFastPropertyValue(
css::uno::Any& rValue,
sal_Int32 nHandle
) const override;
public:
OAdoView(bool _bCase, ADOView* _pView=nullptr);
protected:
// OPropertySetHelper
virtual void SAL_CALL getFastPropertyValue(
css::uno::Any& rValue,
sal_Int32 nHandle
) const override;
public:
OAdoView(bool _bCase, ADOView* _pView=nullptr);
WpADOView getImpl() const { return m_aView;}
};
WpADOView getImpl() const { return m_aView;}
};
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+18 -18
View File
@@ -27,25 +27,25 @@
namespace connectivity::ado
{
class OViews : public sdbcx::OCollection
class OViews : public sdbcx::OCollection
{
WpADOViews m_aCollection;
OCatalog* m_pCatalog;
protected:
virtual css::uno::Reference< css::beans::XPropertySet > createObject(const OUString& _rName) override;
virtual void impl_refresh() override;
virtual css::uno::Reference< css::beans::XPropertySet > createDescriptor() override;
virtual css::uno::Reference< css::beans::XPropertySet > appendObject( const OUString& _rForName, const css::uno::Reference< css::beans::XPropertySet >& descriptor ) override;
virtual void dropObject(sal_Int32 _nPos,const OUString& _sElementName) override;
public:
OViews(OCatalog* _pParent, ::osl::Mutex& _rMutex,
const ::std::vector< OUString> &_rVector,
WpADOViews const & _rCollection,bool _bCase) : sdbcx::OCollection(*_pParent,_bCase,_rMutex,_rVector)
,m_aCollection(_rCollection)
,m_pCatalog(_pParent)
{
WpADOViews m_aCollection;
OCatalog* m_pCatalog;
protected:
virtual css::uno::Reference< css::beans::XPropertySet > createObject(const OUString& _rName) override;
virtual void impl_refresh() override;
virtual css::uno::Reference< css::beans::XPropertySet > createDescriptor() override;
virtual css::uno::Reference< css::beans::XPropertySet > appendObject( const OUString& _rForName, const css::uno::Reference< css::beans::XPropertySet >& descriptor ) override;
virtual void dropObject(sal_Int32 _nPos,const OUString& _sElementName) override;
public:
OViews(OCatalog* _pParent, ::osl::Mutex& _rMutex,
const ::std::vector< OUString> &_rVector,
WpADOViews const & _rCollection,bool _bCase) : sdbcx::OCollection(*_pParent,_bCase,_rMutex,_rVector)
,m_aCollection(_rCollection)
,m_pCatalog(_pParent)
{
}
};
}
};
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+74 -74
View File
@@ -33,91 +33,91 @@ namespace com::sun::star::util
namespace connectivity::ado
{
class OLEVariant : public ::tagVARIANT
class OLEVariant : public ::tagVARIANT
{
public:
OLEVariant();
OLEVariant(const VARIANT& varSrc);
OLEVariant(const OLEVariant& varSrc) ;
OLEVariant(bool x) ;
OLEVariant(sal_Bool) = delete;
OLEVariant(sal_Int8 n) ;
OLEVariant(sal_Int16 n) ;
OLEVariant(sal_Int32 n) ;
OLEVariant(sal_Int64 x) ;
OLEVariant(std::u16string_view us);
OLEVariant(const OUString& us)
: OLEVariant(std::u16string_view(us))
{
public:
OLEVariant();
OLEVariant(const VARIANT& varSrc);
OLEVariant(const OLEVariant& varSrc) ;
OLEVariant(bool x) ;
OLEVariant(sal_Bool) = delete;
OLEVariant(sal_Int8 n) ;
OLEVariant(sal_Int16 n) ;
OLEVariant(sal_Int32 n) ;
OLEVariant(sal_Int64 x) ;
}
~OLEVariant() ;
OLEVariant(const css::util::Date& x );
OLEVariant(const css::util::Time& x );
OLEVariant(const css::util::DateTime& x );
OLEVariant(float x);
OLEVariant(const double &x);
OLEVariant(IDispatch* pDispInterface);
OLEVariant(const css::uno::Sequence< sal_Int8 >& x);
OLEVariant& operator=(const OLEVariant& varSrc);
// Assign a const VARIANT& (::VariantCopy handles everything)
OLEVariant(std::u16string_view us);
OLEVariant(const OUString& us)
: OLEVariant(std::u16string_view(us))
{
}
~OLEVariant() ;
OLEVariant(const css::util::Date& x );
OLEVariant(const css::util::Time& x );
OLEVariant(const css::util::DateTime& x );
OLEVariant(float x);
OLEVariant(const double &x);
OLEVariant(IDispatch* pDispInterface);
OLEVariant(const css::uno::Sequence< sal_Int8 >& x);
OLEVariant& operator=(const OLEVariant& varSrc);
// Assign a const VARIANT& (::VariantCopy handles everything)
OLEVariant& operator=(const tagVARIANT& varSrc);
// Assign a const VARIANT* (::VariantCopy handles everything)
OLEVariant& operator=(const tagVARIANT& varSrc);
// Assign a const VARIANT* (::VariantCopy handles everything)
OLEVariant& operator=(const VARIANT* pSrc);
void setByte(sal_uInt8 n) ;
void setInt16(sal_Int16 n) ;
void setInt32(sal_Int32 n) ;
void setFloat(float f) ;
void setDouble(double d) ;
void setDate(DATE d) ;
void setChar(unsigned char a) ;
void setCurrency(double aCur) ;
void setBool(bool b) ;
void setString(std::u16string_view us);
void setNoArg() ;
OLEVariant& operator=(const VARIANT* pSrc);
void setByte(sal_uInt8 n) ;
void setInt16(sal_Int16 n) ;
void setInt32(sal_Int32 n) ;
void setFloat(float f) ;
void setDouble(double d) ;
void setDate(DATE d) ;
void setChar(unsigned char a) ;
void setCurrency(double aCur) ;
void setBool(bool b) ;
void setString(std::u16string_view us);
void setNoArg() ;
void setIDispatch(IDispatch* pDispInterface);
void setNull() ;
void setEmpty() ;
void setIDispatch(IDispatch* pDispInterface);
void setNull() ;
void setEmpty() ;
void setUI1SAFEARRAYPtr(SAFEARRAY* pSafeAr);
void setArray(SAFEARRAY* pSafeArray, VARTYPE vtType);
bool isNull() const ;
bool isEmpty() const ;
void setUI1SAFEARRAYPtr(SAFEARRAY* pSafeAr);
void setArray(SAFEARRAY* pSafeArray, VARTYPE vtType);
bool isNull() const ;
bool isEmpty() const ;
VARTYPE getType() const ;
void ChangeType(VARTYPE vartype, const OLEVariant* pSrc);
VARTYPE getType() const ;
void ChangeType(VARTYPE vartype, const OLEVariant* pSrc);
OUString getString() const;
bool getBool() const;
IUnknown* getIUnknown() const;
IDispatch* getIDispatch() const;
sal_uInt8 getByte() const;
sal_Int16 getInt16() const;
sal_Int8 getInt8() const;
sal_Int32 getInt32() const;
sal_uInt32 getUInt32() const;
float getFloat() const;
double getDouble() const;
double getDateAsDouble() const;
CY getCurrency() const;
css::util::Date getDate() const;
css::util::Time getTime() const;
css::util::DateTime getDateTime() const;
css::uno::Sequence<sal_Int8> getByteSequence() const;
SAFEARRAY* getUI1SAFEARRAYPtr() const;
css::uno::Any makeAny() const;
OUString getString() const;
bool getBool() const;
IUnknown* getIUnknown() const;
IDispatch* getIDispatch() const;
sal_uInt8 getByte() const;
sal_Int16 getInt16() const;
sal_Int8 getInt8() const;
sal_Int32 getInt32() const;
sal_uInt32 getUInt32() const;
float getFloat() const;
double getDouble() const;
double getDateAsDouble() const;
CY getCurrency() const;
css::util::Date getDate() const;
css::util::Time getTime() const;
css::util::DateTime getDateTime() const;
css::uno::Sequence<sal_Int8> getByteSequence() const;
SAFEARRAY* getUI1SAFEARRAYPtr() const;
css::uno::Any makeAny() const;
static VARIANT_BOOL VariantBool(bool bEinBoolean);
static VARIANT_BOOL VariantBool(bool bEinBoolean);
private:
void CHS();
private:
void CHS();
void set(double n);
void set(double n);
};
};
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+115 -115
View File
@@ -33,142 +33,142 @@ namespace rtl
}
namespace connectivity::ado
{
// Template class WpOLEBase<class T>
// ==================================
//
// Objects of this class contain a pointer to an interface of the type T.
// Template class WpOLEBase<class T>
// ==================================
//
// Objects of this class contain a pointer to an interface of the type T.
template<class T> class WpOLEBase
template<class T> class WpOLEBase
{
protected:
sal::systools::COMReference<T> pInterface;
public:
WpOLEBase(T* pInt = nullptr) : pInterface(pInt){}
WpOLEBase(const WpOLEBase<T>& aWrapper)
: pInterface( aWrapper.pInterface )
{
protected:
sal::systools::COMReference<T> pInterface;
}
public:
WpOLEBase(T* pInt = nullptr) : pInterface(pInt){}
WpOLEBase(const WpOLEBase<T>& aWrapper)
: pInterface( aWrapper.pInterface )
{
}
//inline
WpOLEBase<T>& operator=(const WpOLEBase<T>& rhs)
{
pInterface = rhs.pInterface;
return *this;
};
operator T*() const { return pInterface.get(); }
T** operator&() { return &pInterface; }
bool IsValid() const { return pInterface.is(); }
void set(T* p) { pInterface = p; }
void clear() { pInterface.clear(); }
//inline
WpOLEBase<T>& operator=(const WpOLEBase<T>& rhs)
{
pInterface = rhs.pInterface;
return *this;
};
operator T*() const { return pInterface.get(); }
T** operator&() { return &pInterface; }
bool IsValid() const { return pInterface.is(); }
void set(T* p) { pInterface = p; }
void clear() { pInterface.clear(); }
};
// Template class WpOLECollection<class Ts, class WrapT>
// ===============================================================
//
// This class (derived from WpOLEBase<Ts>), abstracts away the properties
// common to DAO collections:
//
// They are accessed via an interface Ts (e.g. DAOFields) and can return
// Items of the type wrapped by WrapT (actually: with the interface, e.g.
// DAOField) via get_Item (here GetItem).
//
// This wrapper class exposes an object of the class WrapT.
template<class Ts, class WrapT> class WpOLECollection : public WpOLEBase<Ts>
// Template class WpOLECollection<class Ts, class WrapT>
// ===============================================================
//
// This class (derived from WpOLEBase<Ts>), abstracts away the properties
// common to DAO collections:
//
// They are accessed via an interface Ts (e.g. DAOFields) and can return
// Items of the type wrapped by WrapT (actually: with the interface, e.g.
// DAOField) via get_Item (here GetItem).
//
// This wrapper class exposes an object of the class WrapT.
template<class Ts, class WrapT> class WpOLECollection : public WpOLEBase<Ts>
{
public:
using WpOLEBase<Ts>::pInterface;
using WpOLEBase<Ts>::IsValid;
// Ctors, operator=
// They only call the superclass
WpOLECollection() = default;
WpOLECollection(const WpOLECollection& rhs) : WpOLEBase<Ts>(rhs) {}
WpOLECollection& operator=(const WpOLECollection& rhs)
{WpOLEBase<Ts>::operator=(rhs); return *this;};
void Refresh(){pInterface->Refresh();}
sal_Int32 GetItemCount() const
{
public:
using WpOLEBase<Ts>::pInterface;
using WpOLEBase<Ts>::IsValid;
// Ctors, operator=
// They only call the superclass
WpOLECollection() = default;
WpOLECollection(const WpOLECollection& rhs) : WpOLEBase<Ts>(rhs) {}
WpOLECollection& operator=(const WpOLECollection& rhs)
{WpOLEBase<Ts>::operator=(rhs); return *this;};
sal_Int32 nCount = 0;
return pInterface ? (SUCCEEDED(pInterface->get_Count(&nCount)) ? nCount : sal_Int32(0)) : sal_Int32(0);
}
WrapT GetItem(sal_Int32 index) const
{
OSL_ENSURE(index >= 0 && index<GetItemCount(),"Wrong index for field!");
WrapT aRet;
pInterface->get_Item(OLEVariant(index), &aRet);
return aRet;
}
void Refresh(){pInterface->Refresh();}
WrapT GetItem(const OLEVariant& index) const
{
WrapT aRet;
pInterface->get_Item(index, &aRet);
return aRet;
}
sal_Int32 GetItemCount() const
WrapT GetItem(const OUString& sStr) const
{
WrapT aRet;
if (FAILED(pInterface->get_Item(OLEVariant(sStr), &aRet)))
{
sal_Int32 nCount = 0;
return pInterface ? (SUCCEEDED(pInterface->get_Count(&nCount)) ? nCount : sal_Int32(0)) : sal_Int32(0);
}
WrapT GetItem(sal_Int32 index) const
{
OSL_ENSURE(index >= 0 && index<GetItemCount(),"Wrong index for field!");
WrapT aRet;
pInterface->get_Item(OLEVariant(index), &aRet);
return aRet;
}
WrapT GetItem(const OLEVariant& index) const
{
WrapT aRet;
pInterface->get_Item(index, &aRet);
return aRet;
}
WrapT GetItem(const OUString& sStr) const
{
WrapT aRet;
if (FAILED(pInterface->get_Item(OLEVariant(sStr), &aRet)))
{
#if OSL_DEBUG_LEVEL > 0
OString sTemp("Unknown Item: " + OString(sStr.getStr(),sStr.getLength(),osl_getThreadTextEncoding()));
OSL_FAIL(sTemp.getStr());
OString sTemp("Unknown Item: " + OString(sStr.getStr(),sStr.getLength(),osl_getThreadTextEncoding()));
OSL_FAIL(sTemp.getStr());
#endif
}
return aRet;
}
void fillElementNames(::std::vector< OUString>& _rVector)
{
if(IsValid())
{
Refresh();
sal_Int32 nCount = GetItemCount();
_rVector.reserve(nCount);
for(sal_Int32 i=0;i< nCount;++i)
{
WrapT aElement = GetItem(i);
if(aElement.IsValid())
_rVector.push_back(aElement.get_Name());
}
}
}
};
template<class Ts, class WrapT> class WpOLEAppendCollection:
public WpOLECollection<Ts,WrapT>
return aRet;
}
void fillElementNames(::std::vector< OUString>& _rVector)
{
public:
// Ctors, operator=
// They only call the superclass
using WpOLEBase<Ts>::pInterface;
WpOLEAppendCollection() = default;
WpOLEAppendCollection(const WpOLEAppendCollection& rhs) : WpOLECollection<Ts, WrapT>(rhs) {}
WpOLEAppendCollection& operator=(const WpOLEAppendCollection& rhs)
{WpOLEBase<Ts>::operator=(rhs); return *this;};
bool Append(const WrapT& aWrapT)
if(IsValid())
{
return SUCCEEDED(pInterface->Append(OLEVariant(aWrapT)));
};
Refresh();
sal_Int32 nCount = GetItemCount();
_rVector.reserve(nCount);
for(sal_Int32 i=0;i< nCount;++i)
{
WrapT aElement = GetItem(i);
if(aElement.IsValid())
_rVector.push_back(aElement.get_Name());
}
}
}
};
bool Delete(const OUString& sName)
{
return SUCCEEDED(pInterface->Delete(OLEVariant(sName)));
};
template<class Ts, class WrapT> class WpOLEAppendCollection:
public WpOLECollection<Ts,WrapT>
{
public:
// Ctors, operator=
// They only call the superclass
using WpOLEBase<Ts>::pInterface;
WpOLEAppendCollection() = default;
WpOLEAppendCollection(const WpOLEAppendCollection& rhs) : WpOLECollection<Ts, WrapT>(rhs) {}
WpOLEAppendCollection& operator=(const WpOLEAppendCollection& rhs)
{WpOLEBase<Ts>::operator=(rhs); return *this;};
bool Append(const WrapT& aWrapT)
{
return SUCCEEDED(pInterface->Append(OLEVariant(aWrapT)));
};
bool Delete(const OUString& sName)
{
return SUCCEEDED(pInterface->Delete(OLEVariant(sName)));
};
};
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+310 -310
View File
@@ -34,339 +34,339 @@
namespace connectivity::ado
{
class WpADOConnection;
class WpADOCommand;
class WpADORecordset;
class WpADOField;
class WpADOParameter;
class WpADOError;
class WpADOProperty;
class WpADOConnection;
class WpADOCommand;
class WpADORecordset;
class WpADOField;
class WpADOParameter;
class WpADOError;
class WpADOProperty;
typedef WpOLEAppendCollection< ADOFields, WpADOField> WpADOFields;
typedef WpOLECollection< ADOProperties, WpADOProperty> WpADOProperties;
typedef WpOLEAppendCollection< ADOFields, WpADOField> WpADOFields;
typedef WpOLECollection< ADOProperties, WpADOProperty> WpADOProperties;
class WpADOConnection : public WpOLEBase<ADOConnection>
class WpADOConnection : public WpOLEBase<ADOConnection>
{
public:
WpADOConnection() = default;
WpADOConnection(const WpADOConnection& rhs) : WpOLEBase<ADOConnection>(rhs) {}
WpADOConnection& operator=(const WpADOConnection& rhs)
{WpOLEBase<ADOConnection>::operator=(rhs); return *this;}
WpADOProperties get_Properties() const;
OUString GetConnectionString() const;
bool PutConnectionString(std::u16string_view aCon) const;
sal_Int32 GetCommandTimeout() const;
void PutCommandTimeout(sal_Int32 nRet);
sal_Int32 GetConnectionTimeout() const ;
void PutConnectionTimeout(sal_Int32 nRet);
bool Close( ) ;
bool Execute(std::u16string_view CommandText,OLEVariant& RecordsAffected,long Options, WpADORecordset** ppiRset);
bool BeginTrans();
bool CommitTrans( ) ;
bool RollbackTrans( );
bool Open(std::u16string_view ConnectionString, std::u16string_view UserID,std::u16string_view Password,long Options);
bool GetErrors(ADOErrors** pErrors);
OUString GetDefaultDatabase() const;
bool PutDefaultDatabase(std::u16string_view _bstr);
IsolationLevelEnum get_IsolationLevel() const ;
bool put_IsolationLevel(const IsolationLevelEnum& eNum) ;
sal_Int32 get_Attributes() const;
bool put_Attributes(sal_Int32 nRet);
CursorLocationEnum get_CursorLocation() const;
bool put_CursorLocation(const CursorLocationEnum &eNum) ;
ConnectModeEnum get_Mode() const;
bool put_Mode(const ConnectModeEnum &eNum) ;
OUString get_Provider() const;
bool put_Provider(std::u16string_view _bstr);
sal_Int32 get_State() const;
bool OpenSchema(SchemaEnum eNum,OLEVariant const & Restrictions,OLEVariant const & SchemaID,ADORecordset**pprset);
OUString get_Version() const;
// special methods
ADORecordset* getExportedKeys( const css::uno::Any& catalog, const OUString& schema, std::u16string_view table );
ADORecordset* getImportedKeys( const css::uno::Any& catalog, const OUString& schema, std::u16string_view table );
ADORecordset* getPrimaryKeys( const css::uno::Any& catalog, const OUString& schema, std::u16string_view table );
ADORecordset* getIndexInfo( const css::uno::Any& catalog, const OUString& schema, std::u16string_view table, bool unique, bool approximate );
ADORecordset* getTablePrivileges( const css::uno::Any& catalog,
const OUString& schemaPattern,
std::u16string_view tableNamePattern );
ADORecordset* getCrossReference( const css::uno::Any& primaryCatalog,
const OUString& primarySchema,
std::u16string_view primaryTable,
const css::uno::Any& foreignCatalog,
const OUString& foreignSchema,
std::u16string_view foreignTable);
ADORecordset* getProcedures( const css::uno::Any& catalog,
const OUString& schemaPattern,
std::u16string_view procedureNamePattern );
ADORecordset* getProcedureColumns( const css::uno::Any& catalog,
const OUString& schemaPattern,
std::u16string_view procedureNamePattern,
std::u16string_view columnNamePattern );
ADORecordset* getTables( const css::uno::Any& catalog,
const OUString& schemaPattern,
std::u16string_view tableNamePattern,
const css::uno::Sequence< OUString >& types );
ADORecordset* getColumns( const css::uno::Any& catalog,
const OUString& schemaPattern,
std::u16string_view tableNamePattern,
std::u16string_view columnNamePattern );
ADORecordset* getColumnPrivileges( const css::uno::Any& catalog,
const OUString& schemaPattern,
std::u16string_view table,
std::u16string_view columnNamePattern );
ADORecordset* getTypeInfo(DataTypeEnum _eType = adEmpty );
};
class WpADOCommand : public WpOLEBase<ADOCommand>
{
public:
WpADOCommand() = default;
// Ctors, operator=
// They only call the superclass
WpADOCommand(const WpADOCommand& rhs) : WpOLEBase<ADOCommand>(rhs) {}
WpADOCommand& operator=(const WpADOCommand& rhs)
{
public:
WpADOConnection() = default;
WpADOConnection(const WpADOConnection& rhs) : WpOLEBase<ADOConnection>(rhs) {}
WpADOConnection& operator=(const WpADOConnection& rhs)
{WpOLEBase<ADOConnection>::operator=(rhs); return *this;}
WpOLEBase<ADOCommand>::operator=(rhs); return *this;}
WpADOProperties get_Properties() const;
bool putref_ActiveConnection(const WpADOConnection& rCon);
OUString GetConnectionString() const;
bool PutConnectionString(std::u16string_view aCon) const;
sal_Int32 GetCommandTimeout() const;
void PutCommandTimeout(sal_Int32 nRet);
sal_Int32 GetConnectionTimeout() const ;
void PutConnectionTimeout(sal_Int32 nRet);
void put_ActiveConnection(/* [in] */ const OLEVariant& vConn);
void Create();
sal_Int32 get_State() const;
OUString get_CommandText() const;
bool put_CommandText(std::u16string_view aCon) ;
sal_Int32 get_CommandTimeout() const;
void put_CommandTimeout(sal_Int32 nRet);
bool get_Prepared() const;
bool put_Prepared(VARIANT_BOOL bPrepared) const;
bool Execute(OLEVariant& RecordsAffected,OLEVariant& Parameters,long Options, ADORecordset** ppiRset);
ADOParameter* CreateParameter(std::u16string_view _bstr,DataTypeEnum Type,ParameterDirectionEnum Direction,long nSize,const OLEVariant &Value);
bool Close( ) ;
bool Execute(std::u16string_view CommandText,OLEVariant& RecordsAffected,long Options, WpADORecordset** ppiRset);
bool BeginTrans();
bool CommitTrans( ) ;
bool RollbackTrans( );
bool Open(std::u16string_view ConnectionString, std::u16string_view UserID,std::u16string_view Password,long Options);
bool GetErrors(ADOErrors** pErrors);
ADOParameters* get_Parameters() const;
bool put_CommandType( /* [in] */ CommandTypeEnum lCmdType);
CommandTypeEnum get_CommandType( ) const ;
// Returns the field's name
OUString GetName() const ;
bool put_Name(std::u16string_view Name);
bool Cancel();
};
OUString GetDefaultDatabase() const;
bool PutDefaultDatabase(std::u16string_view _bstr);
class WpADOError : public WpOLEBase<ADOError>
{
public:
IsolationLevelEnum get_IsolationLevel() const ;
bool put_IsolationLevel(const IsolationLevelEnum& eNum) ;
// Ctors, operator=
// They only call the superclass
WpADOError() = default;
sal_Int32 get_Attributes() const;
bool put_Attributes(sal_Int32 nRet);
WpADOError(const WpADOError& rhs) : WpOLEBase<ADOError>(rhs) {}
CursorLocationEnum get_CursorLocation() const;
bool put_CursorLocation(const CursorLocationEnum &eNum) ;
ConnectModeEnum get_Mode() const;
bool put_Mode(const ConnectModeEnum &eNum) ;
OUString get_Provider() const;
bool put_Provider(std::u16string_view _bstr);
sal_Int32 get_State() const;
bool OpenSchema(SchemaEnum eNum,OLEVariant const & Restrictions,OLEVariant const & SchemaID,ADORecordset**pprset);
OUString get_Version() const;
// special methods
ADORecordset* getExportedKeys( const css::uno::Any& catalog, const OUString& schema, std::u16string_view table );
ADORecordset* getImportedKeys( const css::uno::Any& catalog, const OUString& schema, std::u16string_view table );
ADORecordset* getPrimaryKeys( const css::uno::Any& catalog, const OUString& schema, std::u16string_view table );
ADORecordset* getIndexInfo( const css::uno::Any& catalog, const OUString& schema, std::u16string_view table, bool unique, bool approximate );
ADORecordset* getTablePrivileges( const css::uno::Any& catalog,
const OUString& schemaPattern,
std::u16string_view tableNamePattern );
ADORecordset* getCrossReference( const css::uno::Any& primaryCatalog,
const OUString& primarySchema,
std::u16string_view primaryTable,
const css::uno::Any& foreignCatalog,
const OUString& foreignSchema,
std::u16string_view foreignTable);
ADORecordset* getProcedures( const css::uno::Any& catalog,
const OUString& schemaPattern,
std::u16string_view procedureNamePattern );
ADORecordset* getProcedureColumns( const css::uno::Any& catalog,
const OUString& schemaPattern,
std::u16string_view procedureNamePattern,
std::u16string_view columnNamePattern );
ADORecordset* getTables( const css::uno::Any& catalog,
const OUString& schemaPattern,
std::u16string_view tableNamePattern,
const css::uno::Sequence< OUString >& types );
ADORecordset* getColumns( const css::uno::Any& catalog,
const OUString& schemaPattern,
std::u16string_view tableNamePattern,
std::u16string_view columnNamePattern );
ADORecordset* getColumnPrivileges( const css::uno::Any& catalog,
const OUString& schemaPattern,
std::u16string_view table,
std::u16string_view columnNamePattern );
ADORecordset* getTypeInfo(DataTypeEnum _eType = adEmpty );
};
WpADOError& operator=(const WpADOError& rhs)
{WpOLEBase<ADOError>::operator=(rhs); return *this;}
class WpADOCommand : public WpOLEBase<ADOCommand>
OUString GetDescription() const;
OUString GetSource() const ;
sal_Int32 GetNumber() const ;
OUString GetSQLState() const ;
sal_Int32 GetNativeError() const ;
};
class WpADOField : public WpOLEBase<ADOField>
{
// friend class WpADOFields;
public:
// Ctors, operator=
// They only call the superclass
WpADOField() = default;
WpADOField(const WpADOField& rhs) : WpOLEBase<ADOField>(rhs) {}
WpADOField& operator=(const WpADOField& rhs)
{WpOLEBase<ADOField>::operator=(rhs); return *this;}
WpADOProperties get_Properties();
sal_Int32 GetActualSize() const ;
sal_Int32 GetAttributes() const ;
sal_Int32 GetStatus() const ;
sal_Int32 GetDefinedSize() const ;
// Returns the field's name
OUString GetName() const ;
DataTypeEnum GetADOType() const ;
void get_Value(OLEVariant& aValVar) const ;
OLEVariant get_Value() const;
bool PutValue(const OLEVariant& aVariant);
sal_Int32 GetPrecision() const ;
sal_Int32 GetNumericScale() const ;
bool AppendChunk(const OLEVariant& Variant);
OLEVariant GetChunk(long Length) const;
void GetChunk(long Length,OLEVariant &aValVar) const;
OLEVariant GetOriginalValue() const;
void GetOriginalValue(OLEVariant &aValVar) const;
OLEVariant GetUnderlyingValue() const;
void GetUnderlyingValue(OLEVariant &aValVar) const;
bool PutPrecision(sal_Int8 _prec);
bool PutNumericScale(sal_Int8 _prec);
void PutADOType(DataTypeEnum eType) ;
bool PutDefinedSize(sal_Int32 _nDefSize);
bool PutAttributes(sal_Int32 _nDefSize);
};
class WpADOProperty: public WpOLEBase<ADOProperty>
{
public:
// Ctors, operator=
// They only call the superclass
WpADOProperty() = default;
WpADOProperty(const WpADOProperty& rhs) : WpOLEBase<ADOProperty>(rhs) {}
WpADOProperty& operator=(const WpADOProperty& rhs)
{WpOLEBase<ADOProperty>::operator=(rhs); return *this;}
OLEVariant GetValue() const;
void GetValue(OLEVariant &aValVar) const;
bool PutValue(const OLEVariant &aValVar) ;
OUString GetName() const ;
DataTypeEnum GetADOType() const ;
sal_Int32 GetAttributes() const ;
bool PutAttributes(sal_Int32 _nDefSize);
};
class WpADORecordset : public WpOLEBase<ADORecordset>
{
public:
// Ctors, operator=
// They only call the superclass
WpADORecordset() = default;
WpADORecordset(const WpADORecordset& rhs) : WpOLEBase<ADORecordset>() {operator=(rhs);}
WpADORecordset& operator=(const WpADORecordset& rhs)
{
public:
WpADOCommand() = default;
// Ctors, operator=
// They only call the superclass
WpADOCommand(const WpADOCommand& rhs) : WpOLEBase<ADOCommand>(rhs) {}
WpOLEBase<ADORecordset>::operator=(rhs);
return *this;
}
WpADOCommand& operator=(const WpADOCommand& rhs)
{
WpOLEBase<ADOCommand>::operator=(rhs); return *this;}
void Create();
bool Open(
/* [optional][in] */ VARIANT Source,
/* [optional][in] */ VARIANT ActiveConnection,
/* [defaultvalue][in] */ CursorTypeEnum CursorType,
/* [defaultvalue][in] */ LockTypeEnum LockType,
/* [defaultvalue][in] */ sal_Int32 Options);
LockTypeEnum GetLockType();
void Close();
bool Cancel() const;
sal_Int32 get_State( );
bool Supports( /* [in] */ CursorOptionEnum CursorOptions);
PositionEnum get_AbsolutePosition();
void GetDataSource(IUnknown** pIUnknown) const ;
void PutRefDataSource(IUnknown* pIUnknown);
void GetBookmark(VARIANT& var);
OLEVariant GetBookmark();
CompareEnum CompareBookmarks(const OLEVariant& left,const OLEVariant& right);
bool SetBookmark(const OLEVariant &pSafeAr);
WpADOFields GetFields() const;
bool Move(sal_Int32 nRows, VARIANT aBmk);
bool MoveNext();
bool MovePrevious();
bool MoveFirst();
bool MoveLast();
bool IsAtBOF() const;
bool IsAtEOF() const;
bool Delete(AffectEnum eNum);
bool AddNew(const OLEVariant &FieldList,const OLEVariant &Values);
bool Update(const OLEVariant &FieldList,const OLEVariant &Values);
bool CancelUpdate();
WpADOProperties get_Properties() const;
bool NextRecordset(OLEVariant& RecordsAffected,ADORecordset** ppiRset);
bool get_RecordCount(long& _nRet) const;
bool get_MaxRecords(long& _nRet) const;
bool put_MaxRecords(ADO_LONGPTR _nRet);
bool get_CursorType(CursorTypeEnum &_nRet) const;
bool put_CursorType(CursorTypeEnum _nRet);
bool get_LockType(LockTypeEnum &_nRet) const;
bool put_LockType(LockTypeEnum _nRet);
bool get_CacheSize(sal_Int32 &_nRet) const;
bool put_CacheSize(sal_Int32 _nRet);
bool UpdateBatch(AffectEnum AffectRecords);
};
bool putref_ActiveConnection(const WpADOConnection& rCon);
void put_ActiveConnection(/* [in] */ const OLEVariant& vConn);
void Create();
sal_Int32 get_State() const;
OUString get_CommandText() const;
bool put_CommandText(std::u16string_view aCon) ;
sal_Int32 get_CommandTimeout() const;
void put_CommandTimeout(sal_Int32 nRet);
bool get_Prepared() const;
bool put_Prepared(VARIANT_BOOL bPrepared) const;
bool Execute(OLEVariant& RecordsAffected,OLEVariant& Parameters,long Options, ADORecordset** ppiRset);
ADOParameter* CreateParameter(std::u16string_view _bstr,DataTypeEnum Type,ParameterDirectionEnum Direction,long nSize,const OLEVariant &Value);
ADOParameters* get_Parameters() const;
bool put_CommandType( /* [in] */ CommandTypeEnum lCmdType);
CommandTypeEnum get_CommandType( ) const ;
// Returns the field's name
OUString GetName() const ;
bool put_Name(std::u16string_view Name);
bool Cancel();
};
class WpADOError : public WpOLEBase<ADOError>
{
public:
// Ctors, operator=
// They only call the superclass
WpADOError() = default;
WpADOError(const WpADOError& rhs) : WpOLEBase<ADOError>(rhs) {}
WpADOError& operator=(const WpADOError& rhs)
{WpOLEBase<ADOError>::operator=(rhs); return *this;}
class WpADOParameter:public WpOLEBase<ADOParameter>
{
public:
// Ctors, operator=
// They only call the superclass
WpADOParameter() = default;
WpADOParameter(const WpADOParameter& rhs):WpOLEBase<ADOParameter>(rhs){}
WpADOParameter& operator=(const WpADOParameter& rhs)
{WpOLEBase<ADOParameter>::operator=(rhs); return *this;}
OUString GetDescription() const;
OUString GetSource() const ;
sal_Int32 GetNumber() const ;
OUString GetSQLState() const ;
sal_Int32 GetNativeError() const ;
};
OUString GetName() const ;
DataTypeEnum GetADOType() const ;
void put_Type(const DataTypeEnum& _eType);
bool put_Size(sal_Int32 _nSize);
sal_Int32 GetAttributes() const ;
sal_Int32 GetPrecision() const ;
sal_Int32 GetNumericScale() const ;
ParameterDirectionEnum get_Direction() const;
void GetValue(OLEVariant& aValVar) const ;
OLEVariant GetValue() const;
bool PutValue(const OLEVariant& aVariant);
bool AppendChunk(const OLEVariant& aVariant);
};
class OTools
{
public:
/** putValue set the property value at the ado column
@param _rProps the properties where to set
@param _aPosition which property to set
@param _aValVar the value to set
*/
static void putValue(const WpADOProperties& _rProps,const OLEVariant &_aPosition,const OLEVariant &_aValVar);
class WpADOField : public WpOLEBase<ADOField>
{
// friend class WpADOFields;
public:
/** getValue returns a specific property value
@param _rProps the properties where to set
@param _aPosition the property
// Ctors, operator=
// They only call the superclass
WpADOField() = default;
WpADOField(const WpADOField& rhs) : WpOLEBase<ADOField>(rhs) {}
WpADOField& operator=(const WpADOField& rhs)
{WpOLEBase<ADOField>::operator=(rhs); return *this;}
WpADOProperties get_Properties();
sal_Int32 GetActualSize() const ;
sal_Int32 GetAttributes() const ;
sal_Int32 GetStatus() const ;
sal_Int32 GetDefinedSize() const ;
// Returns the field's name
OUString GetName() const ;
DataTypeEnum GetADOType() const ;
void get_Value(OLEVariant& aValVar) const ;
OLEVariant get_Value() const;
bool PutValue(const OLEVariant& aVariant);
sal_Int32 GetPrecision() const ;
sal_Int32 GetNumericScale() const ;
bool AppendChunk(const OLEVariant& Variant);
OLEVariant GetChunk(long Length) const;
void GetChunk(long Length,OLEVariant &aValVar) const;
OLEVariant GetOriginalValue() const;
void GetOriginalValue(OLEVariant &aValVar) const;
OLEVariant GetUnderlyingValue() const;
void GetUnderlyingValue(OLEVariant &aValVar) const;
bool PutPrecision(sal_Int8 _prec);
bool PutNumericScale(sal_Int8 _prec);
void PutADOType(DataTypeEnum eType) ;
bool PutDefinedSize(sal_Int32 _nDefSize);
bool PutAttributes(sal_Int32 _nDefSize);
};
class WpADOProperty: public WpOLEBase<ADOProperty>
{
public:
// Ctors, operator=
// They only call the superclass
WpADOProperty() = default;
WpADOProperty(const WpADOProperty& rhs) : WpOLEBase<ADOProperty>(rhs) {}
WpADOProperty& operator=(const WpADOProperty& rhs)
{WpOLEBase<ADOProperty>::operator=(rhs); return *this;}
OLEVariant GetValue() const;
void GetValue(OLEVariant &aValVar) const;
bool PutValue(const OLEVariant &aValVar) ;
OUString GetName() const ;
DataTypeEnum GetADOType() const ;
sal_Int32 GetAttributes() const ;
bool PutAttributes(sal_Int32 _nDefSize);
};
class WpADORecordset : public WpOLEBase<ADORecordset>
{
public:
// Ctors, operator=
// They only call the superclass
WpADORecordset() = default;
WpADORecordset(const WpADORecordset& rhs) : WpOLEBase<ADORecordset>() {operator=(rhs);}
WpADORecordset& operator=(const WpADORecordset& rhs)
{
WpOLEBase<ADORecordset>::operator=(rhs);
return *this;
}
void Create();
bool Open(
/* [optional][in] */ VARIANT Source,
/* [optional][in] */ VARIANT ActiveConnection,
/* [defaultvalue][in] */ CursorTypeEnum CursorType,
/* [defaultvalue][in] */ LockTypeEnum LockType,
/* [defaultvalue][in] */ sal_Int32 Options);
LockTypeEnum GetLockType();
void Close();
bool Cancel() const;
sal_Int32 get_State( );
bool Supports( /* [in] */ CursorOptionEnum CursorOptions);
PositionEnum get_AbsolutePosition();
void GetDataSource(IUnknown** pIUnknown) const ;
void PutRefDataSource(IUnknown* pIUnknown);
void GetBookmark(VARIANT& var);
OLEVariant GetBookmark();
CompareEnum CompareBookmarks(const OLEVariant& left,const OLEVariant& right);
bool SetBookmark(const OLEVariant &pSafeAr);
WpADOFields GetFields() const;
bool Move(sal_Int32 nRows, VARIANT aBmk);
bool MoveNext();
bool MovePrevious();
bool MoveFirst();
bool MoveLast();
bool IsAtBOF() const;
bool IsAtEOF() const;
bool Delete(AffectEnum eNum);
bool AddNew(const OLEVariant &FieldList,const OLEVariant &Values);
bool Update(const OLEVariant &FieldList,const OLEVariant &Values);
bool CancelUpdate();
WpADOProperties get_Properties() const;
bool NextRecordset(OLEVariant& RecordsAffected,ADORecordset** ppiRset);
bool get_RecordCount(long& _nRet) const;
bool get_MaxRecords(long& _nRet) const;
bool put_MaxRecords(ADO_LONGPTR _nRet);
bool get_CursorType(CursorTypeEnum &_nRet) const;
bool put_CursorType(CursorTypeEnum _nRet);
bool get_LockType(LockTypeEnum &_nRet) const;
bool put_LockType(LockTypeEnum _nRet);
bool get_CacheSize(sal_Int32 &_nRet) const;
bool put_CacheSize(sal_Int32 _nRet);
bool UpdateBatch(AffectEnum AffectRecords);
};
class WpADOParameter:public WpOLEBase<ADOParameter>
{
public:
// Ctors, operator=
// They only call the superclass
WpADOParameter() = default;
WpADOParameter(const WpADOParameter& rhs):WpOLEBase<ADOParameter>(rhs){}
WpADOParameter& operator=(const WpADOParameter& rhs)
{WpOLEBase<ADOParameter>::operator=(rhs); return *this;}
OUString GetName() const ;
DataTypeEnum GetADOType() const ;
void put_Type(const DataTypeEnum& _eType);
bool put_Size(sal_Int32 _nSize);
sal_Int32 GetAttributes() const ;
sal_Int32 GetPrecision() const ;
sal_Int32 GetNumericScale() const ;
ParameterDirectionEnum get_Direction() const;
void GetValue(OLEVariant& aValVar) const ;
OLEVariant GetValue() const;
bool PutValue(const OLEVariant& aVariant);
bool AppendChunk(const OLEVariant& aVariant);
};
class OTools
{
public:
/** putValue set the property value at the ado column
@param _rProps the properties where to set
@param _aPosition which property to set
@param _aValVar the value to set
*/
static void putValue(const WpADOProperties& _rProps,const OLEVariant &_aPosition,const OLEVariant &_aValVar);
/** getValue returns a specific property value
@param _rProps the properties where to set
@param _aPosition the property
@return the property value
*/
static OLEVariant getValue(const WpADOProperties& _rProps,const OLEVariant &_aPosition);
};
@return the property value
*/
static OLEVariant getValue(const WpADOProperties& _rProps,const OLEVariant &_aPosition);
};
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+16 -16
View File
@@ -26,25 +26,25 @@
namespace connectivity::ado
{
class WpADOCatalog : public WpOLEBase<_ADOCatalog>
{
public:
WpADOCatalog(_ADOCatalog* pInt = nullptr) : WpOLEBase<_ADOCatalog>(pInt){}
WpADOCatalog(const WpADOCatalog& rhs) : WpOLEBase<_ADOCatalog>(rhs) {}
class WpADOCatalog : public WpOLEBase<_ADOCatalog>
{
public:
WpADOCatalog(_ADOCatalog* pInt = nullptr) : WpOLEBase<_ADOCatalog>(pInt){}
WpADOCatalog(const WpADOCatalog& rhs) : WpOLEBase<_ADOCatalog>(rhs) {}
WpADOCatalog& operator=(const WpADOCatalog& rhs)
{WpOLEBase<_ADOCatalog>::operator=(rhs); return *this;}
WpADOCatalog& operator=(const WpADOCatalog& rhs)
{WpOLEBase<_ADOCatalog>::operator=(rhs); return *this;}
OUString GetObjectOwner(std::u16string_view _rName, ObjectTypeEnum _eNum);
OUString GetObjectOwner(std::u16string_view _rName, ObjectTypeEnum _eNum);
void putref_ActiveConnection(IDispatch* pCon);
WpADOTables get_Tables();
WpADOViews get_Views();
WpADOGroups get_Groups();
WpADOUsers get_Users();
ADOProcedures* get_Procedures();
void Create();
};
void putref_ActiveConnection(IDispatch* pCon);
WpADOTables get_Tables();
WpADOViews get_Views();
WpADOGroups get_Groups();
WpADOUsers get_Users();
ADOProcedures* get_Procedures();
void Create();
};
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+26 -26
View File
@@ -28,35 +28,35 @@
namespace connectivity::ado
{
class WpADOColumn : public WpOLEBase<_ADOColumn>
{
public:
WpADOColumn() = default;
WpADOColumn(const WpADOColumn& rhs) : WpOLEBase<_ADOColumn>(rhs) {}
class WpADOColumn : public WpOLEBase<_ADOColumn>
{
public:
WpADOColumn() = default;
WpADOColumn(const WpADOColumn& rhs) : WpOLEBase<_ADOColumn>(rhs) {}
void Create();
void Create();
WpADOColumn& operator=(const WpADOColumn& rhs)
{WpOLEBase<_ADOColumn>::operator=(rhs); return *this;}
WpADOColumn& operator=(const WpADOColumn& rhs)
{WpOLEBase<_ADOColumn>::operator=(rhs); return *this;}
OUString get_Name() const;
OUString get_RelatedColumn() const;
void put_Name(std::u16string_view _rName);
void put_RelatedColumn(std::u16string_view _rName);
DataTypeEnum get_Type() const;
void put_Type(const DataTypeEnum& _eNum) ;
sal_Int32 get_Precision() const;
void put_Precision(sal_Int32 _nPre) ;
sal_uInt8 get_NumericScale() const;
void put_NumericScale(sal_Int8 _nScale);
SortOrderEnum get_SortOrder() const;
void put_SortOrder(SortOrderEnum _nScale);
sal_Int32 get_DefinedSize() const;
ColumnAttributesEnum get_Attributes() const;
bool put_Attributes(const ColumnAttributesEnum& _eNum);
WpADOProperties get_Properties() const;
void put_ParentCatalog(/* [in] */ _ADOCatalog __RPC_FAR *ppvObject);
};
OUString get_Name() const;
OUString get_RelatedColumn() const;
void put_Name(std::u16string_view _rName);
void put_RelatedColumn(std::u16string_view _rName);
DataTypeEnum get_Type() const;
void put_Type(const DataTypeEnum& _eNum) ;
sal_Int32 get_Precision() const;
void put_Precision(sal_Int32 _nPre) ;
sal_uInt8 get_NumericScale() const;
void put_NumericScale(sal_Int8 _nScale);
SortOrderEnum get_SortOrder() const;
void put_SortOrder(SortOrderEnum _nScale);
sal_Int32 get_DefinedSize() const;
ColumnAttributesEnum get_Attributes() const;
bool put_Attributes(const ColumnAttributesEnum& _eNum);
WpADOProperties get_Properties() const;
void put_ParentCatalog(/* [in] */ _ADOCatalog __RPC_FAR *ppvObject);
};
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+18 -18
View File
@@ -26,27 +26,27 @@
namespace connectivity::ado
{
class WpADOIndex : public WpOLEBase<_ADOIndex>
{
public:
WpADOIndex() = default;
WpADOIndex(const WpADOIndex& rhs) : WpOLEBase<_ADOIndex>(rhs) {}
class WpADOIndex : public WpOLEBase<_ADOIndex>
{
public:
WpADOIndex() = default;
WpADOIndex(const WpADOIndex& rhs) : WpOLEBase<_ADOIndex>(rhs) {}
WpADOIndex& operator=(const WpADOIndex& rhs)
{WpOLEBase<_ADOIndex>::operator=(rhs); return *this;}
WpADOIndex& operator=(const WpADOIndex& rhs)
{WpOLEBase<_ADOIndex>::operator=(rhs); return *this;}
void Create();
void Create();
OUString get_Name() const;
void put_Name(std::u16string_view _rName);
bool get_Clustered() const;
void put_Clustered(bool _b);
bool get_Unique() const;
void put_Unique(bool _b);
bool get_PrimaryKey() const;
void put_PrimaryKey(bool _b);
WpADOColumns get_Columns() const;
};
OUString get_Name() const;
void put_Name(std::u16string_view _rName);
bool get_Clustered() const;
void put_Clustered(bool _b);
bool get_Unique() const;
void put_Unique(bool _b);
bool get_PrimaryKey() const;
void put_PrimaryKey(bool _b);
WpADOColumns get_Columns() const;
};
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+20 -20
View File
@@ -26,29 +26,29 @@
namespace connectivity::ado
{
class WpADOKey : public WpOLEBase<ADOKey>
{
public:
WpADOKey() = default;
WpADOKey(const WpADOKey& rhs) : WpOLEBase<ADOKey>(rhs) {}
class WpADOKey : public WpOLEBase<ADOKey>
{
public:
WpADOKey() = default;
WpADOKey(const WpADOKey& rhs) : WpOLEBase<ADOKey>(rhs) {}
WpADOKey& operator=(const WpADOKey& rhs)
{WpOLEBase<ADOKey>::operator=(rhs); return *this;}
WpADOKey& operator=(const WpADOKey& rhs)
{WpOLEBase<ADOKey>::operator=(rhs); return *this;}
void Create();
void Create();
OUString get_Name() const;
void put_Name(std::u16string_view _rName);
KeyTypeEnum get_Type() const;
void put_Type(const KeyTypeEnum& _eNum) ;
OUString get_RelatedTable() const;
void put_RelatedTable(std::u16string_view _rName);
RuleEnum get_DeleteRule() const;
void put_DeleteRule(const RuleEnum& _eNum) ;
RuleEnum get_UpdateRule() const;
void put_UpdateRule(const RuleEnum& _eNum) ;
WpADOColumns get_Columns() const;
};
OUString get_Name() const;
void put_Name(std::u16string_view _rName);
KeyTypeEnum get_Type() const;
void put_Type(const KeyTypeEnum& _eNum) ;
OUString get_RelatedTable() const;
void put_RelatedTable(std::u16string_view _rName);
RuleEnum get_DeleteRule() const;
void put_DeleteRule(const RuleEnum& _eNum) ;
RuleEnum get_UpdateRule() const;
void put_UpdateRule(const RuleEnum& _eNum) ;
WpADOColumns get_Columns() const;
};
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+20 -20
View File
@@ -26,32 +26,32 @@
namespace connectivity::ado
{
class WpADOCatalog;
class WpADOCatalog;
class WpADOTable : public WpOLEBase<_ADOTable>
{
public:
WpADOTable() = default;
WpADOTable(const WpADOTable& rhs) : WpOLEBase<_ADOTable>(rhs) {}
class WpADOTable : public WpOLEBase<_ADOTable>
{
public:
WpADOTable() = default;
WpADOTable(const WpADOTable& rhs) : WpOLEBase<_ADOTable>(rhs) {}
WpADOTable& operator=(const WpADOTable& rhs)
{WpOLEBase<_ADOTable>::operator=(rhs); return *this;}
WpADOTable& operator=(const WpADOTable& rhs)
{WpOLEBase<_ADOTable>::operator=(rhs); return *this;}
void Create();
void Create();
OUString get_Name() const;
void put_Name(std::u16string_view _rName);
OUString get_Type() const;
WpADOColumns get_Columns() const;
WpADOIndexes get_Indexes() const;
WpADOKeys get_Keys() const;
WpADOCatalog get_ParentCatalog() const;
WpADOProperties get_Properties() const;
void putref_ParentCatalog(/* [in] */ _ADOCatalog __RPC_FAR *ppvObject);
};
OUString get_Name() const;
void put_Name(std::u16string_view _rName);
OUString get_Type() const;
WpADOColumns get_Columns() const;
WpADOIndexes get_Indexes() const;
WpADOKeys get_Keys() const;
WpADOCatalog get_ParentCatalog() const;
WpADOProperties get_Properties() const;
void putref_ParentCatalog(/* [in] */ _ADOCatalog __RPC_FAR *ppvObject);
};
typedef WpOLEAppendCollection<ADOTables, WpADOTable> WpADOTables;
typedef WpOLEAppendCollection<ADOTables, WpADOTable> WpADOTables;
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+14 -14
View File
@@ -21,21 +21,21 @@
namespace connectivity::ado
{
class WpADOTable;
class WpADOKey;
class WpADOIndex;
class WpADOColumn;
class WpADOGroup;
class WpADOView;
class WpADOUser;
class WpADOTable;
class WpADOKey;
class WpADOIndex;
class WpADOColumn;
class WpADOGroup;
class WpADOView;
class WpADOUser;
typedef WpOLEAppendCollection<ADOTables, WpADOTable> WpADOTables;
typedef WpOLEAppendCollection<ADOKeys, WpADOKey> WpADOKeys;
typedef WpOLEAppendCollection<ADOIndexes, WpADOIndex> WpADOIndexes;
typedef WpOLEAppendCollection<ADOColumns, WpADOColumn> WpADOColumns;
typedef WpOLEAppendCollection<ADOGroups, WpADOGroup> WpADOGroups;
typedef WpOLEAppendCollection<ADOViews, WpADOView> WpADOViews;
typedef WpOLEAppendCollection<ADOUsers, WpADOUser> WpADOUsers;
typedef WpOLEAppendCollection<ADOTables, WpADOTable> WpADOTables;
typedef WpOLEAppendCollection<ADOKeys, WpADOKey> WpADOKeys;
typedef WpOLEAppendCollection<ADOIndexes, WpADOIndex> WpADOIndexes;
typedef WpOLEAppendCollection<ADOColumns, WpADOColumn> WpADOColumns;
typedef WpOLEAppendCollection<ADOGroups, WpADOGroup> WpADOGroups;
typedef WpOLEAppendCollection<ADOViews, WpADOView> WpADOViews;
typedef WpOLEAppendCollection<ADOUsers, WpADOUser> WpADOUsers;
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+41 -41
View File
@@ -27,61 +27,61 @@ struct ADOConnection;
namespace connectivity::ado
{
class WpADOField;
class ADOS
{
public:
static BSTR GetKeyStr();
class WpADOField;
class ADOS
{
public:
static BSTR GetKeyStr();
static const CLSID CLSID_ADOCATALOG_25;
static const IID IID_ADOCATALOG_25;
static const CLSID CLSID_ADOCATALOG_25;
static const IID IID_ADOCATALOG_25;
static const CLSID CLSID_ADOCONNECTION_21;
static const IID IID_ADOCONNECTION_21;
static const CLSID CLSID_ADOCONNECTION_21;
static const IID IID_ADOCONNECTION_21;
static const CLSID CLSID_ADOCOMMAND_21;
static const IID IID_ADOCOMMAND_21;
static const CLSID CLSID_ADOCOMMAND_21;
static const IID IID_ADOCOMMAND_21;
static const CLSID CLSID_ADORECORDSET_21;
static const IID IID_ADORECORDSET_21;
static const CLSID CLSID_ADORECORDSET_21;
static const IID IID_ADORECORDSET_21;
static const CLSID CLSID_ADOINDEX_25;
static const IID IID_ADOINDEX_25;
static const CLSID CLSID_ADOINDEX_25;
static const IID IID_ADOINDEX_25;
static const CLSID CLSID_ADOCOLUMN_25;
static const IID IID_ADOCOLUMN_25;
static const CLSID CLSID_ADOCOLUMN_25;
static const IID IID_ADOCOLUMN_25;
static const CLSID CLSID_ADOKEY_25;
static const IID IID_ADOKEY_25;
static const CLSID CLSID_ADOKEY_25;
static const IID IID_ADOKEY_25;
static const CLSID CLSID_ADOTABLE_25;
static const IID IID_ADOTABLE_25;
static const CLSID CLSID_ADOTABLE_25;
static const IID IID_ADOTABLE_25;
static const CLSID CLSID_ADOGROUP_25;
static const IID IID_ADOGROUP_25;
static const CLSID CLSID_ADOGROUP_25;
static const IID IID_ADOGROUP_25;
static const CLSID CLSID_ADOUSER_25;
static const IID IID_ADOUSER_25;
static const CLSID CLSID_ADOUSER_25;
static const IID IID_ADOUSER_25;
static const CLSID CLSID_ADOVIEW_25;
static const IID IID_ADOVIEW_25;
static const CLSID CLSID_ADOVIEW_25;
static const IID IID_ADOVIEW_25;
/// @throws css::sdbc::SQLException
/// @throws css::uno::RuntimeException
static void ThrowException(ADOConnection* _pAdoCon,const css::uno::Reference< css::uno::XInterface >& _xInterface);
static sal_Int32 MapADOType2Jdbc(DataTypeEnum eType);
static DataTypeEnum MapJdbc2ADOType(sal_Int32 _nType,sal_Int32 _nJetEngine);
static bool isJetEngine(sal_Int32 _nEngineType);
/// @throws css::sdbc::SQLException
/// @throws css::uno::RuntimeException
static void ThrowException(ADOConnection* _pAdoCon,const css::uno::Reference< css::uno::XInterface >& _xInterface);
static sal_Int32 MapADOType2Jdbc(DataTypeEnum eType);
static DataTypeEnum MapJdbc2ADOType(sal_Int32 _nType,sal_Int32 _nJetEngine);
static bool isJetEngine(sal_Int32 _nEngineType);
static ObjectTypeEnum mapObjectType2Ado(sal_Int32 objType);
static sal_Int32 mapAdoType2Object(ObjectTypeEnum objType);
static sal_Int32 mapAdoRights2Sdbc(RightsEnum eRights);
static sal_Int32 mapRights2Ado(sal_Int32 nRights);
static ObjectTypeEnum mapObjectType2Ado(sal_Int32 objType);
static sal_Int32 mapAdoType2Object(ObjectTypeEnum objType);
static sal_Int32 mapAdoRights2Sdbc(RightsEnum eRights);
static sal_Int32 mapRights2Ado(sal_Int32 nRights);
/// @throws css::sdbc::SQLException
/// @throws css::uno::RuntimeException
static WpADOField getField(ADORecordset* _pRecordSet,sal_Int32 _nColumnIndex);
};
/// @throws css::sdbc::SQLException
/// @throws css::uno::RuntimeException
static WpADOField getField(ADORecordset* _pRecordSet,sal_Int32 _nColumnIndex);
};
}
+8 -8
View File
@@ -23,15 +23,15 @@
namespace connectivity::calc
{
class OCalcConnection;
class OCalcCatalog : public file::OFileCatalog
{
public:
virtual void refreshTables() override;
class OCalcConnection;
class OCalcCatalog : public file::OFileCatalog
{
public:
virtual void refreshTables() override;
public:
OCalcCatalog(OCalcConnection* _pCon);
};
public:
OCalcCatalog(OCalcConnection* _pCon);
};
}
+104 -104
View File
@@ -34,116 +34,116 @@ namespace utl { class CloseVeto; }
namespace connectivity::calc
{
class ODriver;
class OCalcConnection : public file::OConnection
{
class ODriver;
class OCalcConnection : public file::OConnection
// the spreadsheet document:
css::uno::Reference< css::sheet::XSpreadsheetDocument > m_xDoc;
OUString m_sPassword;
OUString m_aFileName;
oslInterlockedCount m_nDocCount;
class CloseVetoButTerminateListener : public cppu::WeakComponentImplHelper<css::frame::XTerminateListener>
{
// the spreadsheet document:
css::uno::Reference< css::sheet::XSpreadsheetDocument > m_xDoc;
OUString m_sPassword;
OUString m_aFileName;
oslInterlockedCount m_nDocCount;
class CloseVetoButTerminateListener : public cppu::WeakComponentImplHelper<css::frame::XTerminateListener>
{
private:
/// close listener that vetoes so nobody else disposes m_xDoc
std::unique_ptr<utl::CloseVeto> m_pCloseListener;
/// but also listen to XDesktop and if app is terminating anyway, dispose m_xDoc while
/// its still possible to do so properly
css::uno::Reference<css::frame::XDesktop2> m_xDesktop;
osl::Mutex m_aMutex;
public:
CloseVetoButTerminateListener()
: cppu::WeakComponentImplHelper<css::frame::XTerminateListener>(m_aMutex)
{
}
void start(const css::uno::Reference<css::uno::XInterface>& rCloseable,
const css::uno::Reference<css::frame::XDesktop2>& rDesktop)
{
m_xDesktop = rDesktop;
m_xDesktop->addTerminateListener(this);
m_pCloseListener.reset(new utl::CloseVeto(rCloseable, true));
}
void stop()
{
m_pCloseListener.reset();
if (!m_xDesktop.is())
return;
m_xDesktop->removeTerminateListener(this);
m_xDesktop.clear();
}
// XTerminateListener
virtual void SAL_CALL queryTermination(const css::lang::EventObject& /*rEvent*/) override
{
}
virtual void SAL_CALL notifyTermination(const css::lang::EventObject& /*rEvent*/) override
{
stop();
}
virtual void SAL_CALL disposing() override
{
stop();
cppu::WeakComponentImplHelperBase::disposing();
}
virtual void SAL_CALL disposing(const css::lang::EventObject& rEvent) override
{
const bool bShutDown = (rEvent.Source == m_xDesktop);
if (bShutDown)
stop();
}
};
rtl::Reference<CloseVetoButTerminateListener> m_xCloseVetoButTerminateListener;
private:
/// close listener that vetoes so nobody else disposes m_xDoc
std::unique_ptr<utl::CloseVeto> m_pCloseListener;
/// but also listen to XDesktop and if app is terminating anyway, dispose m_xDoc while
/// its still possible to do so properly
css::uno::Reference<css::frame::XDesktop2> m_xDesktop;
osl::Mutex m_aMutex;
public:
OCalcConnection(ODriver* _pDriver);
virtual ~OCalcConnection() override;
virtual void construct(const OUString& _rUrl,
const css::uno::Sequence< css::beans::PropertyValue >& _rInfo ) override;
// XServiceInfo
DECLARE_SERVICE_INFO();
// OComponentHelper
virtual void SAL_CALL disposing() override;
// XConnection
virtual css::uno::Reference< css::sdbc::XDatabaseMetaData > SAL_CALL getMetaData( ) override;
virtual css::uno::Reference< css::sdbcx::XTablesSupplier > createCatalog() override;
virtual css::uno::Reference< css::sdbc::XStatement > SAL_CALL createStatement( ) override;
virtual css::uno::Reference< css::sdbc::XPreparedStatement > SAL_CALL prepareStatement( const OUString& sql ) override;
virtual css::uno::Reference< css::sdbc::XPreparedStatement > SAL_CALL prepareCall( const OUString& sql ) override;
// no interface methods
css::uno::Reference< css::sheet::XSpreadsheetDocument> const & acquireDoc();
void releaseDoc();
class ODocHolder
CloseVetoButTerminateListener()
: cppu::WeakComponentImplHelper<css::frame::XTerminateListener>(m_aMutex)
{
OCalcConnection* m_pConnection;
css::uno::Reference< css::sheet::XSpreadsheetDocument> m_xDoc;
public:
ODocHolder(OCalcConnection* _pConnection) : m_pConnection(_pConnection)
{
m_xDoc = m_pConnection->acquireDoc();
}
~ODocHolder()
{
m_xDoc.clear();
m_pConnection->releaseDoc();
}
const css::uno::Reference< css::sheet::XSpreadsheetDocument>& getDoc() const { return m_xDoc; }
};
}
void start(const css::uno::Reference<css::uno::XInterface>& rCloseable,
const css::uno::Reference<css::frame::XDesktop2>& rDesktop)
{
m_xDesktop = rDesktop;
m_xDesktop->addTerminateListener(this);
m_pCloseListener.reset(new utl::CloseVeto(rCloseable, true));
}
void stop()
{
m_pCloseListener.reset();
if (!m_xDesktop.is())
return;
m_xDesktop->removeTerminateListener(this);
m_xDesktop.clear();
}
// XTerminateListener
virtual void SAL_CALL queryTermination(const css::lang::EventObject& /*rEvent*/) override
{
}
virtual void SAL_CALL notifyTermination(const css::lang::EventObject& /*rEvent*/) override
{
stop();
}
virtual void SAL_CALL disposing() override
{
stop();
cppu::WeakComponentImplHelperBase::disposing();
}
virtual void SAL_CALL disposing(const css::lang::EventObject& rEvent) override
{
const bool bShutDown = (rEvent.Source == m_xDesktop);
if (bShutDown)
stop();
}
};
rtl::Reference<CloseVetoButTerminateListener> m_xCloseVetoButTerminateListener;
public:
OCalcConnection(ODriver* _pDriver);
virtual ~OCalcConnection() override;
virtual void construct(const OUString& _rUrl,
const css::uno::Sequence< css::beans::PropertyValue >& _rInfo ) override;
// XServiceInfo
DECLARE_SERVICE_INFO();
// OComponentHelper
virtual void SAL_CALL disposing() override;
// XConnection
virtual css::uno::Reference< css::sdbc::XDatabaseMetaData > SAL_CALL getMetaData( ) override;
virtual css::uno::Reference< css::sdbcx::XTablesSupplier > createCatalog() override;
virtual css::uno::Reference< css::sdbc::XStatement > SAL_CALL createStatement( ) override;
virtual css::uno::Reference< css::sdbc::XPreparedStatement > SAL_CALL prepareStatement( const OUString& sql ) override;
virtual css::uno::Reference< css::sdbc::XPreparedStatement > SAL_CALL prepareCall( const OUString& sql ) override;
// no interface methods
css::uno::Reference< css::sheet::XSpreadsheetDocument> const & acquireDoc();
void releaseDoc();
class ODocHolder
{
OCalcConnection* m_pConnection;
css::uno::Reference< css::sheet::XSpreadsheetDocument> m_xDoc;
public:
ODocHolder(OCalcConnection* _pConnection) : m_pConnection(_pConnection)
{
m_xDoc = m_pConnection->acquireDoc();
}
~ODocHolder()
{
m_xDoc.clear();
m_pConnection->releaseDoc();
}
const css::uno::Reference< css::sheet::XSpreadsheetDocument>& getDoc() const { return m_xDoc; }
};
};
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
@@ -22,20 +22,20 @@
#include <component/CDatabaseMetaData.hxx>
namespace connectivity::calc
{
//************ Class: java.sql.DatabaseMetaDataDate
class OCalcDatabaseMetaData : public component::OComponentDatabaseMetaData
{
//************ Class: java.sql.DatabaseMetaDataDate
class OCalcDatabaseMetaData : public component::OComponentDatabaseMetaData
{
virtual OUString SAL_CALL getURL( ) override;
virtual css::uno::Reference< css::sdbc::XResultSet > SAL_CALL getTables( const css::uno::Any& catalog, const OUString& schemaPattern, const OUString& tableNamePattern, const css::uno::Sequence< OUString >& types ) override;
protected:
virtual ~OCalcDatabaseMetaData() override;
public:
OCalcDatabaseMetaData(file::OConnection* _pCon);
};
virtual OUString SAL_CALL getURL( ) override;
virtual css::uno::Reference< css::sdbc::XResultSet > SAL_CALL getTables( const css::uno::Any& catalog, const OUString& schemaPattern, const OUString& tableNamePattern, const css::uno::Sequence< OUString >& types ) override;
protected:
virtual ~OCalcDatabaseMetaData() override;
public:
OCalcDatabaseMetaData(file::OConnection* _pCon);
};
}
+18 -18
View File
@@ -24,27 +24,27 @@
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
namespace connectivity::calc
{
/// @throws css::uno::Exception
css::uno::Reference< css::uno::XInterface >
ODriver_CreateInstance(const css::uno::Reference< css::lang::XMultiServiceFactory >& _rxFactory);
class ODriver : public file::OFileDriver
{
/// @throws css::uno::Exception
css::uno::Reference< css::uno::XInterface >
ODriver_CreateInstance(const css::uno::Reference< css::lang::XMultiServiceFactory >& _rxFactory);
public:
ODriver(const css::uno::Reference<
css::uno::XComponentContext >& _rxContext) :
file::OFileDriver(_rxContext) {}
class ODriver : public file::OFileDriver
{
public:
ODriver(const css::uno::Reference<
css::uno::XComponentContext >& _rxContext) :
file::OFileDriver(_rxContext) {}
OUString SAL_CALL getImplementationName( ) override;
OUString SAL_CALL getImplementationName( ) override;
// XDriver
virtual css::uno::Reference< css::sdbc::XConnection > SAL_CALL
connect( const OUString& url, const css::uno::Sequence<
css::beans::PropertyValue >& info ) override;
virtual sal_Bool SAL_CALL acceptsURL( const OUString& url ) override;
virtual css::uno::Sequence< css::sdbc::DriverPropertyInfo > SAL_CALL getPropertyInfo( const OUString& url, const css::uno::Sequence< css::beans::PropertyValue >& info ) override;
};
// XDriver
virtual css::uno::Reference< css::sdbc::XConnection > SAL_CALL
connect( const OUString& url, const css::uno::Sequence<
css::beans::PropertyValue >& info ) override;
virtual sal_Bool SAL_CALL acceptsURL( const OUString& url ) override;
virtual css::uno::Sequence< css::sdbc::DriverPropertyInfo > SAL_CALL getPropertyInfo( const OUString& url, const css::uno::Sequence< css::beans::PropertyValue >& info ) override;
};
}
+28 -28
View File
@@ -32,40 +32,40 @@ namespace com::sun::star::util {
namespace connectivity::calc
{
typedef component::OComponentTable OCalcTable_BASE;
class OCalcConnection;
class OCalcTable : public OCalcTable_BASE
{
typedef component::OComponentTable OCalcTable_BASE;
class OCalcConnection;
private:
std::vector<sal_Int32> m_aTypes; // holds all type for columns just to avoid to ask the propertyset
css::uno::Reference< css::sheet::XSpreadsheet > m_xSheet;
OCalcConnection* m_pCalcConnection;
sal_Int32 m_nStartCol;
sal_Int32 m_nStartRow;
sal_Int32 m_nDataCols;
bool m_bHasHeaders;
css::uno::Reference< css::util::XNumberFormats > m_xFormats;
::Date m_aNullDate;
class OCalcTable : public OCalcTable_BASE
{
private:
std::vector<sal_Int32> m_aTypes; // holds all type for columns just to avoid to ask the propertyset
css::uno::Reference< css::sheet::XSpreadsheet > m_xSheet;
OCalcConnection* m_pCalcConnection;
sal_Int32 m_nStartCol;
sal_Int32 m_nStartRow;
sal_Int32 m_nDataCols;
bool m_bHasHeaders;
css::uno::Reference< css::util::XNumberFormats > m_xFormats;
::Date m_aNullDate;
void fillColumns();
void fillColumns();
public:
OCalcTable( sdbcx::OCollection* _pTables,OCalcConnection* _pConnection,
const OUString& Name,
const OUString& Type,
const OUString& Description = OUString(),
const OUString& SchemaName = OUString(),
const OUString& CatalogName = OUString()
);
public:
OCalcTable( sdbcx::OCollection* _pTables,OCalcConnection* _pConnection,
const OUString& Name,
const OUString& Type,
const OUString& Description = OUString(),
const OUString& SchemaName = OUString(),
const OUString& CatalogName = OUString()
);
virtual bool fetchRow(OValueRefRow& _rRow, const OSQLColumns& _rCols, bool bRetrieveData) override;
virtual bool fetchRow(OValueRefRow& _rRow, const OSQLColumns& _rCols, bool bRetrieveData) override;
virtual void SAL_CALL disposing() override;
virtual void SAL_CALL disposing() override;
void construct() override;
};
void construct() override;
};
}

Some files were not shown because too many files have changed in this diff Show More