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
filedocumentwriter.h
Go to the documentation of this file.
1
// Copyright (C) 2026 The Qt Company Ltd.
2
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
3
4
#
ifndef
FILEDOCUMENTWRITER_H
5
#
define
FILEDOCUMENTWRITER_H
6
7
#
include
"documentwriter.h"
8
#
include
"outputcontext.h"
9
10
#
include
<
QtCore
/
qfile
.
h
>
11
#
include
<
QtCore
/
qtextstream
.
h
>
12
13
#
include
<
memory
>
14
15
QT_BEGIN_NAMESPACE
16
17
class
FileDocumentWriter :
public
DocumentWriter
18
{
19
public
:
20
explicit
FileDocumentWriter(OutputContext context);
21
~FileDocumentWriter() override;
22
23
FileDocumentWriter(
const
FileDocumentWriter &) =
delete
;
24
FileDocumentWriter &operator=(
const
FileDocumentWriter &) =
delete
;
25
FileDocumentWriter(FileDocumentWriter &&)
noexcept
=
default
;
26
FileDocumentWriter &operator=(FileDocumentWriter &&)
noexcept
=
default
;
27
28
void
beginDocument(
const
QString &fileName);
29
30
void
endDocument();
31
void
discardDocument();
32
33
void
write(QStringView content) override;
34
void
writeLine(QStringView content) override;
35
[[nodiscard]]
bool
isOpen()
const
override;
36
[[nodiscard]] QString currentFileName()
const
override;
37
38
[[nodiscard]]
const
OutputContext &context()
const
{
return
m_context; }
39
40
private
:
41
OutputContext m_context;
42
std::unique_ptr<QFile> m_file;
43
std::unique_ptr<QTextStream> m_stream;
44
QString m_currentFileName;
45
};
46
47
QT_END_NAMESPACE
48
49
#
endif
// FILEDOCUMENTWRITER_H
Location
The Location class provides a way to mark a location in a file.
Definition
location.h:20
Location::Location
Location()
Constructs an empty location.
Definition
location.cpp:50
QT_BEGIN_NAMESPACE
Combined button and popup list for selecting options.
Definition
qsequentialanimationgroup.cpp:47
OutputContext
Bundles output configuration without static variables.
Definition
outputcontext.h:18
qttools
src
qdoc
qdoc
src
qdoc
filedocumentwriter.h
Generated on
for Qt by
1.18.0