Line data Source code
1 : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : /*
3 : * This file is part of the LibreOffice project.
4 : *
5 : * This Source Code Form is subject to the terms of the Mozilla Public
6 : * License, v. 2.0. If a copy of the MPL was not distributed with this
7 : * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 : *
9 : * This file incorporates work covered by the following license notice:
10 : *
11 : * Licensed to the Apache Software Foundation (ASF) under one or more
12 : * contributor license agreements. See the NOTICE file distributed
13 : * with this work for additional information regarding copyright
14 : * ownership. The ASF licenses this file to you under the Apache
15 : * License, Version 2.0 (the "License"); you may not use this file
16 : * except in compliance with the License. You may obtain a copy of
17 : * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 : */
19 :
20 : #ifndef _CONNECTIVITY_FLAT_ECONNECTION_HXX_
21 : #define _CONNECTIVITY_FLAT_ECONNECTION_HXX_
22 :
23 : #include "file/FConnection.hxx"
24 :
25 : namespace connectivity
26 : {
27 : namespace flat
28 : {
29 : class ODriver;
30 : class OFlatConnection : public file::OConnection
31 : {
32 : private:
33 : sal_Int32 m_nMaxRowsToScan;
34 : sal_Bool m_bHeaderLine; // column names in first row
35 : sal_Unicode m_cFieldDelimiter; // look at the name
36 : sal_Unicode m_cStringDelimiter;
37 : sal_Unicode m_cDecimalDelimiter;
38 : sal_Unicode m_cThousandDelimiter;
39 : public:
40 : OFlatConnection(ODriver* _pDriver);
41 : virtual ~OFlatConnection();
42 :
43 : 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);
44 :
45 : // own methods
46 0 : inline sal_Bool isHeaderLine() const { return m_bHeaderLine; }
47 0 : inline sal_Unicode getFieldDelimiter() const { return m_cFieldDelimiter; }
48 0 : inline sal_Unicode getStringDelimiter() const { return m_cStringDelimiter; }
49 0 : inline sal_Unicode getDecimalDelimiter() const { return m_cDecimalDelimiter; }
50 0 : inline sal_Unicode getThousandDelimiter() const { return m_cThousandDelimiter;}
51 0 : inline sal_Int32 getMaxRowsToScan() const { return m_nMaxRowsToScan;}
52 : // XServiceInfo
53 : DECLARE_SERVICE_INFO();
54 :
55 : // XConnection
56 : 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);
57 : virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbcx::XTablesSupplier > createCatalog();
58 : 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);
59 : 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);
60 : 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);
61 : };
62 : }
63 : }
64 : #endif // _CONNECTIVITY_FLAT_DCONNECTION_HXX_
65 :
66 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|