LibreOffice Module desktop (master) 1
dp_ucb.h
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#pragma once
21
22#include <vector>
23#include <com/sun/star/sdbc/XResultSet.hpp>
24#include <com/sun/star/ucb/XCommandEnvironment.hpp>
25#include "dp_misc_api.hxx"
26#include <ucbhelper/content.hxx>
27
28namespace ucbhelper
29{
30class Content;
31}
32
33namespace dp_misc {
34
36{
37 static css::uno::Sequence< OUString > getTitleSequence()
38 {
39 css::uno::Sequence<OUString> aSeq { "Title" };
40 return aSeq;
41 }
42 static OUString getTitle( ::ucbhelper::Content &rContent )
43 {
44 return rContent.getPropertyValue("Title").get<OUString>();
45 }
46 // just return titles - the ucbhelper should have a simpler API for this [!]
47 static css::uno::Reference< css::sdbc::XResultSet >
50 {
51 return rContent.createCursor( StrTitle::getTitleSequence(), eInclude );
52 }
53};
54
55
57 ::ucbhelper::Content * ucb_content,
58 OUString const & url,
59 css::uno::Reference<css::ucb::XCommandEnvironment> const & xCmdEnv,
60 bool throw_exc = true );
61
62
66 ::ucbhelper::Content * ucb_content,
67 OUString const & url,
68 css::uno::Reference<css::ucb::XCommandEnvironment> const & xCmdEnv,
69 bool throw_exc = true );
70
71
73 OUString const & url,
74 css::uno::Reference<css::ucb::XCommandEnvironment> const & xCmdEnv,
75 bool throw_exc = true );
76
77
79std::vector<sal_Int8> readFile( ::ucbhelper::Content & ucb_content );
80
81
83bool readLine( OUString * res, std::u16string_view startingWith,
84 ::ucbhelper::Content & ucb_content, rtl_TextEncoding textenc );
85
87bool readProperties( std::vector< std::pair< OUString, OUString> > & out_result,
88 ::ucbhelper::Content & ucb_content);
89
90
91
92}
93
94/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
css::uno::Any getPropertyValue(const OUString &rPropertyName)
css::uno::Reference< css::sdbc::XResultSet > createCursor(const css::uno::Sequence< OUString > &rPropertyNames, ResultSetInclude eMode=INCLUDE_FOLDERS_AND_DOCUMENTS)
#define DESKTOP_DEPLOYMENTMISC_DLLPUBLIC
Definition: dp_misc_api.hxx:28
Sequence< sal_Int8 > aSeq
DESKTOP_DEPLOYMENTMISC_DLLPUBLIC bool create_folder(::ucbhelper::Content *ucb_content, OUString const &url, css::uno::Reference< css::ucb::XCommandEnvironment > const &xCmdEnv, bool throw_exc=true)
DESKTOP_DEPLOYMENTMISC_DLLPUBLIC bool readProperties(std::vector< std::pair< OUString, OUString > > &out_result, ::ucbhelper::Content &ucb_content)
Definition: dp_ucb.cxx:256
DESKTOP_DEPLOYMENTMISC_DLLPUBLIC bool erase_path(OUString const &url, css::uno::Reference< css::ucb::XCommandEnvironment > const &xCmdEnv, bool throw_exc=true)
DESKTOP_DEPLOYMENTMISC_DLLPUBLIC bool create_ucb_content(::ucbhelper::Content *ucb_content, OUString const &url, css::uno::Reference< css::ucb::XCommandEnvironment > const &xCmdEnv, bool throw_exc=true)
DESKTOP_DEPLOYMENTMISC_DLLPUBLIC bool readLine(OUString *res, std::u16string_view startingWith, ::ucbhelper::Content &ucb_content, rtl_TextEncoding textenc)
Definition: dp_ucb.cxx:200
DESKTOP_DEPLOYMENTMISC_DLLPUBLIC std::vector< sal_Int8 > readFile(::ucbhelper::Content &ucb_content)
Definition: dp_ucb.cxx:187
static OUString getTitle(::ucbhelper::Content &rContent)
Definition: dp_ucb.h:42
static css::uno::Sequence< OUString > getTitleSequence()
Definition: dp_ucb.h:37
static css::uno::Reference< css::sdbc::XResultSet > createCursor(::ucbhelper::Content &rContent, ucbhelper::ResultSetInclude eInclude)
Definition: dp_ucb.h:48