Coverage Report

Created: 2026-11-06 11:29

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/libreoffice/stoc/source/uriproc/UriReference.hxx
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
#ifndef INCLUDED_STOC_SOURCE_URIPROC_URIREFERENCE_HXX
21
#define INCLUDED_STOC_SOURCE_URIPROC_URIREFERENCE_HXX
22
23
#include <mutex>
24
#include <rtl/ustring.hxx>
25
#include <sal/types.h>
26
#include <rtl/ustrbuf.hxx>
27
28
namespace stoc::uriproc {
29
30
class UriReference {
31
public:
32
    UriReference(
33
        OUString scheme, bool hasAuthority,
34
        OUString const & authority, OUString path,
35
        bool hasQuery, OUString const & query);
36
37
    ~UriReference();
38
39
    /// @throws css::uno::RuntimeException
40
    OUString getUriReference();
41
42
    /// @throws css::uno::RuntimeException
43
    bool isAbsolute() const;
44
45
    /// @throws css::uno::RuntimeException
46
26.1k
    const OUString& getScheme() const { return m_scheme;}
47
48
    /// @throws css::uno::RuntimeException
49
    OUString getSchemeSpecificPart();
50
51
    /// @throws css::uno::RuntimeException
52
    bool isHierarchical();
53
54
    /// @throws css::uno::RuntimeException
55
    bool hasAuthority() const;
56
57
    /// @throws css::uno::RuntimeException
58
    const OUString& getAuthority() const;
59
60
    /// @throws css::uno::RuntimeException
61
    OUString getPath();
62
63
    /// @throws css::uno::RuntimeException
64
    bool hasRelativePath();
65
66
    /// @throws css::uno::RuntimeException
67
    sal_Int32 getPathSegmentCount();
68
69
    /// @throws css::uno::RuntimeException
70
    OUString getPathSegment(sal_Int32 index);
71
72
    /// @throws css::uno::RuntimeException
73
    bool hasQuery() const;
74
75
    /// @throws css::uno::RuntimeException
76
    const OUString& getQuery() const;
77
78
    /// @throws css::uno::RuntimeException
79
    bool hasFragment();
80
81
    /// @throws css::uno::RuntimeException
82
    OUString getFragment();
83
84
    /// @throws css::uno::RuntimeException
85
    void setFragment(OUString const & fragment);
86
87
    /// @throws css::uno::RuntimeException
88
    void clearFragment();
89
90
    std::mutex m_mutex;
91
    OUString m_path;
92
93
private:
94
    UriReference(UriReference const &) = delete;
95
    void operator =(UriReference const &) = delete;
96
97
    void appendSchemeSpecificPart(OUStringBuffer & buffer) const;
98
99
    OUString m_scheme;
100
    OUString m_authority;
101
    OUString m_query;
102
    OUString m_fragment;
103
    bool m_hasAuthority;
104
    bool m_hasQuery;
105
    bool m_hasFragment;
106
};
107
108
}
109
110
#endif
111
112
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */