/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /* * This file is part of the LibreOffice project. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. * * This file incorporates work covered by the following license notice: * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed * with this work for additional information regarding copyright * ownership. The ASF licenses this file to you under the Apache * License, Version 2.0 (the "License"); you may not use this file * except in compliance with the License. You may obtain a copy of * the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
/** throws an SQLException saying that no Mac OS installation was found
*/ void throwNoMacOSException()
{
::connectivity::SharedResources aResources; const OUString sError( aResources.getResourceString(
STR_NO_MAC_OS_FOUND
) );
throwGenericSQLException( sError );
}
if ( !_rFunction )
{ // did not find the symbol
SAL_WARN( "connectivity.macab", "lcl_getFunctionFromModuleOrUnload: could not find the symbol " << _pAsciiSymbolName );
osl_unloadModule( _rModule );
_rModule = nullptr;
}
}
}
}
// when driver will be destroyed so all our connections have to be destroyed as well for (auto& rxConnection : m_xConnections)
{
Reference< XComponent > xComp(rxConnection.get(), UNO_QUERY); if (xComp.is())
xComp->dispose();
}
m_xConnections.clear();
Sequence< OUString > SAL_CALL MacabDriver::getSupportedServiceNames( )
{ // which service is supported // for more information @see com.sun.star.sdbc.Driver return { "com.sun.star.sdbc.Driver" };
}
// create a new connection with the given properties and append it to our vector
MacabConnection* pConnection = m_aImplModule.createConnection( this );
SAL_WARN_IF( !pConnection, "connectivity.macab", "MacabDriver::connect: no connection has been created by the factory!" );
// by definition, the factory function returned an object which was acquired once
Reference< XConnection > xConnection = pConnection;
pConnection->release();
// late constructor call which can throw exception and allows a correct dtor call when so
pConnection->construct( url, info );
// remember it
m_xConnections.push_back( WeakReferenceHelper( *pConnection ) );
if ( !m_aImplModule.isMacOSPresent() ) returnfalse;
// here we have to look whether we support this URL format return url == "sdbc:address:macab";
}
Sequence< DriverPropertyInfo > SAL_CALL MacabDriver::getPropertyInfo( const OUString&, const Sequence< PropertyValue >& )
{ // if you have something special to say, return it here :-) return Sequence< DriverPropertyInfo >();
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.