1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
21 #include <connectivity/virtualdbtools.hxx>
22 #include <connectivity/formattedcolumnvalue.hxx>
23 #include "dbtfactory.hxx"
24 #include "parser_s.hxx"
25 #include "staticdbtools_s.hxx"
26 #include "charset_s.hxx"
28 using namespace ::com::sun::star::uno
;
29 using namespace ::com::sun::star::lang
;
31 //================================================================
32 // the entry point for load-on-call usage of the DBTOOLS lib
33 extern "C" void* SAL_CALL
createDataAccessToolsFactory()
35 ::connectivity::ODataAccessToolsFactory
* pFactory
= new ::connectivity::ODataAccessToolsFactory
;
40 //........................................................................
41 namespace connectivity
43 //........................................................................
45 //================================================================
46 //= ODataAccessToolsFactory
47 //================================================================
48 //----------------------------------------------------------------
49 ODataAccessToolsFactory::ODataAccessToolsFactory()
51 ODataAccessStaticTools
* pStaticTools
= new ODataAccessStaticTools
;
52 m_xTypeConversionHelper
= pStaticTools
;
53 m_xToolsHelper
= pStaticTools
;
56 //----------------------------------------------------------------
57 oslInterlockedCount SAL_CALL
ODataAccessToolsFactory::acquire()
59 return ORefBase::acquire();
62 //----------------------------------------------------------------
63 oslInterlockedCount SAL_CALL
ODataAccessToolsFactory::release()
65 return ORefBase::release();
68 //----------------------------------------------------------------
69 ::rtl::Reference
< simple::IDataAccessTypeConversion
> ODataAccessToolsFactory::getTypeConversionHelper()
71 return m_xTypeConversionHelper
;
74 //----------------------------------------------------------------
75 ::rtl::Reference
< simple::IDataAccessCharSet
> ODataAccessToolsFactory::createCharsetHelper( ) const
77 return new ODataAccessCharSet
;
80 //----------------------------------------------------------------
81 ::rtl::Reference
< simple::IDataAccessTools
> ODataAccessToolsFactory::getDataAccessTools()
83 return m_xToolsHelper
;
86 //----------------------------------------------------------------
87 SAL_WNODEPRECATED_DECLARATIONS_PUSH
88 ::std::auto_ptr
< ::dbtools::FormattedColumnValue
> ODataAccessToolsFactory::createFormattedColumnValue( const ::comphelper::ComponentContext
& _rContext
,
89 const Reference
< ::com::sun::star::sdbc::XRowSet
>& _rxRowSet
, const Reference
< ::com::sun::star::beans::XPropertySet
>& _rxColumn
)
91 ::std::auto_ptr
< ::dbtools::FormattedColumnValue
> pValue( new ::dbtools::FormattedColumnValue( _rContext
, _rxRowSet
, _rxColumn
) );
94 SAL_WNODEPRECATED_DECLARATIONS_POP
96 //----------------------------------------------------------------
97 ::rtl::Reference
< simple::ISQLParser
> ODataAccessToolsFactory::createSQLParser(const Reference
< XComponentContext
>& rxContext
, const IParseContext
* _pContext
) const
99 return new OSimpleSQLParser(rxContext
, _pContext
);
102 //........................................................................
103 } // namespace connectivity
104 //........................................................................
107 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */