Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Toggle main menu visibility
Loading...
Searching...
No Matches
qcompressedhelpinfo.cpp
Go to the documentation of this file.
1
// Copyright (C) 2019 The Qt Company Ltd.
2
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3
// Qt-Security score:critical reason:data-parser
4
5
#
include
"qcompressedhelpinfo.h"
6
7
#
include
"qhelpdbreader_p.h"
8
9
#
include
<
QtCore
/
qversionnumber
.
h
>
10
11
QT_BEGIN_NAMESPACE
12
13
using
namespace
Qt::StringLiterals;
14
15
class
QCompressedHelpInfoPrivate
:
public
QSharedData
16
{
17
public
:
18
QCompressedHelpInfoPrivate
() =
default
;
19
QCompressedHelpInfoPrivate
(
const
QCompressedHelpInfoPrivate
&other)
20
:
QSharedData
(
other
)
21
,
m_namespaceName
(
other
.
m_namespaceName
)
22
,
m_component
(
other
.
m_component
)
23
,
m_version
(
other
.
m_version
)
24
,
m_isNull
(other
.
m_isNull
)
25
{ }
26
27
QString
m_namespaceName
;
28
QString
m_component
;
29
QVersionNumber
m_version
;
30
bool
m_isNull
=
true
;
31
};
32
33
/*!
34
\class QCompressedHelpInfo
35
\since 5.13
36
\inmodule QtHelp
37
\brief The QCompressedHelpInfo class provides access to
38
the details about a compressed help file.
39
40
The detailed information about the compressed
41
help file can be fetched by calling the fromCompressedHelpFile()
42
static method, providing the path to the compressed
43
help file.
44
45
The class provides access to various information about a compressed help file.
46
The namespace associated with the given compressed help file is
47
namespaceName(), the associated component name is component()
48
and version() provides version information.
49
50
\sa QHelpFilterEngine
51
*/
52
53
/*!
54
Constructs empty information about a compressed help file.
55
*/
56
QCompressedHelpInfo::QCompressedHelpInfo()
57
: d(
new
QCompressedHelpInfoPrivate)
58
{}
59
60
/*!
61
Constructs a copy of \a other.
62
*/
63
QCompressedHelpInfo::QCompressedHelpInfo(
const
QCompressedHelpInfo &) =
default
;
64
65
/*!
66
Move-constructs a QCompressedHelpInfo instance,
67
making it point to the same object that \a other was pointing to,
68
so that it contains the information the \a other used to contain.
69
*/
70
QCompressedHelpInfo::QCompressedHelpInfo(QCompressedHelpInfo &&) =
default
;
71
72
/*!
73
Destroys the QCompressedHelpInfo.
74
*/
75
QCompressedHelpInfo::~QCompressedHelpInfo() =
default
;
76
77
/*!
78
Makes this QHelpCollectionDetails into a copy of \a other, so the two
79
are identical, and returns a reference to this QHelpCollectionDetails.
80
*/
81
QCompressedHelpInfo &QCompressedHelpInfo::operator=(
const
QCompressedHelpInfo &) =
default
;
82
83
/*!
84
Move-assigns \a other to this QCompressedHelpInfo instance.
85
*/
86
QCompressedHelpInfo &QCompressedHelpInfo::operator=(QCompressedHelpInfo &&) =
default
;
87
88
/*!
89
\fn void QCompressedHelpInfo::swap(QCompressedHelpInfo &other)
90
91
Swaps the compressed help file \a other with this compressed help file. This
92
operation is very fast and never fails.
93
*/
94
95
/*!
96
Returns the namespace name of the compressed help file.
97
*/
98
QString QCompressedHelpInfo::namespaceName()
const
99
{
100
return
d->m_namespaceName;
101
}
102
103
/*!
104
Returns the component of the compressed help file.
105
*/
106
QString QCompressedHelpInfo::component()
const
107
{
108
return
d->m_component;
109
}
110
111
/*!
112
Returns the version of the compressed help file.
113
*/
114
QVersionNumber QCompressedHelpInfo::version()
const
115
{
116
return
d->m_version;
117
}
118
119
/*!
120
Returns \c true if the info is invalid, otherwise returns
121
\c false.
122
*/
123
bool
QCompressedHelpInfo::isNull()
const
124
{
125
return
d->m_isNull;
126
}
127
128
/*!
129
Returns the QCompressedHelpInfo instance for the
130
\a documentationFileName of the existing qch file.
131
*/
132
QCompressedHelpInfo QCompressedHelpInfo::fromCompressedHelpFile(
const
QString &documentationFileName)
133
{
134
void
*pointer =
const_cast
<QString *>(&documentationFileName);
135
QHelpDBReader reader(documentationFileName, QHelpGlobal::uniquifyConnectionName(
136
"GetCompressedHelpInfo"_L1
, pointer),
nullptr
);
137
if
(reader.init()) {
138
QCompressedHelpInfo info;
139
info.d->m_namespaceName = reader.namespaceName();
140
info.d->m_component = reader.virtualFolder();
141
info.d->m_version = QVersionNumber::fromString(reader.version());
142
info.d->m_isNull =
false
;
143
return
info;
144
}
145
return
{};
146
}
147
148
QT_END_NAMESPACE
QCompressedHelpInfoPrivate
Definition
qcompressedhelpinfo.cpp:16
QCompressedHelpInfoPrivate::m_isNull
bool m_isNull
Definition
qcompressedhelpinfo.cpp:30
QCompressedHelpInfoPrivate::QCompressedHelpInfoPrivate
QCompressedHelpInfoPrivate(const QCompressedHelpInfoPrivate &other)
Definition
qcompressedhelpinfo.cpp:19
QCompressedHelpInfoPrivate::m_namespaceName
QString m_namespaceName
Definition
qcompressedhelpinfo.cpp:27
QCompressedHelpInfoPrivate::m_component
QString m_component
Definition
qcompressedhelpinfo.cpp:28
QCompressedHelpInfoPrivate::m_version
QVersionNumber m_version
Definition
qcompressedhelpinfo.cpp:29
QCompressedHelpInfoPrivate::QCompressedHelpInfoPrivate
QCompressedHelpInfoPrivate()=default
QVersionNumber
\inmodule QtCore
Definition
qversionnumber.h:33
QT_BEGIN_NAMESPACE
Combined button and popup list for selecting options.
Definition
qsequentialanimationgroup.cpp:47
qttools
src
assistant
help
qcompressedhelpinfo.cpp
Generated on
for Qt by
1.18.0