1 /*************************************************************************
2  *
3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4  *
5  * Copyright 2000, 2010 Oracle and/or its affiliates.
6  *
7  * OpenOffice.org - a multi-platform office productivity suite
8  *
9  * This file is part of OpenOffice.org.
10  *
11  * OpenOffice.org is free software: you can redistribute it and/or modify
12  * it under the terms of the GNU Lesser General Public License version 3
13  * only, as published by the Free Software Foundation.
14  *
15  * OpenOffice.org is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU Lesser General Public License version 3 for more details
19  * (a copy is included in the LICENSE file that accompanied this code).
20  *
21  * You should have received a copy of the GNU Lesser General Public License
22  * version 3 along with OpenOffice.org.  If not, see
23  * <http://www.openoffice.org/license.html>
24  * for a copy of the LGPLv3 License.
25  *
26  ************************************************************************/
27 
28 #ifndef _CONNECTIVITY_FLAT_ECONNECTION_HXX_
29 #define _CONNECTIVITY_FLAT_ECONNECTION_HXX_
30 
31 #include "file/FConnection.hxx"
32 
33 namespace connectivity
34 {
35 	namespace flat
36 	{
37 		class ODriver;
38 		class OFlatConnection : public file::OConnection
39 		{
40 		private:
41             sal_Int32   m_nMaxRowsToScan;
42 			sal_Bool	m_bHeaderLine; 			// column names in first row
43 			sal_Unicode	m_cFieldDelimiter;		// look at the name
44 			sal_Unicode	m_cStringDelimiter;		// delimiter for strings m_cStringDelimiter blabla m_cStringDelimiter
45 			sal_Unicode	m_cDecimalDelimiter;	// Dezimal-delimiter (Dezimalpoint)
46 			sal_Unicode	m_cThousandDelimiter;	//
47 		public:
48 			OFlatConnection(ODriver*	_pDriver);
49 			virtual ~OFlatConnection();
50 
51 			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);
52 
53 			// own methods
54 			inline sal_Bool		isHeaderLine()			const { return m_bHeaderLine;		}
55 			inline sal_Unicode	getFieldDelimiter()		const { return m_cFieldDelimiter;	}
56 			inline sal_Unicode	getStringDelimiter()	const { return m_cStringDelimiter;	}
57 			inline sal_Unicode	getDecimalDelimiter()	const { return m_cDecimalDelimiter; }
58 			inline sal_Unicode	getThousandDelimiter()	const { return m_cThousandDelimiter;}
59             inline sal_Int32	getMaxRowsToScan()	    const { return m_nMaxRowsToScan;}
60 			// XServiceInfo
61 			DECLARE_SERVICE_INFO();
62 
63 			// XConnection
64             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);
65             virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbcx::XTablesSupplier > createCatalog();
66 			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);
67             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);
68 			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);
69 		};
70 	}
71 }
72 #endif // _CONNECTIVITY_FLAT_DCONNECTION_HXX_
73 
74