21#include <com/sun/star/sdbc/SQLException.hpp>
22#include <com/sun/star/uno/Reference.h>
23#include <com/sun/star/beans/PropertyAttribute.hpp>
32ResultSetBase::ResultSetBase(
33 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();
72 static_cast< lang::XComponent*
>(
this),
73 static_cast< sdbc::XRow*
>(
this),
74 static_cast< sdbc::XResultSet*
>(
this),
75 static_cast< sdbc::XResultSetMetaDataSupplier*
>(
this),
76 static_cast< beans::XPropertySet*
>(
this),
77 static_cast< ucb::XContentAccess*
>(
this) );
78 return aRet.
hasValue() ? aRet : OWeakObject::queryInterface( rType );
87 const uno::Reference< lang::XEventListener >& Listener )
101 const uno::Reference< lang::XEventListener >& Listener )
115 lang::EventObject aEvt;
116 aEvt.Source =
static_cast< lang::XComponent *
>( this );
139 return m_nRow < sal::static_int_cast<sal_Int32>(
m_aItems.size());
153 return m_nRow >= sal::static_int_cast<sal_Int32>(
m_aItems.size());
167 if(
m_nRow == sal::static_int_cast<sal_Int32>(
m_aItems.size()) - 1 )
227 return 0<=
m_nRow && m_nRow < sal::static_int_cast<sal_Int32>(
m_aItems.size());
235 throw sdbc::SQLException();
241 while( row++ &&
m_nRow > - 1 )
244 return 0 <=
m_nRow && m_nRow < sal::static_int_cast<sal_Int32>(
m_aItems.size());
255 return 0 <=
m_nRow && m_nRow < sal::static_int_cast<sal_Int32>(
m_aItems.size());
284uno::Reference< uno::XInterface > SAL_CALL
287 return uno::Reference< uno::XInterface >();
309uno::Reference< ucb::XContentIdentifier > SAL_CALL
318 uno::Reference< ucb::XContentIdentifier >(
319 new ::ucbhelper::ContentIdentifier(url) );
324 return uno::Reference<ucb::XContentIdentifier>();
328uno::Reference< ucb::XContent > SAL_CALL
334 return uno::Reference< ucb::XContent >();
339class XPropertySetInfoImpl
341 public beans::XPropertySetInfo
345 explicit XPropertySetInfoImpl(
const uno::Sequence< beans::Property >& aSeq )
350 void SAL_CALL acquire()
353 OWeakObject::acquire();
357 void SAL_CALL release()
360 OWeakObject::release();
367 static_cast< beans::XPropertySetInfo*
>(
this) );
368 return aRet.
hasValue() ? aRet : OWeakObject::queryInterface( rType );
371 uno::Sequence< beans::Property > SAL_CALL getProperties()
override
376 beans::Property SAL_CALL getPropertyByName(
const OUString& aName )
override
378 auto pProp = std::find_if(std::cbegin(m_aSeq), std::cend(m_aSeq),
379 [&aName](
const beans::Property& rProp) {
return aName == rProp.Name; });
380 if (pProp != std::cend(m_aSeq))
382 throw beans::UnknownPropertyException(aName);
385 sal_Bool SAL_CALL hasPropertyByName(
const OUString& Name )
override
387 return std::any_of(std::cbegin(m_aSeq), std::cend(m_aSeq),
388 [&Name](
const beans::Property& rProp) {
return Name == rProp.Name; });
393 uno::Sequence< beans::Property >
m_aSeq;
399uno::Reference< beans::XPropertySetInfo > SAL_CALL
402 uno::Sequence< beans::Property > seq
408 return uno::Reference< beans::XPropertySetInfo > (
409 new XPropertySetInfoImpl( seq ) );
414 const OUString& aPropertyName,
const uno::Any& )
416 if( aPropertyName ==
"IsRowCountFinal" ||
417 aPropertyName ==
"RowCount" )
420 throw beans::UnknownPropertyException(aPropertyName);
425 const OUString& PropertyName )
427 if( PropertyName ==
"IsRowCountFinal" )
431 else if ( PropertyName ==
"RowCount" )
437 throw beans::UnknownPropertyException(PropertyName);
442 const OUString& aPropertyName,
443 const uno::Reference< beans::XPropertyChangeListener >& xListener )
445 if( aPropertyName ==
"IsRowCountFinal" )
454 else if ( aPropertyName ==
"RowCount" )
463 throw beans::UnknownPropertyException(aPropertyName);
468 const OUString& aPropertyName,
469 const uno::Reference< beans::XPropertyChangeListener >& aListener )
471 if( aPropertyName ==
"IsRowCountFinal" &&
477 else if ( aPropertyName ==
"RowCount" &&
484 throw beans::UnknownPropertyException(aPropertyName);
490 const uno::Reference< beans::XVetoableChangeListener >& )
497 const uno::Reference< beans::XVetoableChangeListener >& )
503uno::Reference< sdbc::XResultSetMetaData > SAL_CALL
Reference< XComponentContext > m_xContext
css::uno::Type const & get()
virtual sal_Bool SAL_CALL isAfterLast() override
virtual void SAL_CALL addVetoableChangeListener(const OUString &PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener > &aListener) override
virtual sal_Bool SAL_CALL rowUpdated() override
virtual void SAL_CALL acquire() noexcept override
virtual sal_Bool SAL_CALL previous() override
std::vector< OUString > m_aPath
css::uno::Sequence< css::beans::Property > m_sProperty
virtual css::uno::Reference< css::sdbc::XResultSetMetaData > SAL_CALL getMetaData() override
std::unique_ptr< comphelper::OInterfaceContainerHelper3< css::lang::XEventListener > > m_pDisposeEventListeners
virtual void SAL_CALL addEventListener(const css::uno::Reference< css::lang::XEventListener > &xListener) override
css::uno::Reference< css::uno::XComponentContext > m_xContext
virtual sal_Bool SAL_CALL next() override
virtual void SAL_CALL refreshRow() override
virtual sal_Bool SAL_CALL rowInserted() override
std::unique_ptr< comphelper::OInterfaceContainerHelper3< css::beans::XPropertyChangeListener > > m_pIsFinalListeners
virtual sal_Bool SAL_CALL relative(sal_Int32 rows) override
css::uno::Reference< css::ucb::XContentProvider > m_xProvider
virtual void SAL_CALL beforeFirst() override
virtual void SAL_CALL close() override
virtual sal_Bool SAL_CALL first() override
virtual void SAL_CALL removePropertyChangeListener(const OUString &aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener > &aListener) 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 OUString SAL_CALL queryContentIdentifierString() override
virtual sal_Bool SAL_CALL absolute(sal_Int32 row) override
virtual void SAL_CALL removeVetoableChangeListener(const OUString &PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener > &aListener) override
virtual sal_Bool SAL_CALL last() override
virtual sal_Bool SAL_CALL rowDeleted() override
virtual sal_Bool SAL_CALL isBeforeFirst() override
virtual css::uno::Reference< css::uno::XInterface > SAL_CALL getStatement() override
virtual css::uno::Reference< css::ucb::XContent > SAL_CALL queryContent() override
virtual void SAL_CALL setPropertyValue(const OUString &aPropertyName, const css::uno::Any &aValue) override
virtual void SAL_CALL removeEventListener(const css::uno::Reference< css::lang::XEventListener > &aListener) override
virtual void SAL_CALL afterLast() override
virtual css::uno::Any SAL_CALL queryInterface(const css::uno::Type &aType) 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
virtual css::uno::Any SAL_CALL getPropertyValue(const OUString &PropertyName) override
std::unique_ptr< comphelper::OInterfaceContainerHelper3< css::beans::XPropertyChangeListener > > m_pRowCountListeners
virtual void SAL_CALL addPropertyChangeListener(const OUString &aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener > &xListener) override
Sequence< sal_Int8 > aSeq
css::uno::Any SAL_CALL queryInterface(const css::uno::Type &rType, Interface1 *p1)
Definition of ftpcontentprovider.