21#include <com/sun/star/sdbc/SQLException.hpp>
22#include <com/sun/star/uno/Reference.h>
23#include <com/sun/star/beans/PropertyAttribute.hpp>
33ResultSetBase::ResultSetBase( uno::Reference< uno::XComponentContext > xContext,
34 uno::Reference< ucb::XContentProvider > xProvider,
35 const uno::Sequence< beans::Property >& seq )
37 m_xProvider(
std::move( xProvider )),
44ResultSetBase::~ResultSetBase()
55 OWeakObject::acquire();
63 OWeakObject::release();
71 static_cast< lang::XComponent*
>(
this),
72 static_cast< sdbc::XRow*
>(
this),
73 static_cast< sdbc::XResultSet*
>(
this),
74 static_cast< sdbc::XResultSetMetaDataSupplier*
>(
this),
75 static_cast< beans::XPropertySet*
>(
this),
76 static_cast< ucb::XContentAccess*
>(
this) );
77 return aRet.
hasValue() ? aRet : OWeakObject::queryInterface( rType );
86 const uno::Reference< lang::XEventListener >& Listener )
95 const uno::Reference< lang::XEventListener >& Listener )
105 std::unique_lock aGuard(
m_aMutex );
107 lang::EventObject aEvt;
108 aEvt.Source =
static_cast< lang::XComponent *
>( this );
131 return sal::static_int_cast<sal_uInt32>(
m_nRow ) <
m_aItems.size();
145 return sal::static_int_cast<sal_uInt32>(
m_nRow ) >=
m_aItems.size();
159 if( sal::static_int_cast<sal_uInt32>(
m_nRow ) ==
m_aItems.size() - 1 )
227 throw sdbc::SQLException();
233 while( row++ &&
m_nRow > -1 )
243 if( sal::static_int_cast<sal_uInt32>(
m_nRow ) >
m_aItems.size() )
276uno::Reference< uno::XInterface > SAL_CALL
279 return uno::Reference< uno::XInterface >();
301uno::Reference< ucb::XContentIdentifier > SAL_CALL
312 return uno::Reference< ucb::XContentIdentifier >();
316uno::Reference< ucb::XContent > SAL_CALL
322 return uno::Reference< ucb::XContent >();
327class XPropertySetInfoImpl
329 public beans::XPropertySetInfo
333 explicit XPropertySetInfoImpl(
const uno::Sequence< beans::Property >& aSeq )
338 void SAL_CALL acquire()
341 OWeakObject::acquire();
345 void SAL_CALL release()
348 OWeakObject::release();
354 static_cast< beans::XPropertySetInfo*
>(
this) );
355 return aRet.
hasValue() ? aRet : OWeakObject::queryInterface( rType );
358 uno::Sequence< beans::Property > SAL_CALL getProperties()
override
363 beans::Property SAL_CALL getPropertyByName(
const OUString& aName )
override
365 auto pProp = std::find_if(std::cbegin(m_aSeq), std::cend(m_aSeq),
366 [&aName](
const beans::Property& rProp) {
return aName == rProp.Name; });
367 if (pProp != std::cend(m_aSeq))
369 throw beans::UnknownPropertyException(aName);
372 sal_Bool SAL_CALL hasPropertyByName(
const OUString& Name )
override
374 return std::any_of(std::cbegin(m_aSeq), std::cend(m_aSeq),
375 [&Name](
const beans::Property& rProp) {
return Name == rProp.Name; });
380 uno::Sequence< beans::Property >
m_aSeq;
386uno::Reference< beans::XPropertySetInfo > SAL_CALL
389 uno::Sequence< beans::Property > seq
396 return uno::Reference< beans::XPropertySetInfo > (
new XPropertySetInfoImpl( seq ) );
401 const OUString& aPropertyName,
const uno::Any& )
403 if( aPropertyName ==
"IsRowCountFinal" ||
404 aPropertyName ==
"RowCount" )
407 throw beans::UnknownPropertyException(aPropertyName);
412 const OUString& PropertyName )
414 if( PropertyName ==
"IsRowCountFinal" )
418 else if ( PropertyName ==
"RowCount" )
424 throw beans::UnknownPropertyException(PropertyName);
429 const OUString& aPropertyName,
430 const uno::Reference< beans::XPropertyChangeListener >& xListener )
432 if( aPropertyName ==
"IsRowCountFinal" )
434 std::unique_lock aGuard(
m_aMutex );
437 else if ( aPropertyName ==
"RowCount" )
439 std::unique_lock aGuard(
m_aMutex );
443 throw beans::UnknownPropertyException(aPropertyName);
448 const OUString& aPropertyName,
449 const uno::Reference< beans::XPropertyChangeListener >& aListener )
451 if( aPropertyName ==
"IsRowCountFinal" )
453 std::unique_lock aGuard(
m_aMutex );
456 else if ( aPropertyName ==
"RowCount" )
458 std::unique_lock aGuard(
m_aMutex );
462 throw beans::UnknownPropertyException(aPropertyName);
468 const uno::Reference< beans::XVetoableChangeListener >& )
474 const uno::Reference< beans::XVetoableChangeListener >& )
479uno::Reference< sdbc::XResultSetMetaData > SAL_CALL
Reference< XComponentContext > m_xContext
virtual sal_Bool SAL_CALL isAfterLast() override
virtual sal_Bool SAL_CALL rowUpdated() override
virtual void SAL_CALL acquire() noexcept override
virtual sal_Bool SAL_CALL previous() override
virtual css::uno::Reference< css::sdbc::XResultSetMetaData > SAL_CALL getMetaData() override
comphelper::OInterfaceContainerHelper4< css::lang::XEventListener > m_aDisposeEventListeners
virtual sal_Bool SAL_CALL next() override
virtual void SAL_CALL setPropertyValue(const OUString &aPropertyName, const css::uno::Any &aValue) override
virtual void SAL_CALL refreshRow() override
virtual sal_Bool SAL_CALL rowInserted() override
comphelper::OInterfaceContainerHelper4< css::beans::XPropertyChangeListener > m_aIsFinalListeners
virtual void SAL_CALL addVetoableChangeListener(const OUString &PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener > &aListener) override
virtual sal_Bool SAL_CALL relative(sal_Int32 rows) override
virtual void SAL_CALL beforeFirst() override
virtual void SAL_CALL removeVetoableChangeListener(const OUString &PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener > &aListener) override
virtual void SAL_CALL close() override
std::vector< OUString > m_aPath
virtual sal_Bool SAL_CALL first() override
virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo() override
virtual void SAL_CALL dispose() override
virtual sal_Bool SAL_CALL isLast() override
virtual void SAL_CALL removeEventListener(const css::uno::Reference< css::lang::XEventListener > &aListener) override
virtual OUString SAL_CALL queryContentIdentifierString() override
css::uno::Reference< css::uno::XComponentContext > m_xContext
virtual sal_Bool SAL_CALL absolute(sal_Int32 row) override
virtual sal_Bool SAL_CALL last() override
css::uno::Reference< css::ucb::XContentProvider > m_xProvider
virtual sal_Bool SAL_CALL rowDeleted() override
virtual sal_Bool SAL_CALL isBeforeFirst() override
virtual css::uno::Any SAL_CALL queryInterface(const css::uno::Type &aType) override
virtual void SAL_CALL addEventListener(const css::uno::Reference< css::lang::XEventListener > &xListener) override
css::uno::Sequence< css::beans::Property > m_sProperty
virtual css::uno::Reference< css::uno::XInterface > SAL_CALL getStatement() override
virtual void SAL_CALL addPropertyChangeListener(const OUString &aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener > &xListener) override
virtual css::uno::Reference< css::ucb::XContent > SAL_CALL queryContent() override
virtual void SAL_CALL afterLast() override
virtual void SAL_CALL removePropertyChangeListener(const OUString &aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener > &aListener) override
virtual css::uno::Reference< css::ucb::XContentIdentifier > SAL_CALL queryContentIdentifier() override
virtual sal_Bool SAL_CALL isFirst() override
virtual void SAL_CALL release() noexcept override
virtual sal_Int32 SAL_CALL getRow() override
comphelper::OInterfaceContainerHelper4< css::beans::XPropertyChangeListener > m_aRowCountListeners
virtual css::uno::Any SAL_CALL getPropertyValue(const OUString &PropertyName) override
sal_Int32 addInterface(std::unique_lock< std::mutex > &rGuard, const css::uno::Reference< ListenerT > &rxIFace)
void disposeAndClear(::std::unique_lock<::std::mutex > &rGuard, const css::lang::EventObject &rEvt)
sal_Int32 getLength(std::unique_lock< std::mutex > &rGuard) const
sal_Int32 removeInterface(std::unique_lock< std::mutex > &rGuard, const css::uno::Reference< ListenerT > &rxIFace)
css::uno::Type const & get()
Sequence< sal_Int8 > aSeq
css::uno::Any SAL_CALL queryInterface(const css::uno::Type &rType, Interface1 *p1)