LibreOffice Module ucb (master) 1
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
22#include <rtl/ref.hxx>
23#include <com/sun/star/ucb/Command.hpp>
24#include "ftpresultsetI.hxx"
25#include "ftpcontent.hxx"
26
27
28using namespace ftp;
29using namespace com::sun::star::ucb;
30using namespace com::sun::star::lang;
31using namespace com::sun::star::uno;
32using namespace com::sun::star::beans;
33using namespace com::sun::star::sdbc;
34
35
36ResultSetI::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) {
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 &
65 else if(Name == "IsDocument")
66 xRow->appendBoolean(rProp,
67 (dirvec[n].m_nMode &
69 else if(Name == "IsFolder")
70 xRow->appendBoolean(rProp,
71 ( dirvec[n].m_nMode &
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,
83 else
84 xRow->appendVoid(rProp);
85 }
86 m_aItems[n].set(xRow);
87 }
88}
89
90/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
static css::uno::Sequence< css::ucb::ContentInfo > queryCreatableContentsInfo_Static()
Definition: ftpcontent.cxx:588
std::vector< OUString > m_aPath
sal_Int64 n
sal_uInt32 m_nSize
Definition of ftpcontentprovider.
@ INETCOREFTP_FILEMODE_ISDIR
Definition: ftpdirp.hxx:67
@ INETCOREFTP_FILEMODE_WRITE
Definition: ftpdirp.hxx:66
int i
OUString m_aName
Definition: pkgprovider.cxx:56
OUString Name