LCOV - code coverage report
Current view: top level - connectivity/source/inc/file - FConnection.hxx (source / functions) Hit Total Coverage
Test: commit c8344322a7af75b84dd3ca8f78b05543a976dfd5 Lines: 8 9 88.9 %
Date: 2015-06-13 12:38:46 Functions: 8 9 88.9 %
Legend: Lines: hit not hit

          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             : #ifndef INCLUDED_CONNECTIVITY_SOURCE_INC_FILE_FCONNECTION_HXX
      20             : #define INCLUDED_CONNECTIVITY_SOURCE_INC_FILE_FCONNECTION_HXX
      21             : 
      22             : #include <com/sun/star/ucb/XContent.hpp>
      23             : #include <com/sun/star/sdbc/SQLWarning.hpp>
      24             : #include <com/sun/star/beans/PropertyValue.hpp>
      25             : #include <connectivity/OSubComponent.hxx>
      26             : #include <connectivity/CommonTools.hxx>
      27             : #include "OTypeInfo.hxx"
      28             : #include <rtl/ustring.hxx>
      29             : #include <com/sun/star/sdbcx/XTablesSupplier.hpp>
      30             : #include <com/sun/star/ucb/XDynamicResultSet.hpp>
      31             : #include <com/sun/star/uno/DeploymentException.hpp>
      32             : #include <connectivity/sqlparse.hxx>
      33             : #include <connectivity/sqliterator.hxx>
      34             : #include "TConnection.hxx"
      35             : #include "file/filedllapi.hxx"
      36             : #include <map>
      37             : 
      38             : namespace connectivity
      39             : {
      40             :     namespace file
      41             :     {
      42             :         class ODatabaseMetaData;
      43             :         class OFileDriver;
      44             : 
      45             :         class OOO_DLLPUBLIC_FILE OConnection :
      46             :                             public connectivity::OMetaConnection,
      47             :                             public connectivity::OSubComponent<OConnection, connectivity::OMetaConnection>
      48             :         {
      49             :             friend class connectivity::OSubComponent<OConnection, connectivity::OMetaConnection>;
      50             : 
      51             :         protected:
      52             : 
      53             :             // Data attributes
      54             : 
      55             :             ::com::sun::star::uno::WeakReference< ::com::sun::star::sdbcx::XTablesSupplier>         m_xCatalog;
      56             : 
      57             :             ::com::sun::star::sdbc::SQLWarning            m_aLastWarning; //      Last SQLWarning generated by
      58             : 
      59             :             OUString                    m_aFilenameExtension;
      60             :             OFileDriver*                m_pDriver;      //  Pointer to the owning
      61             :                                                         //  driver object
      62             :             ::com::sun::star::uno::Reference< ::com::sun::star::ucb::XDynamicResultSet >    m_xDir; // directory
      63             :             ::com::sun::star::uno::Reference< ::com::sun::star::ucb::XContent>              m_xContent;
      64             : 
      65             :             bool                    m_bClosed;
      66             :             bool                    m_bAutoCommit;
      67             :             bool                    m_bReadOnly;
      68             :             bool                    m_bShowDeleted;
      69             :             bool                    m_bCaseSensitiveExtension;
      70             :             bool                    m_bCheckSQL92;
      71             :             bool                        m_bDefaultTextEncoding;
      72             : 
      73             : 
      74             :             void throwUrlNotValid(const OUString & _rsUrl,const OUString & _rsMessage);
      75             : 
      76             :             virtual ~OConnection();
      77             :         public:
      78             : 
      79             :             OConnection(OFileDriver*    _pDriver);
      80             : 
      81             :             virtual void construct(const OUString& _rUrl, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& _rInfo )
      82             :                 throw( css::sdbc::SQLException,
      83             :                        css::uno::RuntimeException,
      84             :                        css::uno::DeploymentException);
      85             : 
      86             : 
      87             :             void closeAllStatements () throw( ::com::sun::star::sdbc::SQLException);
      88             : 
      89             :             // OComponentHelper
      90             :             virtual void SAL_CALL disposing() SAL_OVERRIDE;
      91             :             // XInterface
      92             :             virtual void SAL_CALL release() throw() SAL_OVERRIDE;
      93             : 
      94             :             // XServiceInfo
      95             :             DECLARE_SERVICE_INFO();
      96             : 
      97             :             // XConnection
      98             :             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, std::exception) SAL_OVERRIDE;
      99             :             virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XPreparedStatement > SAL_CALL prepareStatement( const OUString& sql ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
     100             :             virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XPreparedStatement > SAL_CALL prepareCall( const OUString& sql ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
     101             :             virtual OUString SAL_CALL nativeSQL( const OUString& sql ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
     102             :             virtual void SAL_CALL setAutoCommit( sal_Bool autoCommit ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
     103             :             virtual sal_Bool SAL_CALL getAutoCommit(  ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
     104             :             virtual void SAL_CALL commit(  ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
     105             :             virtual void SAL_CALL rollback(  ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
     106             :             virtual sal_Bool SAL_CALL isClosed(  ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
     107             :             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, std::exception) SAL_OVERRIDE;
     108             :             virtual void SAL_CALL setReadOnly( sal_Bool readOnly ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
     109             :             virtual sal_Bool SAL_CALL isReadOnly(  ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
     110             :             virtual void SAL_CALL setCatalog( const OUString& catalog ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
     111             :             virtual OUString SAL_CALL getCatalog(  ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
     112             :             virtual void SAL_CALL setTransactionIsolation( sal_Int32 level ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
     113             :             virtual sal_Int32 SAL_CALL getTransactionIsolation(  ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
     114             :             virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess > SAL_CALL getTypeMap(  ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
     115             :             virtual void SAL_CALL setTypeMap( const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess >& typeMap ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
     116             :             // XCloseable
     117             :             virtual void SAL_CALL close(  ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
     118             :             // XWarningsSupplier
     119             :             virtual ::com::sun::star::uno::Any SAL_CALL getWarnings(  ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
     120             :             virtual void SAL_CALL clearWarnings(  ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
     121             :             //XUnoTunnel
     122             :             virtual sal_Int64 SAL_CALL getSomething( const ::com::sun::star::uno::Sequence< sal_Int8 >& aIdentifier ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
     123             :             static ::com::sun::star::uno::Sequence< sal_Int8 > getUnoTunnelImplementationId();
     124             : 
     125             :             // no interface methods
     126             :             ::com::sun::star::uno::Reference< ::com::sun::star::ucb::XDynamicResultSet > getDir() const;
     127         100 :             ::com::sun::star::uno::Reference< ::com::sun::star::ucb::XContent>  getContent() const { return m_xContent; }
     128             :             // create a catalog or return the catalog already created
     129             :             virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbcx::XTablesSupplier > createCatalog();
     130             : 
     131             :             bool                matchesExtension( const OUString& _rExt ) const;
     132             : 
     133         100 :             inline const OUString&    getExtension()            const { return m_aFilenameExtension; }
     134          30 :             inline bool         isCaseSensitveExtension()   const { return m_bCaseSensitiveExtension; }
     135         159 :             inline OFileDriver*     getDriver()                 const { return m_pDriver; }
     136          29 :             inline bool         showDeleted()               const { return m_bShowDeleted; }
     137          70 :             inline bool         isCheckEnabled()            const { return m_bCheckSQL92; }
     138           0 :             inline bool             isTextEncodingDefaulted()   const { return m_bDefaultTextEncoding; }
     139             : 
     140             :         public:
     141             :             struct GrantAccess
     142             :             {
     143             :                 friend class ODatabaseMetaData;
     144             :             private:
     145          70 :                 GrantAccess() { }
     146             :             };
     147             : 
     148          70 :             void    setCaseSensitiveExtension( bool _bIsCS, GrantAccess ) { m_bCaseSensitiveExtension = _bIsCS; }
     149             :         };
     150             :     }
     151             : }
     152             : #endif // INCLUDED_CONNECTIVITY_SOURCE_INC_FILE_FCONNECTION_HXX
     153             : 
     154             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.11