Branch data 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 : :
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"
27 : :
28 : : using namespace ::com::sun::star::uno;
29 : : using namespace ::com::sun::star::lang;
30 : :
31 : : //================================================================
32 : : // the entry point for load-on-call usage of the DBTOOLS lib
33 : 395 : extern "C" void* SAL_CALL createDataAccessToolsFactory()
34 : : {
35 [ + - ]: 395 : ::connectivity::ODataAccessToolsFactory* pFactory = new ::connectivity::ODataAccessToolsFactory;
36 : 395 : pFactory->acquire();
37 : 395 : return pFactory;
38 : : }
39 : :
40 : : //........................................................................
41 : : namespace connectivity
42 : : {
43 : : //........................................................................
44 : :
45 : : //================================================================
46 : : //= ODataAccessToolsFactory
47 : : //================================================================
48 : : //----------------------------------------------------------------
49 : 395 : ODataAccessToolsFactory::ODataAccessToolsFactory()
50 : : {
51 [ + - ][ + - ]: 395 : ODataAccessStaticTools* pStaticTools = new ODataAccessStaticTools;
52 [ + - ]: 395 : m_xTypeConversionHelper = pStaticTools;
53 [ + - ][ + - ]: 395 : m_xToolsHelper = pStaticTools;
54 : 395 : }
55 : :
56 : : //----------------------------------------------------------------
57 : 790 : oslInterlockedCount SAL_CALL ODataAccessToolsFactory::acquire()
58 : : {
59 : 790 : return ORefBase::acquire();
60 : : }
61 : :
62 : : //----------------------------------------------------------------
63 : 790 : oslInterlockedCount SAL_CALL ODataAccessToolsFactory::release()
64 : : {
65 : 790 : return ORefBase::release();
66 : : }
67 : :
68 : : //----------------------------------------------------------------
69 : 136 : ::rtl::Reference< simple::IDataAccessTypeConversion > ODataAccessToolsFactory::getTypeConversionHelper()
70 : : {
71 : 136 : return m_xTypeConversionHelper;
72 : : }
73 : :
74 : : //----------------------------------------------------------------
75 : 0 : ::rtl::Reference< simple::IDataAccessCharSet > ODataAccessToolsFactory::createCharsetHelper( ) const
76 : : {
77 [ # # ]: 0 : return new ODataAccessCharSet;
78 : : }
79 : :
80 : : //----------------------------------------------------------------
81 : 351 : ::rtl::Reference< simple::IDataAccessTools > ODataAccessToolsFactory::getDataAccessTools()
82 : : {
83 : 351 : return m_xToolsHelper;
84 : : }
85 : :
86 : : //----------------------------------------------------------------
87 : : SAL_WNODEPRECATED_DECLARATIONS_PUSH
88 : 0 : ::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 )
90 : : {
91 [ # # ]: 0 : ::std::auto_ptr< ::dbtools::FormattedColumnValue > pValue( new ::dbtools::FormattedColumnValue( _rContext, _rxRowSet, _rxColumn ) );
92 : 0 : return pValue;
93 : : }
94 : : SAL_WNODEPRECATED_DECLARATIONS_POP
95 : :
96 : : //----------------------------------------------------------------
97 : 0 : ::rtl::Reference< simple::ISQLParser > ODataAccessToolsFactory::createSQLParser(const Reference< XMultiServiceFactory >& _rxServiceFactory,const IParseContext* _pContext) const
98 : : {
99 [ # # ]: 0 : return new OSimpleSQLParser(_rxServiceFactory,_pContext);
100 : : }
101 : :
102 : : //........................................................................
103 : : } // namespace connectivity
104 : : //........................................................................
105 : :
106 : :
107 : : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|