diff options
Diffstat (limited to 'connectivity/source/inc/flat')
-rw-r--r-- | connectivity/source/inc/flat/ECatalog.hxx | 49 | ||||
-rw-r--r-- | connectivity/source/inc/flat/EColumns.hxx | 52 | ||||
-rw-r--r-- | connectivity/source/inc/flat/EConnection.hxx | 71 | ||||
-rw-r--r-- | connectivity/source/inc/flat/EDatabaseMetaData.hxx | 55 | ||||
-rw-r--r-- | connectivity/source/inc/flat/EDriver.hxx | 61 | ||||
-rw-r--r-- | connectivity/source/inc/flat/EPreparedStatement.hxx | 50 | ||||
-rw-r--r-- | connectivity/source/inc/flat/EResultSet.hxx | 81 | ||||
-rw-r--r-- | connectivity/source/inc/flat/EStatement.hxx | 49 | ||||
-rw-r--r-- | connectivity/source/inc/flat/ETable.hxx | 103 | ||||
-rw-r--r-- | connectivity/source/inc/flat/ETables.hxx | 52 |
10 files changed, 623 insertions, 0 deletions
diff --git a/connectivity/source/inc/flat/ECatalog.hxx b/connectivity/source/inc/flat/ECatalog.hxx new file mode 100644 index 000000000000..4692f58171d8 --- /dev/null +++ b/connectivity/source/inc/flat/ECatalog.hxx @@ -0,0 +1,49 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef _CONNECTIVITY_FLAT_CATALOG_HXX_ +#define _CONNECTIVITY_FLAT_CATALOG_HXX_ + +#include "file/FCatalog.hxx" + +namespace connectivity +{ + namespace flat + { + class OFlatConnection; + class OFlatCatalog : public file::OFileCatalog + { + public: + virtual void refreshTables(); + + public: + OFlatCatalog(OFlatConnection* _pCon); + }; + } +} +#endif // _CONNECTIVITY_FLAT_CATALOG_HXX_ + diff --git a/connectivity/source/inc/flat/EColumns.hxx b/connectivity/source/inc/flat/EColumns.hxx new file mode 100644 index 000000000000..7c6e7dfd0f2e --- /dev/null +++ b/connectivity/source/inc/flat/EColumns.hxx @@ -0,0 +1,52 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef _CONNECTIVITY_FLAT_COLUMNS_HXX_ +#define _CONNECTIVITY_FLAT_COLUMNS_HXX_ + +#include "file/FColumns.hxx" + +namespace connectivity +{ + namespace flat + { + class OFlatColumns : public file::OColumns + { + protected: + virtual sdbcx::ObjectType createObject(const ::rtl::OUString& _rName); + public: + OFlatColumns(file::OFileTable* _pTable, + ::osl::Mutex& _rMutex, + const TStringVector &_rVector + ) : file::OColumns(_pTable,_rMutex,_rVector) + {} + + }; + } +} +#endif // _CONNECTIVITY_FLAT_COLUMNS_HXX_ + diff --git a/connectivity/source/inc/flat/EConnection.hxx b/connectivity/source/inc/flat/EConnection.hxx new file mode 100644 index 000000000000..3b4fb7e558d6 --- /dev/null +++ b/connectivity/source/inc/flat/EConnection.hxx @@ -0,0 +1,71 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef _CONNECTIVITY_FLAT_ECONNECTION_HXX_ +#define _CONNECTIVITY_FLAT_ECONNECTION_HXX_ + +#include "file/FConnection.hxx" + +namespace connectivity +{ + namespace flat + { + class ODriver; + class OFlatConnection : public file::OConnection + { + private: + sal_Bool m_bHeaderLine; // column names in first row + sal_Unicode m_cFieldDelimiter; // look at the name + sal_Unicode m_cStringDelimiter; // delimiter for strings m_cStringDelimiter blabla m_cStringDelimiter + sal_Unicode m_cDecimalDelimiter; // Dezimal-delimiter (Dezimalpoint) + sal_Unicode m_cThousandDelimiter; // + public: + OFlatConnection(ODriver* _pDriver); + virtual ~OFlatConnection(); + + virtual void construct(const ::rtl::OUString& _rUrl,const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& _rInfo ) throw( ::com::sun::star::sdbc::SQLException); + + // own methods + inline sal_Bool isHeaderLine() const { return m_bHeaderLine; } + inline sal_Unicode getFieldDelimiter() const { return m_cFieldDelimiter; } + inline sal_Unicode getStringDelimiter() const { return m_cStringDelimiter; } + inline sal_Unicode getDecimalDelimiter() const { return m_cDecimalDelimiter; } + inline sal_Unicode getThousandDelimiter() const { return m_cThousandDelimiter;} + // XServiceInfo + DECLARE_SERVICE_INFO(); + + // XConnection + virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XDatabaseMetaData > SAL_CALL getMetaData( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbcx::XTablesSupplier > createCatalog(); + virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XStatement > SAL_CALL createStatement( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XPreparedStatement > SAL_CALL prepareStatement( const ::rtl::OUString& sql ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XPreparedStatement > SAL_CALL prepareCall( const ::rtl::OUString& sql ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException); + }; + } +} +#endif // _CONNECTIVITY_FLAT_DCONNECTION_HXX_ + diff --git a/connectivity/source/inc/flat/EDatabaseMetaData.hxx b/connectivity/source/inc/flat/EDatabaseMetaData.hxx new file mode 100644 index 000000000000..79cb18bcbf40 --- /dev/null +++ b/connectivity/source/inc/flat/EDatabaseMetaData.hxx @@ -0,0 +1,55 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef _CONNECTIVITY_FLAT_EDATABASEMETADATA_HXX_ +#define _CONNECTIVITY_FLAT_EDATABASEMETADATA_HXX_ + +#include "file/FDatabaseMetaData.hxx" + +namespace connectivity +{ + namespace flat + { + //************************************************************** + //************ Class: java.sql.DatabaseMetaDataDate + //************************************************************** + + class OFlatDatabaseMetaData : public file::ODatabaseMetaData + { + virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSet > impl_getTypeInfo_throw(); + protected: + virtual ~OFlatDatabaseMetaData(); + public: + OFlatDatabaseMetaData(file::OConnection* _pCon); + + virtual ::rtl::OUString SAL_CALL getURL( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSet > SAL_CALL getColumns( const ::com::sun::star::uno::Any& catalog, const ::rtl::OUString& schemaPattern, const ::rtl::OUString& tableNamePattern, const ::rtl::OUString& columnNamePattern ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException); + }; + } +} +#endif // _CONNECTIVITY_FLAT_ODATABASEMETADATA_HXX_ + diff --git a/connectivity/source/inc/flat/EDriver.hxx b/connectivity/source/inc/flat/EDriver.hxx new file mode 100644 index 000000000000..124dbf1f6156 --- /dev/null +++ b/connectivity/source/inc/flat/EDriver.hxx @@ -0,0 +1,61 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef _CONNECTIVITY_FLAT_EDRIVER_HXX_ +#define _CONNECTIVITY_FLAT_EDRIVER_HXX_ + +#include <cppuhelper/compbase2.hxx> +#include "connectivity/CommonTools.hxx" +#include "file/FDriver.hxx" + +namespace connectivity +{ + namespace flat + { + + ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL ODriver_CreateInstance(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rxFactory) throw( ::com::sun::star::uno::Exception ); + + class ODriver : public file::OFileDriver + { + public: + ODriver(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rxFactory) : file::OFileDriver(_rxFactory){} + + // XInterface + static ::rtl::OUString getImplementationName_Static( ) throw(::com::sun::star::uno::RuntimeException); + // static ::com::sun::star::uno::Sequence< ::rtl::OUString > getSupportedServiceNames_Static( ) throw (::com::sun::star::uno::RuntimeException); + + ::rtl::OUString SAL_CALL getImplementationName( ) throw(::com::sun::star::uno::RuntimeException); + // XDriver + virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection > SAL_CALL connect( const ::rtl::OUString& url, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& info ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException); + virtual sal_Bool SAL_CALL acceptsURL( const ::rtl::OUString& url ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Sequence< ::com::sun::star::sdbc::DriverPropertyInfo > SAL_CALL getPropertyInfo( const ::rtl::OUString& url, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& info ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException); + }; + } + +} +#endif //_CONNECTIVITY_FLAT_DDRIVER_HXX_ + diff --git a/connectivity/source/inc/flat/EPreparedStatement.hxx b/connectivity/source/inc/flat/EPreparedStatement.hxx new file mode 100644 index 000000000000..50ffb9173b79 --- /dev/null +++ b/connectivity/source/inc/flat/EPreparedStatement.hxx @@ -0,0 +1,50 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef _CONNECTIVITY_FLAT_DPREPAREDSTATEMENT_HXX_ +#define _CONNECTIVITY_FLAT_DPREPAREDSTATEMENT_HXX_ + +#include "file/FPreparedStatement.hxx" + +namespace connectivity +{ + namespace flat + { + class OConnection; + class OFlatPreparedStatement : public file::OPreparedStatement + { + protected: + virtual file::OResultSet* createResultSet(); + public: + OFlatPreparedStatement( file::OConnection* _pConnection) : file::OPreparedStatement( _pConnection){} + DECLARE_SERVICE_INFO(); + }; + } +} + +#endif //_CONNECTIVITY_FLAT_DPREPAREDSTATEMENT_HXX_ + diff --git a/connectivity/source/inc/flat/EResultSet.hxx b/connectivity/source/inc/flat/EResultSet.hxx new file mode 100644 index 000000000000..6a9958dd7bea --- /dev/null +++ b/connectivity/source/inc/flat/EResultSet.hxx @@ -0,0 +1,81 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef _CONNECTIVITY_FLAT_ERESULTSET_HXX_ +#define _CONNECTIVITY_FLAT_ERESULTSET_HXX_ + +#include "file/FResultSet.hxx" +#include <com/sun/star/sdbcx/XRowLocate.hpp> +#include <cppuhelper/implbase1.hxx> + +namespace connectivity +{ + namespace flat + { + class OFlatResultSet; + // these typedef's are only necessary for the compiler + typedef ::cppu::ImplHelper1< ::com::sun::star::sdbcx::XRowLocate> OFlatResultSet_BASE; + typedef file::OResultSet OFlatResultSet_BASE2; + typedef ::comphelper::OPropertyArrayUsageHelper<OFlatResultSet> OFlatResultSet_BASE3; + + + class OFlatResultSet : public OFlatResultSet_BASE2, + public OFlatResultSet_BASE, + public OFlatResultSet_BASE3 + { + sal_Bool m_bBookmarkable; + protected: + // OPropertyArrayUsageHelper + virtual ::cppu::IPropertyArrayHelper* createArrayHelper( ) const; + // OPropertySetHelper + virtual ::cppu::IPropertyArrayHelper & SAL_CALL getInfoHelper(); + public: + DECLARE_SERVICE_INFO(); + + OFlatResultSet( file::OStatement_Base* pStmt,connectivity::OSQLParseTreeIterator& _aSQLIterator); + + // XInterface + virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL acquire() throw(); + virtual void SAL_CALL release() throw(); + //XTypeProvider + virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes( ) throw(::com::sun::star::uno::RuntimeException); + // XPropertySet + virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException); + + // XRowLocate + virtual ::com::sun::star::uno::Any SAL_CALL getBookmark( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException); + virtual sal_Bool SAL_CALL moveToBookmark( const ::com::sun::star::uno::Any& bookmark ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException); + virtual sal_Bool SAL_CALL moveRelativeToBookmark( const ::com::sun::star::uno::Any& bookmark, sal_Int32 rows ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException); + virtual sal_Int32 SAL_CALL compareBookmarks( const ::com::sun::star::uno::Any& first, const ::com::sun::star::uno::Any& second ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException); + virtual sal_Bool SAL_CALL hasOrderedBookmarks( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException); + virtual sal_Int32 SAL_CALL hashBookmark( const ::com::sun::star::uno::Any& bookmark ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException); + }; + } +} +#endif //_CONNECTIVITY_FLAT_DRESULTSET_HXX_ + diff --git a/connectivity/source/inc/flat/EStatement.hxx b/connectivity/source/inc/flat/EStatement.hxx new file mode 100644 index 000000000000..c80dfe0405a2 --- /dev/null +++ b/connectivity/source/inc/flat/EStatement.hxx @@ -0,0 +1,49 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef _CONNECTIVITY_FLAT_ESTATEMENT_HXX_ +#define _CONNECTIVITY_FLAT_ESTATEMENT_HXX_ + +#include "file/FStatement.hxx" + +namespace connectivity +{ + namespace flat + { + class OConnection; + class OFlatStatement : public file::OStatement + { + protected: + virtual file::OResultSet* createResultSet(); + public: + OFlatStatement( file::OConnection* _pConnection) : file::OStatement( _pConnection){} + DECLARE_SERVICE_INFO(); + }; + } +} + +#endif //_CONNECTIVITY_FLAT_DSTATEMENT_HXX_ diff --git a/connectivity/source/inc/flat/ETable.hxx b/connectivity/source/inc/flat/ETable.hxx new file mode 100644 index 000000000000..51d57376c5d2 --- /dev/null +++ b/connectivity/source/inc/flat/ETable.hxx @@ -0,0 +1,103 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef _CONNECTIVITY_FLAT_TABLE_HXX_ +#define _CONNECTIVITY_FLAT_TABLE_HXX_ + +#include "file/FTable.hxx" +#include "connectivity/sdbcx/VColumn.hxx" +#include "connectivity/CommonTools.hxx" +#include <tools/urlobj.hxx> +#include "file/quotedstring.hxx" + +namespace connectivity +{ + namespace flat + { + typedef file::OFileTable OFlatTable_BASE; + class OFlatConnection; + + typedef ::std::map< ::rtl::OUString, + ::com::sun::star::uno::Reference< ::com::sun::star::container::XNamed>, comphelper::UStringMixLess > OContainer; + typedef ::std::map<sal_Int32, sal_Int32> TRowPositionsInFile; + + class OFlatTable : public OFlatTable_BASE + { + // maps a row postion to a file position + TRowPositionsInFile m_aFilePosToEndLinePos; + ::std::map<sal_Int32, TRowPositionsInFile::iterator> + m_aRowPosToFilePos; + ::std::vector<sal_Int32> m_aTypes; // holds all type for columns just to avoid to ask the propertyset + ::std::vector<sal_Int32> m_aPrecisions; // same as aboth + ::std::vector<sal_Int32> m_aScales; + QuotedTokenizedString m_aCurrentLine; + ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatter > m_xNumberFormatter; + ::com::sun::star::util::Date m_aNullDate; + sal_Int32 m_nStartRowFilePos; + sal_Int32 m_nRowPos; + sal_Int32 m_nMaxRowCount; // will be set if stream is once eof + sal_Unicode m_cStringDelimiter; // delimiter for strings m_cStringDelimiter blabla m_cStringDelimiter + sal_Unicode m_cFieldDelimiter; // look at the name + bool m_bNeedToReadLine; + private: + void fillColumns(const ::com::sun::star::lang::Locale& _aLocale); + BOOL CreateFile(const INetURLObject& aFile, BOOL& bCreateMemo); + sal_Bool readLine(sal_Int32& _rnCurrentPos); + public: + virtual void refreshColumns(); + + public: + // DECLARE_CTY_DEFAULTS( OFlatTable_BASE); + OFlatTable( sdbcx::OCollection* _pTables,OFlatConnection* _pConnection, + const ::rtl::OUString& _Name, + const ::rtl::OUString& _Type, + const ::rtl::OUString& _Description = ::rtl::OUString(), + const ::rtl::OUString& _SchemaName = ::rtl::OUString(), + const ::rtl::OUString& _CatalogName = ::rtl::OUString() + ); + + void construct(); // can throw any exception + + virtual sal_Bool seekRow(IResultSetHelper::Movement eCursorPosition, sal_Int32 nOffset, sal_Int32& nCurPos); + virtual sal_Bool fetchRow(OValueRefRow& _rRow,const OSQLColumns& _rCols, sal_Bool bIsTable,sal_Bool bRetrieveData); + virtual void refreshHeader(); + + virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException); + //XTypeProvider + virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes( ) throw(::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL disposing(void); + + // com::sun::star::lang::XUnoTunnel + virtual sal_Int64 SAL_CALL getSomething( const ::com::sun::star::uno::Sequence< sal_Int8 >& aIdentifier ) throw(::com::sun::star::uno::RuntimeException); + static ::com::sun::star::uno::Sequence< sal_Int8 > getUnoTunnelImplementationId(); + + String getEntry(); + }; + } +} +#endif // _CONNECTIVITY_FLAT_TABLE_HXX_ + diff --git a/connectivity/source/inc/flat/ETables.hxx b/connectivity/source/inc/flat/ETables.hxx new file mode 100644 index 000000000000..b14379d4c6ae --- /dev/null +++ b/connectivity/source/inc/flat/ETables.hxx @@ -0,0 +1,52 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef _CONNECTIVITY_FLAT_TABLES_HXX_ +#define _CONNECTIVITY_FLAT_TABLES_HXX_ + +#include "file/FTables.hxx" + +namespace connectivity +{ + namespace flat + { + // namespace ::com::sun::star::sdbcx = ::com::sun::star::sdbcx; + typedef file::OTables OFlatTables_BASE; + + class OFlatTables : public OFlatTables_BASE + { + protected: + virtual sdbcx::ObjectType createObject(const ::rtl::OUString& _rName); + public: + OFlatTables(const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XDatabaseMetaData >& _rMetaData,::cppu::OWeakObject& _rParent, ::osl::Mutex& _rMutex, + const TStringVector &_rVector) : OFlatTables_BASE(_rMetaData,_rParent,_rMutex,_rVector) + {} + }; + } +} +#endif // _CONNECTIVITY_FLAT_TABLES_HXX_ + |