LibreOffice Module ucb (master)
1
ucb
source
ucp
ftp
ftpresultsetI.cxx
Go to the documentation of this file.
1
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2
/*
3
* This file is part of the LibreOffice project.
4
*
5
* This Source Code Form is subject to the terms of the Mozilla Public
6
* License, v. 2.0. If a copy of the MPL was not distributed with this
7
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
8
*
9
* This file incorporates work covered by the following license notice:
10
*
11
* Licensed to the Apache Software Foundation (ASF) under one or more
12
* contributor license agreements. See the NOTICE file distributed
13
* with this work for additional information regarding copyright
14
* ownership. The ASF licenses this file to you under the Apache
15
* License, Version 2.0 (the "License"); you may not use this file
16
* except in compliance with the License. You may obtain a copy of
17
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
18
*/
19
20
21
#include <
ucbhelper/propertyvalueset.hxx
>
22
#include <rtl/ref.hxx>
23
#include <com/sun/star/ucb/Command.hpp>
24
#include "
ftpresultsetI.hxx
"
25
#include "
ftpcontent.hxx
"
26
27
28
using namespace
ftp
;
29
using namespace
com::sun::star::ucb
;
30
using namespace
com::sun::star::lang
;
31
using namespace
com::sun::star::uno
;
32
using namespace
com::sun::star::beans
;
33
using namespace
com::sun::star::sdbc
;
34
35
36
ResultSetI::ResultSetI(
const
Reference<XComponentContext>
& rxContext,
37
const
Reference<XContentProvider>
& xProvider,
38
const
Sequence<Property>
& seqProp,
39
const
std::vector<FTPDirentry>& dirvec)
40
:
ResultSetBase
(rxContext,xProvider,seqProp)
41
{
42
for
(
const
auto
&
i
: dirvec)
43
m_aPath
.push_back(
i
.m_aURL);
44
45
// m_aIdents holds the content identifiers
46
47
m_aItems
.resize(
m_aPath
.size() );
48
m_aIdents
.resize(
m_aPath
.size() );
49
50
for
(
size_t
n
= 0;
n
<
m_aItems
.size(); ++
n
) {
51
rtl::Reference<ucbhelper::PropertyValueSet>
xRow =
52
new
ucbhelper::PropertyValueSet
(rxContext);
53
54
for
(
const
auto
& rProp : seqProp) {
55
const
OUString&
Name
= rProp.Name;
56
if
(
Name
==
"ContentType"
)
57
xRow->appendString(rProp,
58
OUString(
"application/ftp"
));
59
else
if
(
Name
==
"Title"
)
60
xRow->appendString(rProp,dirvec[
n
].
m_aName
);
61
else
if
(
Name
==
"IsReadOnly"
)
62
xRow->appendBoolean(rProp,
63
(dirvec[
n
].m_nMode &
64
INETCOREFTP_FILEMODE_WRITE
) ==
INETCOREFTP_FILEMODE_WRITE
);
65
else
if
(
Name
==
"IsDocument"
)
66
xRow->appendBoolean(rProp,
67
(dirvec[
n
].m_nMode &
68
INETCOREFTP_FILEMODE_ISDIR
) !=
INETCOREFTP_FILEMODE_ISDIR
);
69
else
if
(
Name
==
"IsFolder"
)
70
xRow->appendBoolean(rProp,
71
( dirvec[
n
].m_nMode &
72
INETCOREFTP_FILEMODE_ISDIR
) ==
INETCOREFTP_FILEMODE_ISDIR
);
73
else
if
(
Name
==
"Size"
)
74
xRow->appendLong(rProp,
75
dirvec[
n
].
m_nSize
);
76
else
if
(
Name
==
"DateCreated"
)
77
xRow->appendTimestamp(rProp,
78
dirvec[
n
].m_aDate);
79
else
if
(
Name
==
"CreatableContentsInfo"
)
80
xRow->appendObject(
81
rProp,
82
Any
(
FTPContent::queryCreatableContentsInfo_Static
()));
83
else
84
xRow->appendVoid(rProp);
85
}
86
m_aItems
[
n
].set(xRow);
87
}
88
}
89
90
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
com::sun::star::uno::Reference
com::sun::star::uno::Sequence
ftp::FTPContent::queryCreatableContentsInfo_Static
static css::uno::Sequence< css::ucb::ContentInfo > queryCreatableContentsInfo_Static()
Definition:
ftpcontent.cxx:588
ftp::ResultSetBase
Definition:
ftpresultsetbase.hxx:48
ftp::ResultSetBase::m_aPath
std::vector< OUString > m_aPath
Definition:
ftpresultsetbase.hxx:395
ftp::ResultSetBase::m_aIdents
IdentSet m_aIdents
Definition:
ftpresultsetbase.hxx:393
ftp::ResultSetBase::m_aItems
ItemSet m_aItems
Definition:
ftpresultsetbase.hxx:394
rtl::Reference
ucbhelper::PropertyValueSet
GotoObjFlags::Any
@ Any
ftpcontent.hxx
ftpresultsetI.hxx
n
sal_Int64 n
m_nSize
sal_uInt32 m_nSize
com::sun::star::beans
com::sun::star::lang
com::sun::star::sdbc
com::sun::star::ucb
com::sun::star::uno
ftp
Definition of ftpcontentprovider.
Definition:
ftpcontainer.hxx:29
ftp::INETCOREFTP_FILEMODE_ISDIR
@ INETCOREFTP_FILEMODE_ISDIR
Definition:
ftpdirp.hxx:67
ftp::INETCOREFTP_FILEMODE_WRITE
@ INETCOREFTP_FILEMODE_WRITE
Definition:
ftpdirp.hxx:66
i
int i
m_aName
OUString m_aName
Definition:
pkgprovider.cxx:56
propertyvalueset.hxx
Name
OUString Name
Generated on Sun Jul 30 2023 04:27:00 for LibreOffice Module ucb (master) by
1.9.3