22#include <osl/diagnose.h>
24#include <com/sun/star/lang/XServiceInfo.hpp>
25#include <com/sun/star/sdbc/DriverManager.hpp>
32 using namespace css::uno;
33 using namespace css::lang;
34 using namespace css::container;
35 using namespace css::sdbc;
53 Reference< XComponentContext > xContext = ::comphelper::getProcessComponentContext();
54 Reference< XDriverManager2 > xEnumAccess = DriverManager::create( xContext );
56 Reference< XEnumeration > xEnumDrivers = xEnumAccess->createEnumeration();
57 OSL_ENSURE(xEnumDrivers.is(),
"ODriverEnumerationImpl::ODriverEnumerationImpl: invalid enumeration object!");
59 Reference< XServiceInfo > xDriverSI;
60 while (xEnumDrivers->hasMoreElements())
62 xEnumDrivers->nextElement() >>= xDriverSI;
63 OSL_ENSURE(xDriverSI.is(),
"ODriverEnumerationImpl::ODriverEnumerationImpl: driver without service info!");
65 m_aImplNames.push_back(xDriverSI->getImplementationName());
70 TOOLS_WARN_EXCEPTION(
"cui.options",
"ODriverEnumerationImpl::ODriverEnumerationImpl: caught an exception while enumerating the drivers!");
87 return m_pImpl->getDriverImplNames().begin();
93 return m_pImpl->getDriverImplNames().end();
const std::vector< OUString > & getDriverImplNames() const
std::vector< OUString > m_aImplNames
ODriverEnumeration() noexcept
const_iterator end() const noexcept
~ODriverEnumeration() noexcept
std::unique_ptr< ODriverEnumerationImpl > m_pImpl
const_iterator begin() const noexcept
std::vector< OUString >::const_iterator const_iterator
#define TOOLS_WARN_EXCEPTION(area, stream)