Coverage Report

Created: 2025-07-07 10:01

/src/libreoffice/connectivity/source/inc/TConnection.hxx
Line
Count
Source (jump to first uncovered line)
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
#pragma once
20
21
#include <rtl/textenc.h>
22
#include <com/sun/star/beans/PropertyValue.hpp>
23
#include <com/sun/star/lang/XServiceInfo.hpp>
24
#include <com/sun/star/lang/XUnoTunnel.hpp>
25
#include <com/sun/star/sdbc/XWarningsSupplier.hpp>
26
#include <com/sun/star/sdbc/XConnection.hpp>
27
#include <cppuhelper/compbase.hxx>
28
#include "propertyids.hxx"
29
#include <connectivity/CommonTools.hxx>
30
#include <connectivity/dbtoolsdllapi.hxx>
31
#include "resource/sharedresources.hxx"
32
33
namespace connectivity
34
{
35
    typedef ::cppu::WeakComponentImplHelper<   css::sdbc::XConnection,
36
                                               css::sdbc::XWarningsSupplier,
37
                                               css::lang::XServiceInfo,
38
                                               css::lang::XUnoTunnel
39
                                           > OMetaConnection_BASE;
40
41
    class OOO_DLLPUBLIC_DBTOOLS OMetaConnection : public OMetaConnection_BASE
42
    {
43
    protected:
44
        ::osl::Mutex                    m_aMutex;
45
        css::uno::Sequence< css::beans::PropertyValue >
46
                                        m_aConnectionInfo;
47
        connectivity::OWeakRefArray     m_aStatements;  //  vector containing a list
48
                                                        //  of all the Statement objects
49
                                                        //  for this Connection
50
        OUString                        m_sURL;
51
        rtl_TextEncoding                m_nTextEncoding; // the encoding which is used for all text conversions
52
        css::uno::WeakReference< css::sdbc::XDatabaseMetaData >
53
                                        m_xMetaData;
54
        SharedResources                 m_aResources;
55
    public:
56
57
        static ::dbtools::OPropertyMap& getPropMap();
58
59
        OMetaConnection();
60
61
39.0k
        rtl_TextEncoding getTextEncoding() const { return m_nTextEncoding; }
62
108k
        const OUString&         getURL() const  { return m_sURL; }
63
9.91k
        void             setURL(const OUString& _rsUrl) { m_sURL = _rsUrl; }
64
        [[noreturn]] void throwGenericSQLException(TranslateId pErrorResourceId, const css::uno::Reference< css::uno::XInterface>& _xContext);
65
210
        const SharedResources& getResources() const { return m_aResources;}
66
67
0
        void setConnectionInfo(const css::uno::Sequence< css::beans::PropertyValue >& _aInfo) { m_aConnectionInfo = _aInfo; }
68
        const css::uno::Sequence< css::beans::PropertyValue >&
69
19.8k
            getConnectionInfo() const { return m_aConnectionInfo; }
70
71
        // OComponentHelper
72
        virtual void SAL_CALL disposing() override;
73
74
        //XUnoTunnel
75
        virtual sal_Int64 SAL_CALL getSomething( const css::uno::Sequence< sal_Int8 >& aIdentifier ) override;
76
        static const css::uno::Sequence< sal_Int8 > & getUnoTunnelId();
77
    };
78
}
79
80
81
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */