cid#1640468 Dereference after null check
[LibreOffice.git] / connectivity / source / drivers / evoab2 / NDriver.hxx
blobb505bb9db5fdadba969a5e59dae29c0000565847
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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 .
20 #pragma once
22 #include <sal/config.h>
24 #include <string_view>
26 #include <com/sun/star/sdbc/XDriver.hpp>
27 #include <com/sun/star/lang/XServiceInfo.hpp>
28 #include <cppuhelper/compbase.hxx>
29 #include <connectivity/CommonTools.hxx>
31 inline constexpr OUString EVOAB_DRIVER_IMPL_NAME = u"com.sun.star.comp.sdbc.evoab.OEvoabDriver"_ustr;
33 namespace connectivity::evoab
35 typedef ::cppu::WeakComponentImplHelper< css::sdbc::XDriver,
36 css::lang::XServiceInfo > ODriver_BASE;
39 class OEvoabDriver final : public ODriver_BASE
41 ::osl::Mutex m_aMutex;
42 connectivity::OWeakRefArray m_xConnections;
43 css::uno::Reference< css::uno::XComponentContext > m_xContext;
45 public:
46 explicit OEvoabDriver(const css::uno::Reference< css::uno::XComponentContext >& );
47 virtual ~OEvoabDriver() override;
49 // OComponentHelper
50 virtual void SAL_CALL disposing() override;
52 // XServiceInfo
53 virtual OUString SAL_CALL getImplementationName( ) override;
54 virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) override;
55 virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames( ) override;
58 // XDriver
59 virtual css::uno::Reference< css::sdbc::XConnection > SAL_CALL connect( const OUString& url, const css::uno::Sequence< css::beans::PropertyValue >& info ) override;
60 virtual sal_Bool SAL_CALL acceptsURL( const OUString& url ) override;
61 virtual css::uno::Sequence< css::sdbc::DriverPropertyInfo > SAL_CALL getPropertyInfo( const OUString& url, const css::uno::Sequence< css::beans::PropertyValue >& info ) override;
62 virtual sal_Int32 SAL_CALL getMajorVersion( ) override;
63 virtual sal_Int32 SAL_CALL getMinorVersion( ) override;
65 public:
66 const css::uno::Reference< css::uno::XComponentContext >& getComponentContext( ) const { return m_xContext; }
68 // static methods
69 static bool acceptsURL_Stat( std::u16string_view url );
74 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */