1 /************************************************************** 2 * 3 * Licensed to the Apache Software Foundation (ASF) under one 4 * or more contributor license agreements. See the NOTICE file 5 * distributed with this work for additional information 6 * regarding copyright ownership. The ASF licenses this file 7 * to you under the Apache License, Version 2.0 (the 8 * "License"); you may not use this file except in compliance 9 * with the License. You may obtain a copy of the License at 10 * 11 * http://www.apache.org/licenses/LICENSE-2.0 12 * 13 * Unless required by applicable law or agreed to in writing, 14 * software distributed under the License is distributed on an 15 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 * KIND, either express or implied. See the License for the 17 * specific language governing permissions and limitations 18 * under the License. 19 * 20 *************************************************************/ 21 22 23 24 #ifndef _CONNECTIVITY_FLAT_ECONNECTION_HXX_ 25 #define _CONNECTIVITY_FLAT_ECONNECTION_HXX_ 26 27 #include "file/FConnection.hxx" 28 29 namespace connectivity 30 { 31 namespace flat 32 { 33 class ODriver; 34 class OFlatConnection : public file::OConnection 35 { 36 private: 37 sal_Int32 m_nMaxRowsToScan; 38 sal_Bool m_bHeaderLine; // column names in first row 39 sal_Unicode m_cFieldDelimiter; // look at the name 40 sal_Unicode m_cStringDelimiter; // delimiter for strings m_cStringDelimiter blabla m_cStringDelimiter 41 sal_Unicode m_cDecimalDelimiter; // Dezimal-delimiter (Dezimalpoint) 42 sal_Unicode m_cThousandDelimiter; // 43 public: 44 OFlatConnection(ODriver* _pDriver); 45 virtual ~OFlatConnection(); 46 47 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); 48 49 // own methods isHeaderLine() const50 inline sal_Bool isHeaderLine() const { return m_bHeaderLine; } getFieldDelimiter() const51 inline sal_Unicode getFieldDelimiter() const { return m_cFieldDelimiter; } getStringDelimiter() const52 inline sal_Unicode getStringDelimiter() const { return m_cStringDelimiter; } getDecimalDelimiter() const53 inline sal_Unicode getDecimalDelimiter() const { return m_cDecimalDelimiter; } getThousandDelimiter() const54 inline sal_Unicode getThousandDelimiter() const { return m_cThousandDelimiter;} getMaxRowsToScan() const55 inline sal_Int32 getMaxRowsToScan() const { return m_nMaxRowsToScan;} 56 // XServiceInfo 57 DECLARE_SERVICE_INFO(); 58 59 // XConnection 60 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); 61 virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbcx::XTablesSupplier > createCatalog(); 62 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); 63 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); 64 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); 65 }; 66 } 67 } 68 #endif // _CONNECTIVITY_FLAT_DCONNECTION_HXX_ 69 70