22#include <com/sun/star/ucb/IllegalIdentifierException.hpp>
23#include <com/sun/star/ucb/OpenMode.hpp>
35 : mxContent(
std::move(xContent)), mnOpenMode(nOpenMode), mbCountFinal(false)
39bool DataSupplier::getData()
46 GFileEnumerator* pEnumerator = g_file_enumerate_children(pFile,
"*",
47 G_FILE_QUERY_INFO_NONE,
nullptr,
nullptr);
52 GFileInfo *pInfo =
nullptr;
53 while ((pInfo = g_file_enumerator_next_file (pEnumerator,
nullptr,
nullptr)))
57 case css::ucb::OpenMode::FOLDERS:
58 if (g_file_info_get_file_type(pInfo) != G_FILE_TYPE_DIRECTORY)
61 case css::ucb::OpenMode::DOCUMENTS:
62 if (g_file_info_get_file_type(pInfo) != G_FILE_TYPE_REGULAR)
65 case css::ucb::OpenMode::ALL:
71 g_object_unref(pInfo);
76 g_file_enumerator_close(pEnumerator,
nullptr,
nullptr);
89 if ( aId.getLength() )
99 char* parent = g_file_get_uri(pFile);
100 OUString aId = OUString::createFromAscii( parent );
104 g_uri_escape_string( g_file_info_get_name(
maResults[
nIndex ]->pInfo) ,
nullptr,
false);
106 if ( ( aId.lastIndexOf(
'/' ) + 1 ) != aId.getLength() )
109 aId += OUString::createFromAscii( escaped_name );
111 g_free( escaped_name );
124 css::uno::Reference< css::ucb::XContentIdentifier > xId =
maResults[
nIndex ]->xId;
133 if ( aId.getLength() )
140 return css::uno::Reference< css::ucb::XContentIdentifier >();
147 css::uno::Reference< css::ucb::XContent > xContent =
maResults[
nIndex ]->xContent;
160 css::uno::Reference< css::ucb::XContent > xContent =
mxContent->getProvider()->queryContent( xId );
164 catch ( css::ucb::IllegalIdentifierException& )
168 return css::uno::Reference< css::ucb::XContent >();
202 css::uno::Reference< css::sdbc::XRow > xRow =
maResults[
nIndex ]->xRow;
217 css::uno::Reference< css::ucb::XCommandProcessor > xCmdProc(
218 xContent, css::uno::UNO_QUERY_THROW );
219 sal_Int32 nCmdId( xCmdProc->createCommandIdentifier() );
220 css::ucb::Command aCmd;
221 aCmd.Name =
"getPropertyValues";
224 css::uno::Any aResult( xCmdProc->execute(
226 css::uno::Reference< css::sdbc::XRow > xRow;
227 if ( aResult >>= xRow )
233 catch ( css::uno::Exception
const & )
238 return css::uno::Reference< css::sdbc::XRow >();
virtual sal_uInt32 totalCount() override
virtual void releasePropertyValues(sal_uInt32 nIndex) override
virtual css::uno::Reference< css::sdbc::XRow > queryPropertyValues(sal_uInt32 nIndex) override
virtual OUString queryContentIdentifierString(sal_uInt32 nIndex) override
virtual bool isCountFinal() override
DataSupplier(rtl::Reference< Content > xContent, sal_Int32 nOpenMode)
virtual css::uno::Reference< css::ucb::XContentIdentifier > queryContentIdentifier(sal_uInt32 nIndex) override
virtual ~DataSupplier() override
virtual bool getResult(sal_uInt32 nIndex) override
virtual sal_uInt32 currentCount() override
rtl::Reference< ::gio::Content > mxContent
virtual css::uno::Reference< css::ucb::XContent > queryContent(sal_uInt32 nIndex) override
virtual void validate() override
virtual void close() override
rtl::Reference< ResultSet > getResultSet() const
css::uno::Environment getEnvironment(OUString const &name, std::u16string_view implementation)