Coverage Report

Created: 2026-07-10 11:04

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/libreoffice/desktop/source/deployment/inc/dp_ucb.h
Line
Count
Source
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
28
namespace dp_misc {
29
30
struct DESKTOP_DEPLOYMENTMISC_DLLPUBLIC StrTitle
31
{
32
    static OUString getTitle( ::ucbhelper::Content &rContent )
33
0
    {
34
0
        return rContent.getPropertyValue(u"Title"_ustr).get<OUString>();
35
0
    }
36
    // just return titles - the ucbhelper should have a simpler API for this [!]
37
    static css::uno::Reference< css::sdbc::XResultSet >
38
        createCursor( ::ucbhelper::Content &rContent,
39
                      ucbhelper::ResultSetInclude eInclude )
40
0
    {
41
0
        return rContent.createCursor({ u"Title"_ustr }, eInclude);
42
0
    }
43
};
44
45
46
DESKTOP_DEPLOYMENTMISC_DLLPUBLIC bool create_ucb_content(
47
    ::ucbhelper::Content * ucb_content,
48
    OUString const & url,
49
    css::uno::Reference<css::ucb::XCommandEnvironment> const & xCmdEnv,
50
    bool throw_exc = true );
51
52
53
/** @return true if previously non-existing folder has been created
54
 */
55
DESKTOP_DEPLOYMENTMISC_DLLPUBLIC bool create_folder(
56
    ::ucbhelper::Content * ucb_content,
57
    OUString const & url,
58
    css::uno::Reference<css::ucb::XCommandEnvironment> const & xCmdEnv,
59
    bool throw_exc = true );
60
61
62
DESKTOP_DEPLOYMENTMISC_DLLPUBLIC bool erase_path(
63
    OUString const & url,
64
    css::uno::Reference<css::ucb::XCommandEnvironment> const & xCmdEnv,
65
    bool throw_exc = true );
66
67
68
DESKTOP_DEPLOYMENTMISC_DLLPUBLIC
69
std::vector<sal_Int8> readFile( ::ucbhelper::Content & ucb_content );
70
71
72
DESKTOP_DEPLOYMENTMISC_DLLPUBLIC
73
bool readLine( OUString * res, std::u16string_view startingWith,
74
               ::ucbhelper::Content & ucb_content, rtl_TextEncoding textenc );
75
76
DESKTOP_DEPLOYMENTMISC_DLLPUBLIC
77
bool readProperties( std::vector< std::pair< OUString, OUString> > & out_result,
78
                ::ucbhelper::Content & ucb_content);
79
80
81
82
}
83
84
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */