summaryrefslogtreecommitdiff
path: root/connectivity/source/inc/file
diff options
context:
space:
mode:
Diffstat (limited to 'connectivity/source/inc/file')
-rw-r--r--connectivity/source/inc/file/FCatalog.hxx58
-rw-r--r--connectivity/source/inc/file/FColumns.hxx28
-rw-r--r--connectivity/source/inc/file/FConnection.hxx188
-rw-r--r--connectivity/source/inc/file/FDatabaseMetaData.hxx298
-rw-r--r--connectivity/source/inc/file/FDateFunctions.hxx398
-rw-r--r--connectivity/source/inc/file/FDriver.hxx64
-rw-r--r--connectivity/source/inc/file/FNumericFunctions.hxx642
-rw-r--r--connectivity/source/inc/file/FPreparedStatement.hxx176
-rw-r--r--connectivity/source/inc/file/FResultSet.hxx496
-rw-r--r--connectivity/source/inc/file/FResultSetMetaData.hxx80
-rw-r--r--connectivity/source/inc/file/FStatement.hxx302
-rw-r--r--connectivity/source/inc/file/FStringFunctions.hxx470
-rw-r--r--connectivity/source/inc/file/FTable.hxx130
-rw-r--r--connectivity/source/inc/file/FTables.hxx24
-rw-r--r--connectivity/source/inc/file/fanalyzer.hxx68
15 files changed, 1711 insertions, 1711 deletions
diff --git a/connectivity/source/inc/file/FCatalog.hxx b/connectivity/source/inc/file/FCatalog.hxx
index 2bcf82df2a57..84d3a36226e3 100644
--- a/connectivity/source/inc/file/FCatalog.hxx
+++ b/connectivity/source/inc/file/FCatalog.hxx
@@ -24,36 +24,36 @@
#include <file/filedllapi.hxx>
namespace connectivity::file
+{
+ class OConnection;
+ class OOO_DLLPUBLIC_FILE SAL_NO_VTABLE OFileCatalog :
+ public connectivity::sdbcx::OCatalog
{
- class OConnection;
- class OOO_DLLPUBLIC_FILE SAL_NO_VTABLE OFileCatalog :
- public connectivity::sdbcx::OCatalog
- {
- protected:
- OConnection* m_pConnection;
-
- /** 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) override;
-
- public:
- virtual void refreshTables() override;
- virtual void refreshViews() override;
- virtual void refreshGroups() override;
- virtual void refreshUsers() override;
-
- public:
- OFileCatalog(OConnection* _pCon);
- OConnection* getConnection() { return m_pConnection; }
-
- virtual css::uno::Any SAL_CALL queryInterface( const css::uno::Type & rType ) override;
- // ::cppu::OComponentHelper
- virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes( ) override;
- virtual void SAL_CALL disposing() override;
- };
+ protected:
+ OConnection* m_pConnection;
+
+ /** 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) override;
+
+ public:
+ virtual void refreshTables() override;
+ virtual void refreshViews() override;
+ virtual void refreshGroups() override;
+ virtual void refreshUsers() override;
+
+ public:
+ OFileCatalog(OConnection* _pCon);
+ OConnection* getConnection() { return m_pConnection; }
+
+ virtual css::uno::Any SAL_CALL queryInterface( const css::uno::Type & rType ) override;
+ // ::cppu::OComponentHelper
+ virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes( ) override;
+ virtual void SAL_CALL disposing() override;
+ };
}
diff --git a/connectivity/source/inc/file/FColumns.hxx b/connectivity/source/inc/file/FColumns.hxx
index b3710e3083cc..3e45c265af7d 100644
--- a/connectivity/source/inc/file/FColumns.hxx
+++ b/connectivity/source/inc/file/FColumns.hxx
@@ -25,22 +25,22 @@
#include <file/filedllapi.hxx>
namespace connectivity::file
+{
+ class UNLESS_MERGELIBS_MORE(OOO_DLLPUBLIC_FILE) OColumns : public sdbcx::OCollection
{
- class UNLESS_MERGELIBS_MORE(OOO_DLLPUBLIC_FILE) OColumns : public sdbcx::OCollection
- {
- protected:
- OFileTable* m_pTable;
+ protected:
+ OFileTable* m_pTable;
- virtual css::uno::Reference< css::beans::XPropertySet > createObject(const OUString& _rName) override;
- virtual void impl_refresh() override;
- public:
- OColumns( OFileTable* _pTable,
- ::osl::Mutex& _rMutex,
- const ::std::vector< OUString> &_rVector
- ) : sdbcx::OCollection(*_pTable,_pTable->getConnection()->getMetaData()->supportsMixedCaseQuotedIdentifiers(),_rMutex,_rVector)
- ,m_pTable(_pTable)
- {}
- };
+ virtual css::uno::Reference< css::beans::XPropertySet > createObject(const OUString& _rName) override;
+ virtual void impl_refresh() override;
+ public:
+ OColumns( OFileTable* _pTable,
+ ::osl::Mutex& _rMutex,
+ const ::std::vector< OUString> &_rVector
+ ) : sdbcx::OCollection(*_pTable,_pTable->getConnection()->getMetaData()->supportsMixedCaseQuotedIdentifiers(),_rMutex,_rVector)
+ ,m_pTable(_pTable)
+ {}
+ };
}
diff --git a/connectivity/source/inc/file/FConnection.hxx b/connectivity/source/inc/file/FConnection.hxx
index 344445e9d322..210d2314f2b8 100644
--- a/connectivity/source/inc/file/FConnection.hxx
+++ b/connectivity/source/inc/file/FConnection.hxx
@@ -31,104 +31,104 @@
namespace connectivity::sdbcx { class OCatalog; }
namespace connectivity::file
- {
- class ODatabaseMetaData;
- class OFileDriver;
+{
+ class ODatabaseMetaData;
+ class OFileDriver;
- class OOO_DLLPUBLIC_FILE OConnection : public connectivity::OMetaConnection
+ class OOO_DLLPUBLIC_FILE OConnection : public connectivity::OMetaConnection
+ {
+ protected:
+
+ // Data attributes
+
+ unotools::WeakReference< ::connectivity::sdbcx::OCatalog > m_xCatalog;
+
+ OUString m_aFilenameExtension;
+ OFileDriver* m_pDriver; // Pointer to the owning
+ // driver object
+ css::uno::Reference< css::ucb::XDynamicResultSet > m_xDir; // directory
+ css::uno::Reference< css::ucb::XContent> m_xContent;
+
+ bool m_bAutoCommit;
+ bool m_bReadOnly;
+ bool m_bShowDeleted;
+ bool m_bCaseSensitiveExtension;
+ bool m_bCheckSQL92;
+ bool m_bDefaultTextEncoding;
+
+
+ void throwUrlNotValid(const OUString & _rsUrl,const OUString & _rsMessage);
+
+ virtual ~OConnection() override;
+ public:
+
+ OConnection(OFileDriver* _pDriver);
+
+ /// @throws css::sdbc::SQLException
+ /// @throws css::uno::RuntimeException
+ /// @throws css::uno::DeploymentException
+ virtual void construct(const OUString& _rUrl, const css::uno::Sequence< css::beans::PropertyValue >& _rInfo );
+
+ // OComponentHelper
+ virtual void SAL_CALL disposing() override;
+
+ // 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 final;
+ 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 final;
+ // XWarningsSupplier
+ virtual css::uno::Any SAL_CALL getWarnings( ) override;
+ virtual void SAL_CALL clearWarnings( ) override;
+ //XUnoTunnel
+ virtual sal_Int64 SAL_CALL getSomething( const css::uno::Sequence< sal_Int8 >& aIdentifier ) override;
+ static const css::uno::Sequence< sal_Int8 > & getUnoTunnelId();
+
+ // no interface methods
+ css::uno::Reference< css::ucb::XDynamicResultSet > getDir() const;
+ const css::uno::Reference< css::ucb::XContent>& getContent() const { return m_xContent; }
+ // create a catalog or return the catalog already created
+ virtual css::uno::Reference< css::sdbcx::XTablesSupplier > createCatalog();
+
+ bool matchesExtension( const OUString& _rExt ) const;
+
+ const OUString& getExtension() const { return m_aFilenameExtension; }
+ bool isCaseSensitiveExtension() const { return m_bCaseSensitiveExtension; }
+ OFileDriver* getDriver() const { return m_pDriver; }
+ bool showDeleted() const { return m_bShowDeleted; }
+ bool isCheckEnabled() const { return m_bCheckSQL92; }
+ bool isTextEncodingDefaulted() const { return m_bDefaultTextEncoding; }
+
+ public:
+ struct GrantAccess
{
- protected:
-
- // Data attributes
-
- unotools::WeakReference< ::connectivity::sdbcx::OCatalog > m_xCatalog;
-
- OUString m_aFilenameExtension;
- OFileDriver* m_pDriver; // Pointer to the owning
- // driver object
- css::uno::Reference< css::ucb::XDynamicResultSet > m_xDir; // directory
- css::uno::Reference< css::ucb::XContent> m_xContent;
-
- bool m_bAutoCommit;
- bool m_bReadOnly;
- bool m_bShowDeleted;
- bool m_bCaseSensitiveExtension;
- bool m_bCheckSQL92;
- bool m_bDefaultTextEncoding;
-
-
- void throwUrlNotValid(const OUString & _rsUrl,const OUString & _rsMessage);
-
- virtual ~OConnection() override;
- public:
-
- OConnection(OFileDriver* _pDriver);
-
- /// @throws css::sdbc::SQLException
- /// @throws css::uno::RuntimeException
- /// @throws css::uno::DeploymentException
- virtual void construct(const OUString& _rUrl, const css::uno::Sequence< css::beans::PropertyValue >& _rInfo );
-
- // OComponentHelper
- virtual void SAL_CALL disposing() override;
-
- // 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 final;
- 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 final;
- // XWarningsSupplier
- virtual css::uno::Any SAL_CALL getWarnings( ) override;
- virtual void SAL_CALL clearWarnings( ) override;
- //XUnoTunnel
- virtual sal_Int64 SAL_CALL getSomething( const css::uno::Sequence< sal_Int8 >& aIdentifier ) override;
- static const css::uno::Sequence< sal_Int8 > & getUnoTunnelId();
-
- // no interface methods
- css::uno::Reference< css::ucb::XDynamicResultSet > getDir() const;
- const css::uno::Reference< css::ucb::XContent>& getContent() const { return m_xContent; }
- // create a catalog or return the catalog already created
- virtual css::uno::Reference< css::sdbcx::XTablesSupplier > createCatalog();
-
- bool matchesExtension( const OUString& _rExt ) const;
-
- const OUString& getExtension() const { return m_aFilenameExtension; }
- bool isCaseSensitiveExtension() const { return m_bCaseSensitiveExtension; }
- OFileDriver* getDriver() const { return m_pDriver; }
- bool showDeleted() const { return m_bShowDeleted; }
- bool isCheckEnabled() const { return m_bCheckSQL92; }
- bool isTextEncodingDefaulted() const { return m_bDefaultTextEncoding; }
-
- public:
- struct GrantAccess
- {
- friend class ODatabaseMetaData;
- private:
- GrantAccess() { }
- };
-
- void setCaseSensitiveExtension( bool _bIsCS, GrantAccess ) { m_bCaseSensitiveExtension = _bIsCS; }
+ friend class ODatabaseMetaData;
+ private:
+ GrantAccess() { }
};
+ void setCaseSensitiveExtension( bool _bIsCS, GrantAccess ) { m_bCaseSensitiveExtension = _bIsCS; }
+ };
+
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/inc/file/FDatabaseMetaData.hxx b/connectivity/source/inc/file/FDatabaseMetaData.hxx
index 5c766c31d1f4..0dcce0f0cb34 100644
--- a/connectivity/source/inc/file/FDatabaseMetaData.hxx
+++ b/connectivity/source/inc/file/FDatabaseMetaData.hxx
@@ -24,162 +24,162 @@
#include <file/filedllapi.hxx>
namespace connectivity::file
- {
+{
- //************ Class: ODatabaseMetaData
+ //************ Class: ODatabaseMetaData
- class OOO_DLLPUBLIC_FILE SAL_NO_VTABLE ODatabaseMetaData :
- public ODatabaseMetaDataBase
- {
- 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:
- OConnection* m_pConnection; // I need the native class not only the interface
- virtual ~ODatabaseMetaData() override;
- public:
+ class OOO_DLLPUBLIC_FILE SAL_NO_VTABLE ODatabaseMetaData :
+ public ODatabaseMetaDataBase
+ {
+ 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:
+ OConnection* m_pConnection; // I need the native class not only the interface
+ virtual ~ODatabaseMetaData() 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;
+ 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 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 getTablePrivileges( const css::uno::Any& catalog, const OUString& schemaPattern, const OUString& tableNamePattern ) 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 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 getTablePrivileges( const css::uno::Any& catalog, const OUString& schemaPattern, const OUString& tableNamePattern ) 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 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::XResultSet > SAL_CALL getUDTs( const css::uno::Any& catalog, const OUString& schemaPattern, const OUString& typeNamePattern, const css::uno::Sequence< sal_Int32 >& types ) override;
+ };
}
diff --git a/connectivity/source/inc/file/FDateFunctions.hxx b/connectivity/source/inc/file/FDateFunctions.hxx
index e8eb12d0cf24..8451eb0fbf7f 100644
--- a/connectivity/source/inc/file/FDateFunctions.hxx
+++ b/connectivity/source/inc/file/FDateFunctions.hxx
@@ -22,206 +22,206 @@
#include <file/fcode.hxx>
namespace connectivity::file
+{
+ /** DAYOFWEEK(date)
+ Returns the weekday index for date (1 = Sunday, 2 = Monday, ... 7 = Saturday). These index values correspond to the ODBC standard.
+
+ > SELECT DAYOFWEEK('1998-02-03');
+ -> 3
+ */
+ class OOp_DayOfWeek : public OUnaryOperator
{
- /** DAYOFWEEK(date)
- Returns the weekday index for date (1 = Sunday, 2 = Monday, ... 7 = Saturday). These index values correspond to the ODBC standard.
-
- > SELECT DAYOFWEEK('1998-02-03');
- -> 3
- */
- class OOp_DayOfWeek : public OUnaryOperator
- {
- protected:
- virtual ORowSetValue operate(const ORowSetValue& lhs) const override;
- };
-
- /** DAYOFMONTH(date)
- Returns the day of the month for date, in the range 1 to 31:
-
- > SELECT DAYOFMONTH('1998-02-03');
- -> 3
- */
- class OOp_DayOfMonth : public OUnaryOperator
- {
- protected:
- virtual ORowSetValue operate(const ORowSetValue& lhs) const override;
- };
-
- /** DAYOFYEAR(date)
- Returns the day of the year for date, in the range 1 to 366:
-
- > SELECT DAYOFYEAR('1998-02-03');
- -> 34
-
- */
- class OOp_DayOfYear : public OUnaryOperator
- {
- protected:
- virtual ORowSetValue operate(const ORowSetValue& lhs) const override;
- };
-
- /** MONTH(date)
- Returns the month for date, in the range 1 to 12:
-
- > SELECT MONTH('1998-02-03');
- -> 2
- */
- class OOp_Month : public OUnaryOperator
- {
- protected:
- virtual ORowSetValue operate(const ORowSetValue& lhs) const override;
- };
-
- /** DAYNAME(date)
- Returns the name of the weekday for date:
-
- > SELECT DAYNAME('1998-02-05');
- -> 'Thursday'
-
- */
- class OOp_DayName : public OUnaryOperator
- {
- protected:
- virtual ORowSetValue operate(const ORowSetValue& lhs) const override;
- };
-
- /** MONTHNAME(date)
- Returns the name of the month for date:
-
- > SELECT MONTHNAME('1998-02-05');
- -> 'February'
-
- */
- class OOp_MonthName : public OUnaryOperator
- {
- protected:
- virtual ORowSetValue operate(const ORowSetValue& lhs) const override;
- };
-
- /** QUARTER(date)
- Returns the quarter of the year for date, in the range 1 to 4:
-
- > SELECT QUARTER('98-04-01');
- -> 2
-
- */
- class OOp_Quarter : public OUnaryOperator
- {
- protected:
- virtual ORowSetValue operate(const ORowSetValue& lhs) const override;
- };
-
- /** WEEK(date)
- WEEK(date,first)
- With a single argument, returns the week for date, in the range 0 to 53 (yes, there may be the beginnings of a week 53), for locations where Sunday is the first day of the week. The two-argument form of WEEK() allows you to specify whether the week starts on Sunday or Monday and whether the return value should be in the range 0-53 or 1-52. Here is a table for how the second argument works:
- Value Meaning
- 0 Week starts on Sunday and return value is in range 0-53
- 1 Week starts on Monday and return value is in range 0-53
- 2 Week starts on Sunday and return value is in range 1-53
- 3 Week starts on Monday and return value is in range 1-53 (ISO 8601)
-
- > SELECT WEEK('1998-02-20');
- -> 7
- > SELECT WEEK('1998-02-20',0);
- -> 7
- > SELECT WEEK('1998-02-20',1);
- -> 8
- > SELECT WEEK('1998-12-31',1);
- -> 53
-
- */
- class OOp_Week : public ONthOperator
- {
- protected:
- virtual ORowSetValue operate(const std::vector<ORowSetValue>& lhs) const override;
- };
-
- /** YEAR(date)
- Returns the year for date, in the range 1000 to 9999:
-
- > SELECT YEAR('98-02-03');
- -> 1998
- */
- class OOp_Year : public OUnaryOperator
- {
- protected:
- virtual ORowSetValue operate(const ORowSetValue& lhs) const override;
- };
-
- /** HOUR(time)
- Returns the hour for time, in the range 0 to 23:
-
- > SELECT HOUR('10:05:03');
- -> 10
- */
- class OOp_Hour : public OUnaryOperator
- {
- protected:
- virtual ORowSetValue operate(const ORowSetValue& lhs) const override;
- };
-
- /** MINUTE(time)
- Returns the minute for time, in the range 0 to 59:
-
- > SELECT MINUTE('98-02-03 10:05:03');
- -> 5
-
- */
- class OOp_Minute : public OUnaryOperator
- {
- protected:
- virtual ORowSetValue operate(const ORowSetValue& lhs) const override;
- };
-
- /** SECOND(time)
- Returns the second for time, in the range 0 to 59:
-
- > SELECT SECOND('10:05:03');
- -> 3
- */
- class OOp_Second : public OUnaryOperator
- {
- protected:
- virtual ORowSetValue operate(const ORowSetValue& lhs) const override;
- };
-
- /** CURDATE()
- CURRENT_DATE
- Returns today's date as a value in 'YYYY-MM-DD' or YYYYMMDD format, depending on whether the function is used in a string or numeric context:
-
- > SELECT CURDATE();
- -> '1997-12-15'
- */
- class OOp_CurDate : public ONthOperator
- {
- protected:
- virtual ORowSetValue operate(const std::vector<ORowSetValue>& lhs) const override;
- };
-
- /** CURTIME()
- CURRENT_TIME
- Returns the current time as a value in 'HH:MM:SS' or HHMMSS format, depending on whether the function is used in a string or numeric context:
-
- > SELECT CURTIME();
- -> '23:50:26'
- */
- class OOp_CurTime : public ONthOperator
- {
- protected:
- virtual ORowSetValue operate(const std::vector<ORowSetValue>& lhs) const override;
- };
-
- /** NOW()
- Returns the current date and time as a value in 'YYYY-MM-DD HH:MM:SS' or YYYYMMDDHHMMSS format, depending on whether the function is used in a string or numeric context:
-
- > SELECT NOW();
- -> '1997-12-15 23:50:26'
- */
- class OOp_Now : public ONthOperator
- {
- protected:
- virtual ORowSetValue operate(const std::vector<ORowSetValue>& lhs) const override;
- };
+ protected:
+ virtual ORowSetValue operate(const ORowSetValue& lhs) const override;
+ };
+
+ /** DAYOFMONTH(date)
+ Returns the day of the month for date, in the range 1 to 31:
+
+ > SELECT DAYOFMONTH('1998-02-03');
+ -> 3
+ */
+ class OOp_DayOfMonth : public OUnaryOperator
+ {
+ protected:
+ virtual ORowSetValue operate(const ORowSetValue& lhs) const override;
+ };
+
+ /** DAYOFYEAR(date)
+ Returns the day of the year for date, in the range 1 to 366:
+
+ > SELECT DAYOFYEAR('1998-02-03');
+ -> 34
+
+ */
+ class OOp_DayOfYear : public OUnaryOperator
+ {
+ protected:
+ virtual ORowSetValue operate(const ORowSetValue& lhs) const override;
+ };
+
+ /** MONTH(date)
+ Returns the month for date, in the range 1 to 12:
+
+ > SELECT MONTH('1998-02-03');
+ -> 2
+ */
+ class OOp_Month : public OUnaryOperator
+ {
+ protected:
+ virtual ORowSetValue operate(const ORowSetValue& lhs) const override;
+ };
+
+ /** DAYNAME(date)
+ Returns the name of the weekday for date:
+
+ > SELECT DAYNAME('1998-02-05');
+ -> 'Thursday'
+
+ */
+ class OOp_DayName : public OUnaryOperator
+ {
+ protected:
+ virtual ORowSetValue operate(const ORowSetValue& lhs) const override;
+ };
+
+ /** MONTHNAME(date)
+ Returns the name of the month for date:
+
+ > SELECT MONTHNAME('1998-02-05');
+ -> 'February'
+
+ */
+ class OOp_MonthName : public OUnaryOperator
+ {
+ protected:
+ virtual ORowSetValue operate(const ORowSetValue& lhs) const override;
+ };
+
+ /** QUARTER(date)
+ Returns the quarter of the year for date, in the range 1 to 4:
+
+ > SELECT QUARTER('98-04-01');
+ -> 2
+
+ */
+ class OOp_Quarter : public OUnaryOperator
+ {
+ protected:
+ virtual ORowSetValue operate(const ORowSetValue& lhs) const override;
+ };
+
+ /** WEEK(date)
+ WEEK(date,first)
+ With a single argument, returns the week for date, in the range 0 to 53 (yes, there may be the beginnings of a week 53), for locations where Sunday is the first day of the week. The two-argument form of WEEK() allows you to specify whether the week starts on Sunday or Monday and whether the return value should be in the range 0-53 or 1-52. Here is a table for how the second argument works:
+ Value Meaning
+ 0 Week starts on Sunday and return value is in range 0-53
+ 1 Week starts on Monday and return value is in range 0-53
+ 2 Week starts on Sunday and return value is in range 1-53
+ 3 Week starts on Monday and return value is in range 1-53 (ISO 8601)
+
+ > SELECT WEEK('1998-02-20');
+ -> 7
+ > SELECT WEEK('1998-02-20',0);
+ -> 7
+ > SELECT WEEK('1998-02-20',1);
+ -> 8
+ > SELECT WEEK('1998-12-31',1);
+ -> 53
+
+ */
+ class OOp_Week : public ONthOperator
+ {
+ protected:
+ virtual ORowSetValue operate(const std::vector<ORowSetValue>& lhs) const override;
+ };
+
+ /** YEAR(date)
+ Returns the year for date, in the range 1000 to 9999:
+
+ > SELECT YEAR('98-02-03');
+ -> 1998
+ */
+ class OOp_Year : public OUnaryOperator
+ {
+ protected:
+ virtual ORowSetValue operate(const ORowSetValue& lhs) const override;
+ };
+
+ /** HOUR(time)
+ Returns the hour for time, in the range 0 to 23:
+
+ > SELECT HOUR('10:05:03');
+ -> 10
+ */
+ class OOp_Hour : public OUnaryOperator
+ {
+ protected:
+ virtual ORowSetValue operate(const ORowSetValue& lhs) const override;
+ };
+
+ /** MINUTE(time)
+ Returns the minute for time, in the range 0 to 59:
+
+ > SELECT MINUTE('98-02-03 10:05:03');
+ -> 5
+
+ */
+ class OOp_Minute : public OUnaryOperator
+ {
+ protected:
+ virtual ORowSetValue operate(const ORowSetValue& lhs) const override;
+ };
+
+ /** SECOND(time)
+ Returns the second for time, in the range 0 to 59:
+
+ > SELECT SECOND('10:05:03');
+ -> 3
+ */
+ class OOp_Second : public OUnaryOperator
+ {
+ protected:
+ virtual ORowSetValue operate(const ORowSetValue& lhs) const override;
+ };
+
+ /** CURDATE()
+ CURRENT_DATE
+ Returns today's date as a value in 'YYYY-MM-DD' or YYYYMMDD format, depending on whether the function is used in a string or numeric context:
+
+ > SELECT CURDATE();
+ -> '1997-12-15'
+ */
+ class OOp_CurDate : public ONthOperator
+ {
+ protected:
+ virtual ORowSetValue operate(const std::vector<ORowSetValue>& lhs) const override;
+ };
+
+ /** CURTIME()
+ CURRENT_TIME
+ Returns the current time as a value in 'HH:MM:SS' or HHMMSS format, depending on whether the function is used in a string or numeric context:
+
+ > SELECT CURTIME();
+ -> '23:50:26'
+ */
+ class OOp_CurTime : public ONthOperator
+ {
+ protected:
+ virtual ORowSetValue operate(const std::vector<ORowSetValue>& lhs) const override;
+ };
+
+ /** NOW()
+ Returns the current date and time as a value in 'YYYY-MM-DD HH:MM:SS' or YYYYMMDDHHMMSS format, depending on whether the function is used in a string or numeric context:
+
+ > SELECT NOW();
+ -> '1997-12-15 23:50:26'
+ */
+ class OOp_Now : public ONthOperator
+ {
+ protected:
+ virtual ORowSetValue operate(const std::vector<ORowSetValue>& lhs) const override;
+ };
}
diff --git a/connectivity/source/inc/file/FDriver.hxx b/connectivity/source/inc/file/FDriver.hxx
index e48ced409736..0452b0ab17c8 100644
--- a/connectivity/source/inc/file/FDriver.hxx
+++ b/connectivity/source/inc/file/FDriver.hxx
@@ -28,46 +28,46 @@
#include <unotools/weakref.hxx>
namespace connectivity::file
- {
- class OConnection;
+{
+ class OConnection;
- typedef ::cppu::WeakComponentImplHelper< css::sdbc::XDriver,
- css::lang::XServiceInfo,
- css::sdbcx::XDataDefinitionSupplier> ODriver_BASE;
+ typedef ::cppu::WeakComponentImplHelper< css::sdbc::XDriver,
+ css::lang::XServiceInfo,
+ css::sdbcx::XDataDefinitionSupplier> ODriver_BASE;
- class OOO_DLLPUBLIC_FILE SAL_NO_VTABLE OFileDriver : public ODriver_BASE
- {
- protected:
- ::osl::Mutex m_aMutex;
+ class OOO_DLLPUBLIC_FILE SAL_NO_VTABLE OFileDriver : public ODriver_BASE
+ {
+ protected:
+ ::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;
- public:
- OFileDriver(css::uno::Reference< css::uno::XComponentContext > _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;
+ public:
+ OFileDriver(css::uno::Reference< css::uno::XComponentContext > _xContext);
- // 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;
- // 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;
- const css::uno::Reference< css::uno::XComponentContext >& getComponentContext() const { return m_xContext; }
- };
+ const css::uno::Reference< css::uno::XComponentContext >& getComponentContext() const { return m_xContext; }
+ };
}
diff --git a/connectivity/source/inc/file/FNumericFunctions.hxx b/connectivity/source/inc/file/FNumericFunctions.hxx
index 765f2cde8223..8ed560903685 100644
--- a/connectivity/source/inc/file/FNumericFunctions.hxx
+++ b/connectivity/source/inc/file/FNumericFunctions.hxx
@@ -22,340 +22,340 @@
#include <file/fcode.hxx>
namespace connectivity::file
+{
+ /** ABS(X)
+ Returns the absolute value of X:
+
+ > SELECT ABS(2);
+ -> 2
+ > SELECT ABS(-32);
+ -> 32
+
+ */
+ class OOp_Abs : public OUnaryOperator
{
- /** ABS(X)
- Returns the absolute value of X:
+ protected:
+ virtual ORowSetValue operate(const ORowSetValue& lhs) const override;
+ };
- > SELECT ABS(2);
- -> 2
- > SELECT ABS(-32);
- -> 32
-
- */
- class OOp_Abs : public OUnaryOperator
- {
- protected:
- virtual ORowSetValue operate(const ORowSetValue& lhs) const override;
- };
-
- /** SIGN(X)
- Returns the sign of the argument as -1, 0, or 1, depending on whether X is negative, zero, or positive:
-
- > SELECT SIGN(-32);
- -> -1
- > SELECT SIGN(0);
- -> 0
- > SELECT SIGN(234);
- -> 1
-
- */
- class OOp_Sign : public OUnaryOperator
- {
- protected:
- virtual ORowSetValue operate(const ORowSetValue& lhs) const override;
- };
-
- /** MOD(N,M)
- %
- Modulo (like the % operator in C). Returns the remainder of N divided by M:
-
- > SELECT MOD(234, 10);
- -> 4
- > SELECT 253 % 7;
- -> 1
- > SELECT MOD(29,9);
- -> 2
- > SELECT 29 MOD 9;
- -> 2
- */
- class OOp_Mod : public OBinaryOperator
- {
- protected:
- virtual ORowSetValue operate(const ORowSetValue& lhs,const ORowSetValue& rhs) const override;
- };
-
- /** FLOOR(X)
- Returns the largest integer value not greater than X:
-
- > SELECT FLOOR(1.23);
+ /** SIGN(X)
+ Returns the sign of the argument as -1, 0, or 1, depending on whether X is negative, zero, or positive:
+
+ > SELECT SIGN(-32);
+ -> -1
+ > SELECT SIGN(0);
+ -> 0
+ > SELECT SIGN(234);
-> 1
- > SELECT FLOOR(-1.23);
- -> -2
- */
- class OOp_Floor : public OUnaryOperator
- {
- protected:
- virtual ORowSetValue operate(const ORowSetValue& lhs) const override;
- };
+ */
+ class OOp_Sign : public OUnaryOperator
+ {
+ protected:
+ virtual ORowSetValue operate(const ORowSetValue& lhs) const override;
+ };
- /** CEILING(X)
- Returns the smallest integer value not less than X:
+ /** MOD(N,M)
+ %
+ Modulo (like the % operator in C). Returns the remainder of N divided by M:
- > SELECT CEILING(1.23);
+ > SELECT MOD(234, 10);
+ -> 4
+ > SELECT 253 % 7;
+ -> 1
+ > SELECT MOD(29,9);
-> 2
- > SELECT CEILING(-1.23);
+ > SELECT 29 MOD 9;
+ -> 2
+ */
+ class OOp_Mod : public OBinaryOperator
+ {
+ protected:
+ virtual ORowSetValue operate(const ORowSetValue& lhs,const ORowSetValue& rhs) const override;
+ };
+
+ /** FLOOR(X)
+ Returns the largest integer value not greater than X:
+
+ > SELECT FLOOR(1.23);
+ -> 1
+ > SELECT FLOOR(-1.23);
+ -> -2
+
+ */
+ class OOp_Floor : public OUnaryOperator
+ {
+ protected:
+ virtual ORowSetValue operate(const ORowSetValue& lhs) const override;
+ };
+
+ /** CEILING(X)
+ Returns the smallest integer value not less than X:
+
+ > SELECT CEILING(1.23);
+ -> 2
+ > SELECT CEILING(-1.23);
+ -> -1
+
+ */
+ class OOp_Ceiling : public OUnaryOperator
+ {
+ protected:
+ virtual ORowSetValue operate(const ORowSetValue& lhs) const override;
+ };
+
+ /** ROUND(X)
+ ROUND(X,D)
+ Returns the argument X, rounded to the nearest integer. With two arguments rounded to a number to D decimals.
+
+ > SELECT ROUND(-1.23);
-> -1
+ > SELECT ROUND(-1.58);
+ -> -2
+ > SELECT ROUND(1.58);
+ -> 2
+ > SELECT ROUND(1.298, 1);
+ -> 1.3
+ > SELECT ROUND(1.298, 0);
+ -> 1
+ > SELECT ROUND(23.298, -1);
+ -> 20
+ */
+ class OOp_Round : public ONthOperator
+ {
+ protected:
+ virtual ORowSetValue operate(const std::vector<ORowSetValue>& lhs) const override;
+ };
+
+ /** EXP(X)
+ Returns the value of e (the base of natural logarithms) raised to the power of X:
+
+ > SELECT EXP(2);
+ -> 7.389056
+ > SELECT EXP(-2);
+ -> 0.135335
+ */
+ class OOp_Exp : public OUnaryOperator
+ {
+ protected:
+ virtual ORowSetValue operate(const ORowSetValue& lhs) const override;
+ };
+
+ /** LN(X)
+ Returns the natural logarithm of X:
- */
- class OOp_Ceiling : public OUnaryOperator
- {
- protected:
- virtual ORowSetValue operate(const ORowSetValue& lhs) const override;
- };
-
- /** ROUND(X)
- ROUND(X,D)
- Returns the argument X, rounded to the nearest integer. With two arguments rounded to a number to D decimals.
-
- > SELECT ROUND(-1.23);
- -> -1
- > SELECT ROUND(-1.58);
- -> -2
- > SELECT ROUND(1.58);
- -> 2
- > SELECT ROUND(1.298, 1);
- -> 1.3
- > SELECT ROUND(1.298, 0);
- -> 1
- > SELECT ROUND(23.298, -1);
- -> 20
- */
- class OOp_Round : public ONthOperator
- {
- protected:
- virtual ORowSetValue operate(const std::vector<ORowSetValue>& lhs) const override;
- };
-
- /** EXP(X)
- Returns the value of e (the base of natural logarithms) raised to the power of X:
-
- > SELECT EXP(2);
- -> 7.389056
- > SELECT EXP(-2);
- -> 0.135335
- */
- class OOp_Exp : public OUnaryOperator
- {
- protected:
- virtual ORowSetValue operate(const ORowSetValue& lhs) const override;
- };
-
- /** LN(X)
- Returns the natural logarithm of X:
-
- > SELECT LN(2);
+ > SELECT LN(2);
+ -> 0.693147
+ > SELECT LN(-2);
+ -> NULL
+
+ */
+ class OOp_Ln : public OUnaryOperator
+ {
+ protected:
+ virtual ORowSetValue operate(const ORowSetValue& lhs) const override;
+ };
+
+ /** LOG(X)
+ LOG(B,X)
+ If called with one parameter, this function returns the natural logarithm of X:
+
+ > SELECT LOG(2);
-> 0.693147
- > SELECT LN(-2);
+ > SELECT LOG(-2);
-> NULL
- */
- class OOp_Ln : public OUnaryOperator
- {
- protected:
- virtual ORowSetValue operate(const ORowSetValue& lhs) const override;
- };
-
- /** LOG(X)
- LOG(B,X)
- If called with one parameter, this function returns the natural logarithm of X:
-
- > SELECT LOG(2);
- -> 0.693147
- > SELECT LOG(-2);
- -> NULL
-
- If called with two parameters, this function returns the logarithm of X for an arbitrary base B:
-
- > SELECT LOG(2,65536);
- -> 16.000000
- > SELECT LOG(1,100);
- -> NULL
- */
- class OOp_Log : public ONthOperator
- {
- protected:
- virtual ORowSetValue operate(const std::vector<ORowSetValue>& lhs) const override;
- };
-
- /** LOG10(X)
- Returns the base-10 logarithm of X:
-
- > SELECT LOG10(2);
- -> 0.301030
- > SELECT LOG10(100);
- -> 2.000000
- > SELECT LOG10(-100);
- -> NULL
- */
- class OOp_Log10 : public OUnaryOperator
- {
- protected:
- virtual ORowSetValue operate(const ORowSetValue& lhs) const override;
- };
-
- /** POWER(X,Y)
- Returns the value of X raised to the power of Y:
-
- > SELECT POW(2,2);
- -> 4.000000
- > SELECT POW(2,-2);
- -> 0.250000
- */
- class OOp_Pow : public OBinaryOperator
- {
- protected:
- virtual ORowSetValue operate(const ORowSetValue& lhs,const ORowSetValue& rhs) const override;
- };
-
- /** SQRT(X)
- Returns the non-negative square root of X:
-
- > SELECT SQRT(4);
- -> 2.000000
- > SELECT SQRT(20);
- -> 4.472136
- */
- class OOp_Sqrt : public OUnaryOperator
- {
- protected:
- virtual ORowSetValue operate(const ORowSetValue& lhs) const override;
- };
-
- /** PI()
- Returns the value of PI. The default shown number of decimals is 5, but internally uses the full double precision for PI.
-
- > SELECT PI();
- -> 3.141593
- > SELECT PI()+0.000000000000000000;
- -> 3.141592653589793238
-
- */
- class OOp_Pi : public ONthOperator
- {
- protected:
- virtual ORowSetValue operate(const std::vector<ORowSetValue>& lhs) const override;
- };
-
- /** COS(X)
- Returns the cosine of X, where X is given in radians:
-
- > SELECT COS(PI());
- -> -1.000000
- */
- class OOp_Cos : public OUnaryOperator
- {
- protected:
- virtual ORowSetValue operate(const ORowSetValue& lhs) const override;
- };
-
- /** SIN(X)
- Returns the sine of X, where X is given in radians:
-
- > SELECT SIN(PI());
- -> 0.000000
-
- */
- class OOp_Sin : public OUnaryOperator
- {
- protected:
- virtual ORowSetValue operate(const ORowSetValue& lhs) const override;
- };
- /** TAN(X)
- Returns the tangent of X, where X is given in radians:
-
- > SELECT TAN(PI()+1);
- -> 1.557408
- */
- class OOp_Tan : public OUnaryOperator
- {
- protected:
- virtual ORowSetValue operate(const ORowSetValue& lhs) const override;
- };
-
- /** ACOS(X)
- Returns the arc cosine of X, that is, the value whose cosine is X. Returns NULL if X is not in the range -1 to 1:
-
- > SELECT ACOS(1);
- -> 0.000000
- > SELECT ACOS(1.0001);
+ If called with two parameters, this function returns the logarithm of X for an arbitrary base B:
+
+ > SELECT LOG(2,65536);
+ -> 16.000000
+ > SELECT LOG(1,100);
-> NULL
- > SELECT ACOS(0);
- -> 1.570796
- */
- class OOp_ACos : public OUnaryOperator
- {
- protected:
- virtual ORowSetValue operate(const ORowSetValue& lhs) const override;
- };
-
- /** ASIN(X)
- Returns the arc sine of X, that is, the value whose sine is X. Returns NULL if X is not in the range -1 to 1:
-
- > SELECT ASIN(0.2);
- -> 0.201358
- > SELECT ASIN('foo');
- -> 0.000000
- */
- class OOp_ASin : public OUnaryOperator
- {
- protected:
- virtual ORowSetValue operate(const ORowSetValue& lhs) const override;
- };
-
- /** ATAN(X)
- Returns the arc tangent of X, that is, the value whose tangent is X:
-
- > SELECT ATAN(2);
- -> 1.107149
- > SELECT ATAN(-2);
- -> -1.107149
- */
- class OOp_ATan : public OUnaryOperator
- {
- protected:
- virtual ORowSetValue operate(const ORowSetValue& lhs) const override;
- };
-
- /** ATAN2(Y,X)
- Returns the arc tangent of the two variables X and Y. It is similar to calculating the arc tangent of Y / X, except that the signs of both arguments are used to determine the quadrant of the result:
-
- > SELECT ATAN2(-2,2);
- -> -0.785398
- > SELECT ATAN2(PI(),0);
- -> 1.570796
-
- */
- class OOp_ATan2 : public OBinaryOperator
- {
- protected:
- virtual ORowSetValue operate(const ORowSetValue& lhs,const ORowSetValue& rhs) const override;
- };
-
- /** DEGREES(X)
- Returns the argument X, converted from radians to degrees:
-
- > SELECT DEGREES(PI());
- -> 180.000000
- */
- class OOp_Degrees : public OUnaryOperator
- {
- protected:
- virtual ORowSetValue operate(const ORowSetValue& lhs) const override;
- };
-
- /** RADIANS(X)
- Returns the argument X, converted from degrees to radians:
-
- > SELECT RADIANS(90);
- -> 1.570796
-
- */
- class OOp_Radians : public OUnaryOperator
- {
- protected:
- virtual ORowSetValue operate(const ORowSetValue& lhs) const override;
- };
+ */
+ class OOp_Log : public ONthOperator
+ {
+ protected:
+ virtual ORowSetValue operate(const std::vector<ORowSetValue>& lhs) const override;
+ };
+
+ /** LOG10(X)
+ Returns the base-10 logarithm of X:
+
+ > SELECT LOG10(2);
+ -> 0.301030
+ > SELECT LOG10(100);
+ -> 2.000000
+ > SELECT LOG10(-100);
+ -> NULL
+ */
+ class OOp_Log10 : public OUnaryOperator
+ {
+ protected:
+ virtual ORowSetValue operate(const ORowSetValue& lhs) const override;
+ };
+
+ /** POWER(X,Y)
+ Returns the value of X raised to the power of Y:
+
+ > SELECT POW(2,2);
+ -> 4.000000
+ > SELECT POW(2,-2);
+ -> 0.250000
+ */
+ class OOp_Pow : public OBinaryOperator
+ {
+ protected:
+ virtual ORowSetValue operate(const ORowSetValue& lhs,const ORowSetValue& rhs) const override;
+ };
+
+ /** SQRT(X)
+ Returns the non-negative square root of X:
+
+ > SELECT SQRT(4);
+ -> 2.000000
+ > SELECT SQRT(20);
+ -> 4.472136
+ */
+ class OOp_Sqrt : public OUnaryOperator
+ {
+ protected:
+ virtual ORowSetValue operate(const ORowSetValue& lhs) const override;
+ };
+
+ /** PI()
+ Returns the value of PI. The default shown number of decimals is 5, but internally uses the full double precision for PI.
+
+ > SELECT PI();
+ -> 3.141593
+ > SELECT PI()+0.000000000000000000;
+ -> 3.141592653589793238
+
+ */
+ class OOp_Pi : public ONthOperator
+ {
+ protected:
+ virtual ORowSetValue operate(const std::vector<ORowSetValue>& lhs) const override;
+ };
+
+ /** COS(X)
+ Returns the cosine of X, where X is given in radians:
+
+ > SELECT COS(PI());
+ -> -1.000000
+ */
+ class OOp_Cos : public OUnaryOperator
+ {
+ protected:
+ virtual ORowSetValue operate(const ORowSetValue& lhs) const override;
+ };
+
+ /** SIN(X)
+ Returns the sine of X, where X is given in radians:
+
+ > SELECT SIN(PI());
+ -> 0.000000
+
+ */
+ class OOp_Sin : public OUnaryOperator
+ {
+ protected:
+ virtual ORowSetValue operate(const ORowSetValue& lhs) const override;
+ };
+ /** TAN(X)
+ Returns the tangent of X, where X is given in radians:
+
+ > SELECT TAN(PI()+1);
+ -> 1.557408
+ */
+ class OOp_Tan : public OUnaryOperator
+ {
+ protected:
+ virtual ORowSetValue operate(const ORowSetValue& lhs) const override;
+ };
+
+ /** ACOS(X)
+ Returns the arc cosine of X, that is, the value whose cosine is X. Returns NULL if X is not in the range -1 to 1:
+
+ > SELECT ACOS(1);
+ -> 0.000000
+ > SELECT ACOS(1.0001);
+ -> NULL
+ > SELECT ACOS(0);
+ -> 1.570796
+ */
+ class OOp_ACos : public OUnaryOperator
+ {
+ protected:
+ virtual ORowSetValue operate(const ORowSetValue& lhs) const override;
+ };
+
+ /** ASIN(X)
+ Returns the arc sine of X, that is, the value whose sine is X. Returns NULL if X is not in the range -1 to 1:
+
+ > SELECT ASIN(0.2);
+ -> 0.201358
+ > SELECT ASIN('foo');
+ -> 0.000000
+ */
+ class OOp_ASin : public OUnaryOperator
+ {
+ protected:
+ virtual ORowSetValue operate(const ORowSetValue& lhs) const override;
+ };
+
+ /** ATAN(X)
+ Returns the arc tangent of X, that is, the value whose tangent is X:
+
+ > SELECT ATAN(2);
+ -> 1.107149
+ > SELECT ATAN(-2);
+ -> -1.107149
+ */
+ class OOp_ATan : public OUnaryOperator
+ {
+ protected:
+ virtual ORowSetValue operate(const ORowSetValue& lhs) const override;
+ };
+
+ /** ATAN2(Y,X)
+ Returns the arc tangent of the two variables X and Y. It is similar to calculating the arc tangent of Y / X, except that the signs of both arguments are used to determine the quadrant of the result:
+
+ > SELECT ATAN2(-2,2);
+ -> -0.785398
+ > SELECT ATAN2(PI(),0);
+ -> 1.570796
+
+ */
+ class OOp_ATan2 : public OBinaryOperator
+ {
+ protected:
+ virtual ORowSetValue operate(const ORowSetValue& lhs,const ORowSetValue& rhs) const override;
+ };
+
+ /** DEGREES(X)
+ Returns the argument X, converted from radians to degrees:
+
+ > SELECT DEGREES(PI());
+ -> 180.000000
+ */
+ class OOp_Degrees : public OUnaryOperator
+ {
+ protected:
+ virtual ORowSetValue operate(const ORowSetValue& lhs) const override;
+ };
+
+ /** RADIANS(X)
+ Returns the argument X, converted from degrees to radians:
+
+ > SELECT RADIANS(90);
+ -> 1.570796
+
+ */
+ class OOp_Radians : public OUnaryOperator
+ {
+ protected:
+ virtual ORowSetValue operate(const ORowSetValue& lhs) const override;
+ };
}
diff --git a/connectivity/source/inc/file/FPreparedStatement.hxx b/connectivity/source/inc/file/FPreparedStatement.hxx
index 7adbf40d2b7f..822278eb02d2 100644
--- a/connectivity/source/inc/file/FPreparedStatement.hxx
+++ b/connectivity/source/inc/file/FPreparedStatement.hxx
@@ -28,95 +28,95 @@
#include <file/FResultSet.hxx>
namespace connectivity::file
+{
+ class OResultSetMetaData;
+
+ class OOO_DLLPUBLIC_FILE SAL_NO_VTABLE OPreparedStatement : public OStatement_BASE2,
+ public css::sdbc::XPreparedStatement,
+ public css::sdbc::XParameters,
+ public css::sdbc::XResultSetMetaDataSupplier,
+ public css::lang::XServiceInfo
+
{
- class OResultSetMetaData;
-
- class OOO_DLLPUBLIC_FILE SAL_NO_VTABLE OPreparedStatement : public OStatement_BASE2,
- public css::sdbc::XPreparedStatement,
- public css::sdbc::XParameters,
- public css::sdbc::XResultSetMetaDataSupplier,
- public css::lang::XServiceInfo
-
- {
- protected:
-
- // Data attributes
-
- OValueRefRow m_aParameterRow;
- rtl::Reference<OResultSetMetaData> m_xMetaData;
-
- ::rtl::Reference<connectivity::OSQLColumns> m_xParamColumns; // the parameter columns
-
- // factory method for resultset's
- virtual rtl::Reference<OResultSet> createResultSet() override;
- ::rtl::Reference< OResultSet > makeResultSet();
- void initResultSet(OResultSet*);
-
- void checkAndResizeParameters(sal_Int32 parameterIndex);
- void setParameter(sal_Int32 parameterIndex, const ORowSetValue& x);
-
- sal_uInt32 AddParameter(connectivity::OSQLParseNode const * pParameter,
- const css::uno::Reference< css::beans::XPropertySet>& _xCol);
- void scanParameter(OSQLParseNode* pParseNode,std::vector< OSQLParseNode*>& _rParaNodes);
- void describeColumn(OSQLParseNode const * _pParameter, OSQLParseNode const * _pNode, const OSQLTable& _xTable);
- void describeParameter();
-
- virtual void parseParamterElem(const OUString& _sColumnName,OSQLParseNode* pRow_Value_Constructor_Elem) override;
- virtual void initializeResultSet(OResultSet* _pResult) override;
-
- virtual ~OPreparedStatement() override;
- public:
- DECLARE_SERVICE_INFO();
- // a Constructor, that is needed for when Returning the Object is needed:
- OPreparedStatement( OConnection* _pConnection);
-
- virtual void construct(const OUString& sql) override;
-
- // 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;
-
- // 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;
-
- const rtl::Reference<OResultSetMetaData> & getMetaDataImpl();
- };
+ protected:
+
+ // Data attributes
+
+ OValueRefRow m_aParameterRow;
+ rtl::Reference<OResultSetMetaData> m_xMetaData;
+
+ ::rtl::Reference<connectivity::OSQLColumns> m_xParamColumns; // the parameter columns
+
+ // factory method for resultset's
+ virtual rtl::Reference<OResultSet> createResultSet() override;
+ ::rtl::Reference< OResultSet > makeResultSet();
+ void initResultSet(OResultSet*);
+
+ void checkAndResizeParameters(sal_Int32 parameterIndex);
+ void setParameter(sal_Int32 parameterIndex, const ORowSetValue& x);
+
+ sal_uInt32 AddParameter(connectivity::OSQLParseNode const * pParameter,
+ const css::uno::Reference< css::beans::XPropertySet>& _xCol);
+ void scanParameter(OSQLParseNode* pParseNode,std::vector< OSQLParseNode*>& _rParaNodes);
+ void describeColumn(OSQLParseNode const * _pParameter, OSQLParseNode const * _pNode, const OSQLTable& _xTable);
+ void describeParameter();
+
+ virtual void parseParamterElem(const OUString& _sColumnName,OSQLParseNode* pRow_Value_Constructor_Elem) override;
+ virtual void initializeResultSet(OResultSet* _pResult) override;
+
+ virtual ~OPreparedStatement() override;
+ public:
+ DECLARE_SERVICE_INFO();
+ // a Constructor, that is needed for when Returning the Object is needed:
+ OPreparedStatement( OConnection* _pConnection);
+
+ virtual void construct(const OUString& sql) override;
+
+ // 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;
+
+ // 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;
+
+ const rtl::Reference<OResultSetMetaData> & getMetaDataImpl();
+ };
}
diff --git a/connectivity/source/inc/file/FResultSet.hxx b/connectivity/source/inc/file/FResultSet.hxx
index b4c1786fd2d5..9b60dae420c4 100644
--- a/connectivity/source/inc/file/FResultSet.hxx
+++ b/connectivity/source/inc/file/FResultSet.hxx
@@ -44,259 +44,259 @@
#include "FResultSetMetaData.hxx"
namespace connectivity::file
+{
+ class OResultSetMetaData;
+
+ 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::lang::XServiceInfo,
+ css::lang::XEventListener> OResultSet_BASE;
+
+ class UNLESS_MERGELIBS_MORE(OOO_DLLPUBLIC_FILE) OResultSet :
+ public cppu::BaseMutex,
+ public ::connectivity::IResultSetHelper,
+ public OResultSet_BASE,
+ public ::comphelper::OPropertyContainer,
+ public ::comphelper::OPropertyArrayUsageHelper<OResultSet>
{
- class OResultSetMetaData;
-
- 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::lang::XServiceInfo,
- css::lang::XEventListener> OResultSet_BASE;
-
- class UNLESS_MERGELIBS_MORE(OOO_DLLPUBLIC_FILE) OResultSet :
- public cppu::BaseMutex,
- public ::connectivity::IResultSetHelper,
- public OResultSet_BASE,
- public ::comphelper::OPropertyContainer,
- public ::comphelper::OPropertyArrayUsageHelper<OResultSet>
- {
- protected:
- std::vector<sal_Int32> m_aColMapping; // pos 0 is unused so we don't have to decrement 1 every time
-
- std::vector<sal_Int32> m_aOrderbyColumnNumber;
- std::vector<TAscendingOrder> m_aOrderbyAscending;
-
- OValueRefRow m_aSelectRow;
- OValueRefRow m_aRow;
- OValueRefRow m_aEvaluateRow; // contains all values of a row
- OValueRefRow m_aInsertRow; // needed for insert by cursor
- ORefAssignValues m_aAssignValues; // needed for insert,update and parameters
- // to compare with the restrictions
- OSkipDeletedSet m_aSkipDeletedSet;
-
- ::rtl::Reference<OKeySet> m_pFileSet;
- OKeySet::iterator m_aFileSetIter;
-
-
- std::unique_ptr<OSortIndex> m_pSortIndex;
- ::rtl::Reference<connectivity::OSQLColumns> m_xColumns; // this are the select columns
- rtl::Reference<OFileTable> m_pTable;
- connectivity::OSQLParseNode* m_pParseTree;
-
- OSQLAnalyzer* m_pSQLAnalyzer;
- connectivity::OSQLParseTreeIterator& m_aSQLIterator;
-
- sal_Int32 m_nFetchSize;
- sal_Int32 m_nResultSetType;
- sal_Int32 m_nFetchDirection;
- sal_Int32 m_nResultSetConcurrency;
-
- css::uno::Reference< css::uno::XInterface> m_xStatement;
- rtl::Reference< OResultSetMetaData> m_xMetaData;
- css::uno::Reference< css::container::XNameAccess> m_xColNames; // table columns
- css::uno::Reference< css::container::XIndexAccess> m_xColsIdx; // table columns
-
-
- sal_Int32 m_nRowPos;
- sal_Int32 m_nFilePos;
- sal_Int32 m_nLastVisitedPos;
- sal_Int32 m_nRowCountResult;
- sal_Int32 m_nColumnCount;
- bool m_bWasNull;
- bool m_bInserted; // true when moveToInsertRow was called
- // set to false when cursor moved or cancel
- bool m_bRowUpdated;
- bool m_bRowInserted;
- bool m_bRowDeleted;
- bool m_bShowDeleted;
- bool m_bIsCount;
-
- static void initializeRow(OValueRefRow& _rRow,sal_Int32 _nColumnCount);
- void construct();
- //sal_Bool evaluate();
-
- bool ExecuteRow(IResultSetHelper::Movement eFirstCursorPosition,
- sal_Int32 nOffset = 1,
- bool bEvaluate = true,
- bool bRetrieveData = true);
-
- std::unique_ptr<OKeyValue> GetOrderbyKeyValue(OValueRefRow const & _rRow);
- bool IsSorted() const { return !m_aOrderbyColumnNumber.empty() && m_aOrderbyColumnNumber[0] >= 0;}
-
- // return true when the select statement is "select count(*) from table"
- bool isCount() const { return m_bIsCount; }
- /// @throws css::sdbc::SQLException
- void checkIndex(sal_Int32 columnIndex );
-
- /// @throws css::sdbc::SQLException
- /// @throws css::uno::RuntimeException
- const ORowSetValue& getValue(sal_Int32 columnIndex);
- /// @throws css::sdbc::SQLException
- /// @throws css::uno::RuntimeException
- void updateValue(sal_Int32 columnIndex,const ORowSetValue& x );
- // clear insert row
- void clearInsertRow();
- void sortRows();
- protected:
-
- using OResultSet_BASE::rBHelper;
-
- bool Move(IResultSetHelper::Movement eCursorPosition, sal_Int32 nOffset, bool bRetrieveData);
- virtual bool fillIndexValues(const css::uno::Reference< css::sdbcx::XColumnsSupplier> &_xIndex);
-
- // OPropertyArrayUsageHelper
- virtual ::cppu::IPropertyArrayHelper* createArrayHelper( ) const override;
- // OPropertySetHelper
- virtual ::cppu::IPropertyArrayHelper & SAL_CALL getInfoHelper() override;
-
- virtual ~OResultSet() override;
- public:
- DECLARE_SERVICE_INFO();
- // a Constructor, that is needed for when Returning the Object is needed:
- OResultSet( OStatement_Base* pStmt,connectivity::OSQLParseTreeIterator& _aSQLIterator);
-
- // ::cppu::OComponentHelper
- virtual void SAL_CALL disposing() override final;
- // 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;
- //XEventlistener
- virtual void SAL_CALL disposing( const css::lang::EventObject& Source ) override;
-
- // special methods
- inline sal_Int32 mapColumn(sal_Int32 column);
- void OpenImpl();
- void doTableSpecials(const OSQLTable& _xTable);
-
- sal_Int32 getRowCountResult() const { return m_nRowCountResult; }
- void setEvaluationRow(const OValueRefRow& _aRow) { m_aEvaluateRow = _aRow; }
- void setAssignValues(const ORefAssignValues& _aAssignValues) { m_aAssignValues = _aAssignValues; }
- void setBindingRow(const OValueRefRow& _aRow) { m_aRow = _aRow; }
- void setSelectRow(const OValueRefRow& _rRow)
- {
- m_aSelectRow = _rRow;
- m_nColumnCount = m_aSelectRow->size();
- }
- void setColumnMapping(std::vector<sal_Int32>&& _aColumnMapping) { m_aColMapping = std::move(_aColumnMapping); }
- void setSqlAnalyzer(OSQLAnalyzer* _pSQLAnalyzer) { m_pSQLAnalyzer = _pSQLAnalyzer; }
-
- void setOrderByColumns(std::vector<sal_Int32>&& _aColumnOrderBy) { m_aOrderbyColumnNumber = std::move(_aColumnOrderBy); }
- void setOrderByAscending(std::vector<TAscendingOrder>&& _aOrderbyAsc) { m_aOrderbyAscending = std::move(_aOrderbyAsc); }
- void setMetaData(const rtl::Reference< OResultSetMetaData>& _xMetaData) { m_xMetaData = _xMetaData;}
-
- static void setBoundedColumns(const OValueRefRow& _rRow,
- const OValueRefRow& _rSelectRow,
- const ::rtl::Reference<connectivity::OSQLColumns>& _rxColumns,
- const css::uno::Reference< css::container::XIndexAccess>& _xNames,
- bool _bSetColumnMapping,
- const css::uno::Reference< css::sdbc::XDatabaseMetaData>& _xMetaData,
- std::vector<sal_Int32>& _rColMapping);
-
- // IResultSetHelper
- virtual bool move(IResultSetHelper::Movement _eCursorPosition, sal_Int32 _nOffset, bool _bRetrieveData) override;
- virtual sal_Int32 getDriverPos() const override;
- virtual bool isRowDeleted() const override;
- };
-
- inline sal_Int32 OResultSet::mapColumn(sal_Int32 column)
+ protected:
+ std::vector<sal_Int32> m_aColMapping; // pos 0 is unused so we don't have to decrement 1 every time
+
+ std::vector<sal_Int32> m_aOrderbyColumnNumber;
+ std::vector<TAscendingOrder> m_aOrderbyAscending;
+
+ OValueRefRow m_aSelectRow;
+ OValueRefRow m_aRow;
+ OValueRefRow m_aEvaluateRow; // contains all values of a row
+ OValueRefRow m_aInsertRow; // needed for insert by cursor
+ ORefAssignValues m_aAssignValues; // needed for insert,update and parameters
+ // to compare with the restrictions
+ OSkipDeletedSet m_aSkipDeletedSet;
+
+ ::rtl::Reference<OKeySet> m_pFileSet;
+ OKeySet::iterator m_aFileSetIter;
+
+
+ std::unique_ptr<OSortIndex> m_pSortIndex;
+ ::rtl::Reference<connectivity::OSQLColumns> m_xColumns; // this are the select columns
+ rtl::Reference<OFileTable> m_pTable;
+ connectivity::OSQLParseNode* m_pParseTree;
+
+ OSQLAnalyzer* m_pSQLAnalyzer;
+ connectivity::OSQLParseTreeIterator& m_aSQLIterator;
+
+ sal_Int32 m_nFetchSize;
+ sal_Int32 m_nResultSetType;
+ sal_Int32 m_nFetchDirection;
+ sal_Int32 m_nResultSetConcurrency;
+
+ css::uno::Reference< css::uno::XInterface> m_xStatement;
+ rtl::Reference< OResultSetMetaData> m_xMetaData;
+ css::uno::Reference< css::container::XNameAccess> m_xColNames; // table columns
+ css::uno::Reference< css::container::XIndexAccess> m_xColsIdx; // table columns
+
+
+ sal_Int32 m_nRowPos;
+ sal_Int32 m_nFilePos;
+ sal_Int32 m_nLastVisitedPos;
+ sal_Int32 m_nRowCountResult;
+ sal_Int32 m_nColumnCount;
+ bool m_bWasNull;
+ bool m_bInserted; // true when moveToInsertRow was called
+ // set to false when cursor moved or cancel
+ bool m_bRowUpdated;
+ bool m_bRowInserted;
+ bool m_bRowDeleted;
+ bool m_bShowDeleted;
+ bool m_bIsCount;
+
+ static void initializeRow(OValueRefRow& _rRow,sal_Int32 _nColumnCount);
+ void construct();
+ //sal_Bool evaluate();
+
+ bool ExecuteRow(IResultSetHelper::Movement eFirstCursorPosition,
+ sal_Int32 nOffset = 1,
+ bool bEvaluate = true,
+ bool bRetrieveData = true);
+
+ std::unique_ptr<OKeyValue> GetOrderbyKeyValue(OValueRefRow const & _rRow);
+ bool IsSorted() const { return !m_aOrderbyColumnNumber.empty() && m_aOrderbyColumnNumber[0] >= 0;}
+
+ // return true when the select statement is "select count(*) from table"
+ bool isCount() const { return m_bIsCount; }
+ /// @throws css::sdbc::SQLException
+ void checkIndex(sal_Int32 columnIndex );
+
+ /// @throws css::sdbc::SQLException
+ /// @throws css::uno::RuntimeException
+ const ORowSetValue& getValue(sal_Int32 columnIndex);
+ /// @throws css::sdbc::SQLException
+ /// @throws css::uno::RuntimeException
+ void updateValue(sal_Int32 columnIndex,const ORowSetValue& x );
+ // clear insert row
+ void clearInsertRow();
+ void sortRows();
+ protected:
+
+ using OResultSet_BASE::rBHelper;
+
+ bool Move(IResultSetHelper::Movement eCursorPosition, sal_Int32 nOffset, bool bRetrieveData);
+ virtual bool fillIndexValues(const css::uno::Reference< css::sdbcx::XColumnsSupplier> &_xIndex);
+
+ // OPropertyArrayUsageHelper
+ virtual ::cppu::IPropertyArrayHelper* createArrayHelper( ) const override;
+ // OPropertySetHelper
+ virtual ::cppu::IPropertyArrayHelper & SAL_CALL getInfoHelper() override;
+
+ virtual ~OResultSet() override;
+ public:
+ DECLARE_SERVICE_INFO();
+ // a Constructor, that is needed for when Returning the Object is needed:
+ OResultSet( OStatement_Base* pStmt,connectivity::OSQLParseTreeIterator& _aSQLIterator);
+
+ // ::cppu::OComponentHelper
+ virtual void SAL_CALL disposing() override final;
+ // 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;
+ //XEventlistener
+ virtual void SAL_CALL disposing( const css::lang::EventObject& Source ) override;
+
+ // special methods
+ inline sal_Int32 mapColumn(sal_Int32 column);
+ void OpenImpl();
+ void doTableSpecials(const OSQLTable& _xTable);
+
+ sal_Int32 getRowCountResult() const { return m_nRowCountResult; }
+ void setEvaluationRow(const OValueRefRow& _aRow) { m_aEvaluateRow = _aRow; }
+ void setAssignValues(const ORefAssignValues& _aAssignValues) { m_aAssignValues = _aAssignValues; }
+ void setBindingRow(const OValueRefRow& _aRow) { m_aRow = _aRow; }
+ void setSelectRow(const OValueRefRow& _rRow)
{
- sal_Int32 map = column;
+ m_aSelectRow = _rRow;
+ m_nColumnCount = m_aSelectRow->size();
+ }
+ void setColumnMapping(std::vector<sal_Int32>&& _aColumnMapping) { m_aColMapping = std::move(_aColumnMapping); }
+ void setSqlAnalyzer(OSQLAnalyzer* _pSQLAnalyzer) { m_pSQLAnalyzer = _pSQLAnalyzer; }
+
+ void setOrderByColumns(std::vector<sal_Int32>&& _aColumnOrderBy) { m_aOrderbyColumnNumber = std::move(_aColumnOrderBy); }
+ void setOrderByAscending(std::vector<TAscendingOrder>&& _aOrderbyAsc) { m_aOrderbyAscending = std::move(_aOrderbyAsc); }
+ void setMetaData(const rtl::Reference< OResultSetMetaData>& _xMetaData) { m_xMetaData = _xMetaData;}
+
+ static void setBoundedColumns(const OValueRefRow& _rRow,
+ const OValueRefRow& _rSelectRow,
+ const ::rtl::Reference<connectivity::OSQLColumns>& _rxColumns,
+ const css::uno::Reference< css::container::XIndexAccess>& _xNames,
+ bool _bSetColumnMapping,
+ const css::uno::Reference< css::sdbc::XDatabaseMetaData>& _xMetaData,
+ std::vector<sal_Int32>& _rColMapping);
+
+ // IResultSetHelper
+ virtual bool move(IResultSetHelper::Movement _eCursorPosition, sal_Int32 _nOffset, bool _bRetrieveData) override;
+ virtual sal_Int32 getDriverPos() const override;
+ virtual bool isRowDeleted() const override;
+ };
+
+ inline sal_Int32 OResultSet::mapColumn(sal_Int32 column)
+ {
+ sal_Int32 map = column;
- OSL_ENSURE(column > 0, "file::OResultSet::mapColumn: invalid column index!");
- // the first column (index 0) is for convenience only. The first real select column is number 1.
- if ((column > 0) && (o3tl::make_unsigned(column) < m_aColMapping.size()))
- map = m_aColMapping[column];
+ OSL_ENSURE(column > 0, "file::OResultSet::mapColumn: invalid column index!");
+ // the first column (index 0) is for convenience only. The first real select column is number 1.
+ if ((column > 0) && (o3tl::make_unsigned(column) < m_aColMapping.size()))
+ map = m_aColMapping[column];
- return map;
- }
+ return map;
+ }
}
diff --git a/connectivity/source/inc/file/FResultSetMetaData.hxx b/connectivity/source/inc/file/FResultSetMetaData.hxx
index dee656a915f4..a99507803a7f 100644
--- a/connectivity/source/inc/file/FResultSetMetaData.hxx
+++ b/connectivity/source/inc/file/FResultSetMetaData.hxx
@@ -25,51 +25,51 @@
#include <rtl/ref.hxx>
namespace connectivity::file
- {
- class OFileTable;
+{
+ class OFileTable;
- //************ 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
- {
- OUString m_aTableName;
- ::rtl::Reference<connectivity::OSQLColumns> m_xColumns;
- OFileTable* m_pTable;
+ class OResultSetMetaData :
+ public OResultSetMetaData_BASE
+ {
+ OUString m_aTableName;
+ ::rtl::Reference<connectivity::OSQLColumns> m_xColumns;
+ OFileTable* m_pTable;
- /// @throws css::sdbc::SQLException
- /// @throws css::uno::RuntimeException
- void checkColumnIndex(sal_Int32 column);
- protected:
- virtual ~OResultSetMetaData() override;
- public:
- // a Constructor, that is needed for when Returning the Object is needed:
- OResultSetMetaData(::rtl::Reference<connectivity::OSQLColumns> _xColumns, OUString _aTableName, OFileTable* _pTable);
+ /// @throws css::sdbc::SQLException
+ /// @throws css::uno::RuntimeException
+ void checkColumnIndex(sal_Int32 column);
+ protected:
+ virtual ~OResultSetMetaData() override;
+ public:
+ // a Constructor, that is needed for when Returning the Object is needed:
+ OResultSetMetaData(::rtl::Reference<connectivity::OSQLColumns> _xColumns, OUString _aTableName, OFileTable* _pTable);
- 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;
+ };
}
diff --git a/connectivity/source/inc/file/FStatement.hxx b/connectivity/source/inc/file/FStatement.hxx
index 52fbd3d2850f..393d587e2a39 100644
--- a/connectivity/source/inc/file/FStatement.hxx
+++ b/connectivity/source/inc/file/FStatement.hxx
@@ -39,158 +39,158 @@
#include <unotools/weakref.hxx>
namespace connectivity::file
+{
+ class OResultSet;
+ class OFileTable;
+ typedef ::cppu::WeakComponentImplHelper< css::sdbc::XWarningsSupplier,
+ css::util::XCancellable,
+ css::sdbc::XCloseable> OStatement_BASE;
+
+
+ //************ Class: java.sql.Statement
+
+ class OOO_DLLPUBLIC_FILE OStatement_Base :
+ public cppu::BaseMutex,
+ public OStatement_BASE,
+ public ::comphelper::OPropertyContainer,
+ public ::comphelper::OPropertyArrayUsageHelper<OStatement_Base>
+
+ {
+ protected:
+ std::vector<sal_Int32> m_aColMapping; // pos 0 is unused so we don't have to decrement 1 every time
+ std::vector<sal_Int32> m_aParameterIndexes; // maps the parameter index to column index
+ std::vector<sal_Int32> m_aOrderbyColumnNumber;
+ std::vector<TAscendingOrder> m_aOrderbyAscending;
+
+ css::sdbc::SQLWarning m_aLastWarning;
+ unotools::WeakReference< OResultSet> m_xResultSet; // The last ResultSet created
+ css::uno::Reference< css::sdbc::XDatabaseMetaData> m_xDBMetaData;
+ css::uno::Reference< css::container::XNameAccess> m_xColNames; // table columns // for this Statement
+
+
+ connectivity::OSQLParser m_aParser;
+ connectivity::OSQLParseTreeIterator m_aSQLIterator;
+
+ rtl::Reference<OConnection> m_pConnection;// The owning Connection object
+ connectivity::OSQLParseNode* m_pParseTree;
+ std::unique_ptr<OSQLAnalyzer> m_pSQLAnalyzer; //the sql analyzer used by the resultset
+
+ rtl::Reference<OFileTable> m_pTable; // the current table
+ OValueRefRow m_aSelectRow;
+ OValueRefRow m_aRow;
+ OValueRefRow m_aEvaluateRow; // contains all values of a row
+ ORefAssignValues m_aAssignValues; // needed for insert,update and parameters
+ // to compare with the restrictions
+
+ 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;
+
+ protected:
+ // initialize the column index map (mapping select columns to table columns)
+ void createColumnMapping();
+ // searches the statement for sort criteria
+ void analyzeSQL();
+ void setOrderbyColumn( connectivity::OSQLParseNode const * pColumnRef,
+ connectivity::OSQLParseNode const * pAscendingDescending);
+
+ virtual void initializeResultSet(OResultSet* _pResult);
+
+ /// @throws css::sdbc::SQLException
+ /// @throws css::uno::RuntimeException
+ void closeResultSet();
+
+ void disposeResultSet();
+ void GetAssignValues();
+ void SetAssignValue(const OUString& aColumnName,
+ const OUString& aValue,
+ bool bSetNull = false,
+ sal_uInt32 nParameter=SQL_NO_PARAMETER);
+ void ParseAssignValues( const std::vector< OUString>& aColumnNameList,
+ connectivity::OSQLParseNode* pRow_Value_Constructor_Elem, sal_Int32 nIndex);
+
+ virtual void parseParamterElem(const OUString& _sColumnName,OSQLParseNode* pRow_Value_Constructor_Elem);
+ // factory method for resultset's
+ virtual rtl::Reference<OResultSet> createResultSet() = 0;
+ // OPropertyArrayUsageHelper
+ virtual ::cppu::IPropertyArrayHelper* createArrayHelper( ) const override;
+ // OPropertySetHelper
+ virtual ::cppu::IPropertyArrayHelper & SAL_CALL getInfoHelper() override;
+ virtual ~OStatement_Base() override;
+ public:
+ connectivity::OSQLParseNode* getParseTree() const { return m_pParseTree;}
+
+ OStatement_Base(OConnection* _pConnection );
+
+ OConnection* getOwnConnection() const { return m_pConnection.get(); }
+
+ using OStatement_BASE::operator css::uno::Reference< css::uno::XInterface >;
+
+ /// @throws css::sdbc::SQLException
+ /// @throws css::uno::RuntimeException
+ virtual void construct(const OUString& sql);
+
+ // OComponentHelper
+ virtual void SAL_CALL disposing() override;
+ // XInterface
+ // virtual void SAL_CALL release() throw(css::uno::RuntimeException) = 0;
+ 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;
+ // XCancellable
+ virtual void SAL_CALL cancel( ) override;
+ // XCloseable
+ virtual void SAL_CALL close( ) override;
+ };
+
+ class OOO_DLLPUBLIC_FILE OStatement_BASE2 : public OStatement_Base
+
+ {
+ public:
+ OStatement_BASE2(OConnection* _pConnection ) : OStatement_Base(_pConnection ) {}
+ // OComponentHelper
+ virtual void SAL_CALL disposing() override;
+ // XInterface
+ virtual void SAL_CALL release() noexcept override;
+ };
+
+ typedef ::cppu::ImplHelper2< css::sdbc::XStatement,css::lang::XServiceInfo > OStatement_XStatement;
+ class OOO_DLLPUBLIC_FILE OStatement :
+ public OStatement_BASE2,
+ public OStatement_XStatement
{
- class OResultSet;
- class OFileTable;
- typedef ::cppu::WeakComponentImplHelper< css::sdbc::XWarningsSupplier,
- css::util::XCancellable,
- css::sdbc::XCloseable> OStatement_BASE;
-
-
- //************ Class: java.sql.Statement
-
- class OOO_DLLPUBLIC_FILE OStatement_Base :
- public cppu::BaseMutex,
- public OStatement_BASE,
- public ::comphelper::OPropertyContainer,
- public ::comphelper::OPropertyArrayUsageHelper<OStatement_Base>
-
- {
- protected:
- std::vector<sal_Int32> m_aColMapping; // pos 0 is unused so we don't have to decrement 1 every time
- std::vector<sal_Int32> m_aParameterIndexes; // maps the parameter index to column index
- std::vector<sal_Int32> m_aOrderbyColumnNumber;
- std::vector<TAscendingOrder> m_aOrderbyAscending;
-
- css::sdbc::SQLWarning m_aLastWarning;
- unotools::WeakReference< OResultSet> m_xResultSet; // The last ResultSet created
- css::uno::Reference< css::sdbc::XDatabaseMetaData> m_xDBMetaData;
- css::uno::Reference< css::container::XNameAccess> m_xColNames; // table columns // for this Statement
-
-
- connectivity::OSQLParser m_aParser;
- connectivity::OSQLParseTreeIterator m_aSQLIterator;
-
- rtl::Reference<OConnection> m_pConnection;// The owning Connection object
- connectivity::OSQLParseNode* m_pParseTree;
- std::unique_ptr<OSQLAnalyzer> m_pSQLAnalyzer; //the sql analyzer used by the resultset
-
- rtl::Reference<OFileTable> m_pTable; // the current table
- OValueRefRow m_aSelectRow;
- OValueRefRow m_aRow;
- OValueRefRow m_aEvaluateRow; // contains all values of a row
- ORefAssignValues m_aAssignValues; // needed for insert,update and parameters
- // to compare with the restrictions
-
- 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;
-
- protected:
- // initialize the column index map (mapping select columns to table columns)
- void createColumnMapping();
- // searches the statement for sort criteria
- void analyzeSQL();
- void setOrderbyColumn( connectivity::OSQLParseNode const * pColumnRef,
- connectivity::OSQLParseNode const * pAscendingDescending);
-
- virtual void initializeResultSet(OResultSet* _pResult);
-
- /// @throws css::sdbc::SQLException
- /// @throws css::uno::RuntimeException
- void closeResultSet();
-
- void disposeResultSet();
- void GetAssignValues();
- void SetAssignValue(const OUString& aColumnName,
- const OUString& aValue,
- bool bSetNull = false,
- sal_uInt32 nParameter=SQL_NO_PARAMETER);
- void ParseAssignValues( const std::vector< OUString>& aColumnNameList,
- connectivity::OSQLParseNode* pRow_Value_Constructor_Elem, sal_Int32 nIndex);
-
- virtual void parseParamterElem(const OUString& _sColumnName,OSQLParseNode* pRow_Value_Constructor_Elem);
- // factory method for resultset's
- virtual rtl::Reference<OResultSet> createResultSet() = 0;
- // OPropertyArrayUsageHelper
- virtual ::cppu::IPropertyArrayHelper* createArrayHelper( ) const override;
- // OPropertySetHelper
- virtual ::cppu::IPropertyArrayHelper & SAL_CALL getInfoHelper() override;
- virtual ~OStatement_Base() override;
- public:
- connectivity::OSQLParseNode* getParseTree() const { return m_pParseTree;}
-
- OStatement_Base(OConnection* _pConnection );
-
- OConnection* getOwnConnection() const { return m_pConnection.get(); }
-
- using OStatement_BASE::operator css::uno::Reference< css::uno::XInterface >;
-
- /// @throws css::sdbc::SQLException
- /// @throws css::uno::RuntimeException
- virtual void construct(const OUString& sql);
-
- // OComponentHelper
- virtual void SAL_CALL disposing() override;
- // XInterface
- // virtual void SAL_CALL release() throw(css::uno::RuntimeException) = 0;
- 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;
- // XCancellable
- virtual void SAL_CALL cancel( ) override;
- // XCloseable
- virtual void SAL_CALL close( ) override;
- };
-
- class OOO_DLLPUBLIC_FILE OStatement_BASE2 : public OStatement_Base
-
- {
- public:
- OStatement_BASE2(OConnection* _pConnection ) : OStatement_Base(_pConnection ) {}
- // OComponentHelper
- virtual void SAL_CALL disposing() override;
- // XInterface
- virtual void SAL_CALL release() noexcept override;
- };
-
- typedef ::cppu::ImplHelper2< css::sdbc::XStatement,css::lang::XServiceInfo > OStatement_XStatement;
- class OOO_DLLPUBLIC_FILE OStatement :
- public OStatement_BASE2,
- public OStatement_XStatement
- {
- protected:
- // factory method for resultset's
- virtual rtl::Reference<OResultSet> createResultSet() override;
- public:
- // a Constructor, that is needed for when Returning the Object is needed:
- OStatement( OConnection* _pConnection) : OStatement_BASE2( _pConnection){}
- DECLARE_SERVICE_INFO();
-
- 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;
-
- // 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 ;
- };
+ protected:
+ // factory method for resultset's
+ virtual rtl::Reference<OResultSet> createResultSet() override;
+ public:
+ // a Constructor, that is needed for when Returning the Object is needed:
+ OStatement( OConnection* _pConnection) : OStatement_BASE2( _pConnection){}
+ DECLARE_SERVICE_INFO();
+
+ 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;
+
+ // 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 ;
+ };
}
diff --git a/connectivity/source/inc/file/FStringFunctions.hxx b/connectivity/source/inc/file/FStringFunctions.hxx
index b3d72294fa68..a4f622293dc0 100644
--- a/connectivity/source/inc/file/FStringFunctions.hxx
+++ b/connectivity/source/inc/file/FStringFunctions.hxx
@@ -22,247 +22,247 @@
#include <file/fcode.hxx>
namespace connectivity::file
+{
+ /** UCASE(str)
+ UPPER(str)
+ Returns the string str with all characters changed to uppercase according to the current character set mapping (the default is ISO-8859-1 Latin1):
+
+ > SELECT UCASE('Hej');
+ -> 'HEJ'
+
+ */
+ class OOp_Upper : public OUnaryOperator
{
- /** UCASE(str)
- UPPER(str)
- Returns the string str with all characters changed to uppercase according to the current character set mapping (the default is ISO-8859-1 Latin1):
-
- > SELECT UCASE('Hej');
- -> 'HEJ'
-
- */
- class OOp_Upper : public OUnaryOperator
- {
- protected:
- virtual ORowSetValue operate(const ORowSetValue& lhs) const override;
- };
-
- /** LCASE(str)
- LOWER(str)
- Returns the string str with all characters changed to lowercase according to the current character set mapping (the default is ISO-8859-1 Latin1):
-
- > SELECT LCASE('QUADRATICALLY');
- -> 'quadratically'
-
- */
- class OOp_Lower : public OUnaryOperator
- {
- protected:
- virtual ORowSetValue operate(const ORowSetValue& lhs) const override;
- };
-
- /** ASCII(str)
- Returns the ASCII code value of the leftmost character of the string str. Returns 0 if str is the empty string. Returns NULL if str is NULL:
-
- > SELECT ASCII('2');
- -> 50
- > SELECT ASCII(2);
- -> 50
- > SELECT ASCII('dx');
- -> 100
-
- */
- class OOp_Ascii : public OUnaryOperator
- {
- protected:
- virtual ORowSetValue operate(const ORowSetValue& lhs) const override;
- };
-
- /** LENGTH(str)
- OCTET_LENGTH(str)
- CHAR_LENGTH(str)
- CHARACTER_LENGTH(str)
- Returns the length of the string str:
-
- > SELECT LENGTH('text');
- -> 4
- > SELECT OCTET_LENGTH('text');
- -> 4
-
- */
- class OOp_CharLength : public OUnaryOperator
- {
- protected:
- virtual ORowSetValue operate(const ORowSetValue& lhs) const override;
- };
-
- /** CHAR(N,...)
- CHAR() interprets the arguments as integers and returns a string consisting of the characters given by the ASCII code values of those integers. NULL values are skipped:
-
- > SELECT CHAR(ascii('t'),ascii('e'),ascii('s'),ascii('t'));
- -> 'test'
- > SELECT CHAR(77,77.3,'77.3');
- -> 'MMM'
-
- */
- class OOp_Char : public ONthOperator
- {
- protected:
- virtual ORowSetValue operate(const std::vector<ORowSetValue>& lhs) const override;
- };
-
- /** CONCAT(str1,str2,...)
- Returns the string that results from concatenating the arguments. Returns NULL if any argument is NULL. May have more than 2 arguments. A numeric argument is converted to the equivalent string form:
-
- > SELECT CONCAT('OO', 'o', 'OO');
- -> 'OOoOO'
- > SELECT CONCAT('OO', NULL, 'OO');
- -> NULL
- > SELECT CONCAT(14.3);
- -> '14.3'
-
- */
- class OOp_Concat : public ONthOperator
- {
- protected:
- virtual ORowSetValue operate(const std::vector<ORowSetValue>& lhs) const override;
- };
-
- /** LOCATE(substr,str)
- POSITION(substr IN str)
- Returns the position of the first occurrence of substring substr in string str. Returns 0 if substr is not in str:
-
- > SELECT LOCATE('bar', 'foobarbar');
- -> 4
- > SELECT LOCATE('xbar', 'foobar');
- -> 0
- LOCATE(substr,str,pos)
- Returns the position of the first occurrence of substring substr in string str, starting at position pos. Returns 0 if substr is not in str:
-
- > SELECT LOCATE('bar', 'foobarbar',5);
- -> 7
-
- */
- class OOp_Locate : public ONthOperator
- {
- protected:
- virtual ORowSetValue operate(const std::vector<ORowSetValue>& lhs) const override;
- };
-
- /** SUBSTRING(str,pos)
- SUBSTRING(str FROM pos)
- Returns a substring from string str starting at position pos:
-
- > SELECT SUBSTRING('Quadratically',5);
- -> 'ratically'
- > SELECT SUBSTRING('foobarbar' FROM 4);
- -> 'barbar'
- SUBSTRING(str,pos,len)
- SUBSTRING(str FROM pos FOR len)
- Returns a substring len characters long from string str, starting at position pos. The variant form that uses FROM is SQL-92 syntax:
-
- > SELECT SUBSTRING('Quadratically',5,6);
- -> 'ratica'
-
- */
- class OOp_SubString : public ONthOperator
- {
- protected:
- virtual ORowSetValue operate(const std::vector<ORowSetValue>& lhs) const override;
- };
-
- /** LTRIM(str)
- Returns the string str with leading space characters removed:
-
- > SELECT LTRIM(' barbar');
- -> 'barbar'
+ protected:
+ virtual ORowSetValue operate(const ORowSetValue& lhs) const override;
+ };
+
+ /** LCASE(str)
+ LOWER(str)
+ Returns the string str with all characters changed to lowercase according to the current character set mapping (the default is ISO-8859-1 Latin1):
+
+ > SELECT LCASE('QUADRATICALLY');
+ -> 'quadratically'
+
+ */
+ class OOp_Lower : public OUnaryOperator
+ {
+ protected:
+ virtual ORowSetValue operate(const ORowSetValue& lhs) const override;
+ };
+
+ /** ASCII(str)
+ Returns the ASCII code value of the leftmost character of the string str. Returns 0 if str is the empty string. Returns NULL if str is NULL:
+
+ > SELECT ASCII('2');
+ -> 50
+ > SELECT ASCII(2);
+ -> 50
+ > SELECT ASCII('dx');
+ -> 100
+
+ */
+ class OOp_Ascii : public OUnaryOperator
+ {
+ protected:
+ virtual ORowSetValue operate(const ORowSetValue& lhs) const override;
+ };
+
+ /** LENGTH(str)
+ OCTET_LENGTH(str)
+ CHAR_LENGTH(str)
+ CHARACTER_LENGTH(str)
+ Returns the length of the string str:
+
+ > SELECT LENGTH('text');
+ -> 4
+ > SELECT OCTET_LENGTH('text');
+ -> 4
+
+ */
+ class OOp_CharLength : public OUnaryOperator
+ {
+ protected:
+ virtual ORowSetValue operate(const ORowSetValue& lhs) const override;
+ };
- */
- class OOp_LTrim : public OUnaryOperator
- {
- protected:
- virtual ORowSetValue operate(const ORowSetValue& lhs) const override;
- };
+ /** CHAR(N,...)
+ CHAR() interprets the arguments as integers and returns a string consisting of the characters given by the ASCII code values of those integers. NULL values are skipped:
+
+ > SELECT CHAR(ascii('t'),ascii('e'),ascii('s'),ascii('t'));
+ -> 'test'
+ > SELECT CHAR(77,77.3,'77.3');
+ -> 'MMM'
+
+ */
+ class OOp_Char : public ONthOperator
+ {
+ protected:
+ virtual ORowSetValue operate(const std::vector<ORowSetValue>& lhs) const override;
+ };
+
+ /** CONCAT(str1,str2,...)
+ Returns the string that results from concatenating the arguments. Returns NULL if any argument is NULL. May have more than 2 arguments. A numeric argument is converted to the equivalent string form:
+
+ > SELECT CONCAT('OO', 'o', 'OO');
+ -> 'OOoOO'
+ > SELECT CONCAT('OO', NULL, 'OO');
+ -> NULL
+ > SELECT CONCAT(14.3);
+ -> '14.3'
+
+ */
+ class OOp_Concat : public ONthOperator
+ {
+ protected:
+ virtual ORowSetValue operate(const std::vector<ORowSetValue>& lhs) const override;
+ };
+
+ /** LOCATE(substr,str)
+ POSITION(substr IN str)
+ Returns the position of the first occurrence of substring substr in string str. Returns 0 if substr is not in str:
+
+ > SELECT LOCATE('bar', 'foobarbar');
+ -> 4
+ > SELECT LOCATE('xbar', 'foobar');
+ -> 0
+ LOCATE(substr,str,pos)
+ Returns the position of the first occurrence of substring substr in string str, starting at position pos. Returns 0 if substr is not in str:
+
+ > SELECT LOCATE('bar', 'foobarbar',5);
+ -> 7
+
+ */
+ class OOp_Locate : public ONthOperator
+ {
+ protected:
+ virtual ORowSetValue operate(const std::vector<ORowSetValue>& lhs) const override;
+ };
- /** RTRIM(str)
- Returns the string str with trailing space characters removed:
+ /** SUBSTRING(str,pos)
+ SUBSTRING(str FROM pos)
+ Returns a substring from string str starting at position pos:
- > SELECT RTRIM('barbar ');
+ > SELECT SUBSTRING('Quadratically',5);
+ -> 'ratically'
+ > SELECT SUBSTRING('foobarbar' FROM 4);
-> 'barbar'
+ SUBSTRING(str,pos,len)
+ SUBSTRING(str FROM pos FOR len)
+ Returns a substring len characters long from string str, starting at position pos. The variant form that uses FROM is SQL-92 syntax:
+
+ > SELECT SUBSTRING('Quadratically',5,6);
+ -> 'ratica'
+
+ */
+ class OOp_SubString : public ONthOperator
+ {
+ protected:
+ virtual ORowSetValue operate(const std::vector<ORowSetValue>& lhs) const override;
+ };
+
+ /** LTRIM(str)
+ Returns the string str with leading space characters removed:
- */
- class OOp_RTrim : public OUnaryOperator
- {
- protected:
- virtual ORowSetValue operate(const ORowSetValue& lhs) const override;
- };
-
- /** SPACE(N)
- Returns a string consisting of N space characters:
-
- > SELECT SPACE(6);
- -> ' '
-
- */
- class OOp_Space : public OUnaryOperator
- {
- protected:
- virtual ORowSetValue operate(const ORowSetValue& lhs) const override;
- };
-
- /** REPLACE(str,from_str,to_str)
- Returns the string str with all occurrences of the string from_str replaced by the string to_str:
-
- > SELECT REPLACE('www.OOo.com', 'w', 'Ww');
- -> 'WwWwWw.OOo.com'
-
- */
- class OOp_Replace : public ONthOperator
- {
- protected:
- virtual ORowSetValue operate(const std::vector<ORowSetValue>& lhs) const override;
- };
-
- /** REPEAT(str,count)
- Returns a string consisting of the string str repeated count times. If count <= 0, returns an empty string. Returns NULL if str or count are NULL:
-
- > SELECT REPEAT('OOo', 3);
- -> 'OOoOOoOOo'
-
- */
- class OOp_Repeat : public OBinaryOperator
- {
- protected:
- virtual ORowSetValue operate(const ORowSetValue& lhs,const ORowSetValue& rhs) const override;
- };
-
- /** INSERT(str,pos,len,newstr)
- Returns the string str, with the substring beginning at position pos and len characters long replaced by the string newstr:
-
- > SELECT INSERT('Quadratic', 3, 4, 'What');
- -> 'QuWhattic'
-
- */
- class OOp_Insert : public ONthOperator
- {
- protected:
- virtual ORowSetValue operate(const std::vector<ORowSetValue>& lhs) const override;
- };
-
- /** LEFT(str,len)
- Returns the leftmost len characters from the string str:
-
- > SELECT LEFT('foobarbar', 5);
- -> 'fooba'
-
- */
- class OOp_Left : public OBinaryOperator
- {
- protected:
- virtual ORowSetValue operate(const ORowSetValue& lhs,const ORowSetValue& rhs) const override;
- };
-
- /** RIGHT(str,len)
- Returns the rightmost len characters from the string str:
-
- > SELECT RIGHT('foobarbar', 4);
- -> 'rbar'
- */
- class OOp_Right : public OBinaryOperator
- {
- protected:
- virtual ORowSetValue operate(const ORowSetValue& lhs,const ORowSetValue& rhs) const override;
- };
+ > SELECT LTRIM(' barbar');
+ -> 'barbar'
+
+ */
+ class OOp_LTrim : public OUnaryOperator
+ {
+ protected:
+ virtual ORowSetValue operate(const ORowSetValue& lhs) const override;
+ };
+
+ /** RTRIM(str)
+ Returns the string str with trailing space characters removed:
+
+ > SELECT RTRIM('barbar ');
+ -> 'barbar'
+
+ */
+ class OOp_RTrim : public OUnaryOperator
+ {
+ protected:
+ virtual ORowSetValue operate(const ORowSetValue& lhs) const override;
+ };
+
+ /** SPACE(N)
+ Returns a string consisting of N space characters:
+
+ > SELECT SPACE(6);
+ -> ' '
+
+ */
+ class OOp_Space : public OUnaryOperator
+ {
+ protected:
+ virtual ORowSetValue operate(const ORowSetValue& lhs) const override;
+ };
+
+ /** REPLACE(str,from_str,to_str)
+ Returns the string str with all occurrences of the string from_str replaced by the string to_str:
+
+ > SELECT REPLACE('www.OOo.com', 'w', 'Ww');
+ -> 'WwWwWw.OOo.com'
+
+ */
+ class OOp_Replace : public ONthOperator
+ {
+ protected:
+ virtual ORowSetValue operate(const std::vector<ORowSetValue>& lhs) const override;
+ };
+
+ /** REPEAT(str,count)
+ Returns a string consisting of the string str repeated count times. If count <= 0, returns an empty string. Returns NULL if str or count are NULL:
+
+ > SELECT REPEAT('OOo', 3);
+ -> 'OOoOOoOOo'
+
+ */
+ class OOp_Repeat : public OBinaryOperator
+ {
+ protected:
+ virtual ORowSetValue operate(const ORowSetValue& lhs,const ORowSetValue& rhs) const override;
+ };
+
+ /** INSERT(str,pos,len,newstr)
+ Returns the string str, with the substring beginning at position pos and len characters long replaced by the string newstr:
+
+ > SELECT INSERT('Quadratic', 3, 4, 'What');
+ -> 'QuWhattic'
+
+ */
+ class OOp_Insert : public ONthOperator
+ {
+ protected:
+ virtual ORowSetValue operate(const std::vector<ORowSetValue>& lhs) const override;
+ };
+
+ /** LEFT(str,len)
+ Returns the leftmost len characters from the string str:
+
+ > SELECT LEFT('foobarbar', 5);
+ -> 'fooba'
+
+ */
+ class OOp_Left : public OBinaryOperator
+ {
+ protected:
+ virtual ORowSetValue operate(const ORowSetValue& lhs,const ORowSetValue& rhs) const override;
+ };
+
+ /** RIGHT(str,len)
+ Returns the rightmost len characters from the string str:
+
+ > SELECT RIGHT('foobarbar', 4);
+ -> 'rbar'
+ */
+ class OOp_Right : public OBinaryOperator
+ {
+ protected:
+ virtual ORowSetValue operate(const ORowSetValue& lhs,const ORowSetValue& rhs) const override;
+ };
}
diff --git a/connectivity/source/inc/file/FTable.hxx b/connectivity/source/inc/file/FTable.hxx
index d8bbd92d6c85..3c2e0887964e 100644
--- a/connectivity/source/inc/file/FTable.hxx
+++ b/connectivity/source/inc/file/FTable.hxx
@@ -27,72 +27,72 @@
#include <TResultSetHelper.hxx>
namespace connectivity::file
+{
+ typedef connectivity::sdbcx::OTable OTable_TYPEDEF;
+
+ class OOO_DLLPUBLIC_FILE OFileTable : public OTable_TYPEDEF
{
- typedef connectivity::sdbcx::OTable OTable_TYPEDEF;
-
- class OOO_DLLPUBLIC_FILE OFileTable : public OTable_TYPEDEF
- {
- protected:
- OConnection* m_pConnection;
- std::unique_ptr<SvStream> m_pFileStream;
- ::rtl::Reference<OSQLColumns> m_aColumns;
- sal_Int32 m_nFilePos; // current IResultSetHelper::Movement
- std::unique_ptr<sal_uInt8[]> m_pBuffer;
- sal_uInt16 m_nBufferSize; // size of the ReadBuffer, if pBuffer != NULL
- bool m_bWriteable; // svstream can't say if we are writeable
- // so we have to
-
- virtual void FileClose();
- virtual ~OFileTable( ) override;
- public:
- virtual void refreshColumns() override;
- virtual void refreshKeys() override;
- virtual void refreshIndexes() override;
- public:
- OFileTable( sdbcx::OCollection* _pTables,OConnection* _pConnection);
- OFileTable( sdbcx::OCollection* _pTables,OConnection* _pConnection,
- const OUString& Name,
- const OUString& Type,
- const OUString& Description,
- const OUString& SchemaName,
- const OUString& CatalogName
- );
-
- //XInterface
- virtual css::uno::Any SAL_CALL queryInterface( const css::uno::Type & rType ) override;
- // ::cppu::OComponentHelper
- virtual void SAL_CALL disposing() override;
-
- OConnection* getConnection() const { return m_pConnection;}
- virtual sal_Int32 getCurrentLastPos() const {return -1;}
-
- virtual bool seekRow(IResultSetHelper::Movement eCursorPosition, sal_Int32 nOffset, sal_Int32& nCurPos) = 0;
- virtual bool fetchRow(OValueRefRow& _rRow, const OSQLColumns& _rCols, bool bRetrieveData) = 0;
-
- const ::rtl::Reference<OSQLColumns>& getTableColumns() const {return m_aColumns;}
- virtual bool InsertRow(OValueRefVector& rRow, const css::uno::Reference< css::container::XIndexAccess>& _xCols);
- virtual bool DeleteRow(const OSQLColumns& _rCols);
- virtual bool UpdateRow(OValueRefVector& rRow, OValueRefRow& pOrgRow,const css::uno::Reference< css::container::XIndexAccess>& _xCols);
- virtual void addColumn(const css::uno::Reference< css::beans::XPropertySet>& descriptor);
- virtual void dropColumn(sal_Int32 _nPos);
- // refresh the header of file based tables to see changes done by someone
- virtual void refreshHeader();
-
- OUString SAL_CALL getName() override { return m_Name; }
-
- const OUString& getSchema() const { return m_SchemaName; }
- bool isReadOnly() const { return !m_bWriteable; }
- // m_pFileStream && !m_pFileStream->IsWritable(); }
-
- sal_Int32 getFilePos() const { return m_nFilePos; }
-
- public:
- // helper
-
- // creates a stream using ::utl::UcbStreamHelper::CreateStream, but the error is simplified
- // (NULL or non-NULL is returned)
- static std::unique_ptr<SvStream> createStream_simpleError( const OUString& _rFileName, StreamMode _eOpenMode);
- };
+ protected:
+ OConnection* m_pConnection;
+ std::unique_ptr<SvStream> m_pFileStream;
+ ::rtl::Reference<OSQLColumns> m_aColumns;
+ sal_Int32 m_nFilePos; // current IResultSetHelper::Movement
+ std::unique_ptr<sal_uInt8[]> m_pBuffer;
+ sal_uInt16 m_nBufferSize; // size of the ReadBuffer, if pBuffer != NULL
+ bool m_bWriteable; // svstream can't say if we are writeable
+ // so we have to
+
+ virtual void FileClose();
+ virtual ~OFileTable( ) override;
+ public:
+ virtual void refreshColumns() override;
+ virtual void refreshKeys() override;
+ virtual void refreshIndexes() override;
+ public:
+ OFileTable( sdbcx::OCollection* _pTables,OConnection* _pConnection);
+ OFileTable( sdbcx::OCollection* _pTables,OConnection* _pConnection,
+ const OUString& Name,
+ const OUString& Type,
+ const OUString& Description,
+ const OUString& SchemaName,
+ const OUString& CatalogName
+ );
+
+ //XInterface
+ virtual css::uno::Any SAL_CALL queryInterface( const css::uno::Type & rType ) override;
+ // ::cppu::OComponentHelper
+ virtual void SAL_CALL disposing() override;
+
+ OConnection* getConnection() const { return m_pConnection;}
+ virtual sal_Int32 getCurrentLastPos() const {return -1;}
+
+ virtual bool seekRow(IResultSetHelper::Movement eCursorPosition, sal_Int32 nOffset, sal_Int32& nCurPos) = 0;
+ virtual bool fetchRow(OValueRefRow& _rRow, const OSQLColumns& _rCols, bool bRetrieveData) = 0;
+
+ const ::rtl::Reference<OSQLColumns>& getTableColumns() const {return m_aColumns;}
+ virtual bool InsertRow(OValueRefVector& rRow, const css::uno::Reference< css::container::XIndexAccess>& _xCols);
+ virtual bool DeleteRow(const OSQLColumns& _rCols);
+ virtual bool UpdateRow(OValueRefVector& rRow, OValueRefRow& pOrgRow,const css::uno::Reference< css::container::XIndexAccess>& _xCols);
+ virtual void addColumn(const css::uno::Reference< css::beans::XPropertySet>& descriptor);
+ virtual void dropColumn(sal_Int32 _nPos);
+ // refresh the header of file based tables to see changes done by someone
+ virtual void refreshHeader();
+
+ OUString SAL_CALL getName() override { return m_Name; }
+
+ const OUString& getSchema() const { return m_SchemaName; }
+ bool isReadOnly() const { return !m_bWriteable; }
+ // m_pFileStream && !m_pFileStream->IsWritable(); }
+
+ sal_Int32 getFilePos() const { return m_nFilePos; }
+
+ public:
+ // helper
+
+ // creates a stream using ::utl::UcbStreamHelper::CreateStream, but the error is simplified
+ // (NULL or non-NULL is returned)
+ static std::unique_ptr<SvStream> createStream_simpleError( const OUString& _rFileName, StreamMode _eOpenMode);
+ };
}
diff --git a/connectivity/source/inc/file/FTables.hxx b/connectivity/source/inc/file/FTables.hxx
index be2f26719700..01c198b0cdac 100644
--- a/connectivity/source/inc/file/FTables.hxx
+++ b/connectivity/source/inc/file/FTables.hxx
@@ -24,20 +24,20 @@
#include <com/sun/star/sdbc/XDatabaseMetaData.hpp>
namespace connectivity::file
+{
+ class OOO_DLLPUBLIC_FILE SAL_NO_VTABLE OTables :
+ public sdbcx::OCollection
{
- class OOO_DLLPUBLIC_FILE SAL_NO_VTABLE OTables :
- public sdbcx::OCollection
- {
- protected:
- virtual css::uno::Reference< css::beans::XPropertySet > createObject(const OUString& _rName) override;
- virtual void impl_refresh() override;
- public:
- OTables(const css::uno::Reference< css::sdbc::XDatabaseMetaData >& _rMetaData,::cppu::OWeakObject& _rParent, ::osl::Mutex& _rMutex,
- const ::std::vector< OUString> &_rVector) : sdbcx::OCollection(_rParent,_rMetaData->supportsMixedCaseQuotedIdentifiers(),_rMutex,_rVector)
- {}
+ protected:
+ virtual css::uno::Reference< css::beans::XPropertySet > createObject(const OUString& _rName) override;
+ virtual void impl_refresh() override;
+ public:
+ OTables(const css::uno::Reference< css::sdbc::XDatabaseMetaData >& _rMetaData,::cppu::OWeakObject& _rParent, ::osl::Mutex& _rMutex,
+ const ::std::vector< OUString> &_rVector) : sdbcx::OCollection(_rParent,_rMetaData->supportsMixedCaseQuotedIdentifiers(),_rMutex,_rVector)
+ {}
- virtual css::uno::Any SAL_CALL queryInterface( const css::uno::Type & rType ) override;
- };
+ virtual css::uno::Any SAL_CALL queryInterface( const css::uno::Type & rType ) override;
+ };
}
diff --git a/connectivity/source/inc/file/fanalyzer.hxx b/connectivity/source/inc/file/fanalyzer.hxx
index f913529d268e..9d4e12ccffa3 100644
--- a/connectivity/source/inc/file/fanalyzer.hxx
+++ b/connectivity/source/inc/file/fanalyzer.hxx
@@ -22,48 +22,48 @@
#include <file/fcomp.hxx>
namespace connectivity::file
+{
+ class OConnection;
+ class OSQLAnalyzer final
{
- class OConnection;
- class OSQLAnalyzer final
- {
- typedef std::pair< ::rtl::Reference<OPredicateCompiler>,::rtl::Reference<OPredicateInterpreter> > TPredicates;
+ typedef std::pair< ::rtl::Reference<OPredicateCompiler>,::rtl::Reference<OPredicateInterpreter> > TPredicates;
- std::vector< TPredicates > m_aSelectionEvaluations;
- ::rtl::Reference<OPredicateCompiler> m_aCompiler;
- ::rtl::Reference<OPredicateInterpreter> m_aInterpreter;
- OConnection* m_pConnection;
+ std::vector< TPredicates > m_aSelectionEvaluations;
+ ::rtl::Reference<OPredicateCompiler> m_aCompiler;
+ ::rtl::Reference<OPredicateInterpreter> m_aInterpreter;
+ OConnection* m_pConnection;
- mutable bool m_bHasSelectionCode;
- mutable bool m_bSelectionFirstTime;
+ mutable bool m_bHasSelectionCode;
+ mutable bool m_bSelectionFirstTime;
- static void bindRow(OCodeList& rCodeList,const OValueRefRow& _pRow);
+ static void bindRow(OCodeList& rCodeList,const OValueRefRow& _pRow);
- public:
- OSQLAnalyzer(OConnection* _pConnection);
- ~OSQLAnalyzer();
+ public:
+ OSQLAnalyzer(OConnection* _pConnection);
+ ~OSQLAnalyzer();
- OConnection* getConnection() const { return m_pConnection; }
- void bindEvaluationRow(OValueRefRow const & _pRow); // Bind an evaluation row to the restriction
- /** bind the select columns if they contain a function which needs a row value
- @param _pRow the result row
- */
- void bindSelectRow(const OValueRefRow& _pRow);
+ OConnection* getConnection() const { return m_pConnection; }
+ void bindEvaluationRow(OValueRefRow const & _pRow); // Bind an evaluation row to the restriction
+ /** bind the select columns if they contain a function which needs a row value
+ @param _pRow the result row
+ */
+ void bindSelectRow(const OValueRefRow& _pRow);
- /** binds the row to parameter for the restrictions
- @param _pRow the parameter row
- */
- void bindParameterRow(OValueRefRow const & _pRow);
+ /** binds the row to parameter for the restrictions
+ @param _pRow the parameter row
+ */
+ void bindParameterRow(OValueRefRow const & _pRow);
- void dispose();
- void start(OSQLParseNode const * pSQLParseNode);
- bool hasRestriction() const;
- bool hasFunctions() const;
- bool evaluateRestriction() { return m_aInterpreter->start(); }
- void setSelectionEvaluationResult(OValueRefRow const & _pRow,const std::vector<sal_Int32>& _rColumnMapping);
- void setOrigColumns(const css::uno::Reference< css::container::XNameAccess>& rCols);
- static OOperandAttr* createOperandAttr(sal_Int32 _nPos,
- const css::uno::Reference< css::beans::XPropertySet>& _xCol);
- };
+ void dispose();
+ void start(OSQLParseNode const * pSQLParseNode);
+ bool hasRestriction() const;
+ bool hasFunctions() const;
+ bool evaluateRestriction() { return m_aInterpreter->start(); }
+ void setSelectionEvaluationResult(OValueRefRow const & _pRow,const std::vector<sal_Int32>& _rColumnMapping);
+ void setOrigColumns(const css::uno::Reference< css::container::XNameAccess>& rCols);
+ static OOperandAttr* createOperandAttr(sal_Int32 _nPos,
+ const css::uno::Reference< css::beans::XPropertySet>& _xCol);
+ };
}