-
Notifications
You must be signed in to change notification settings - Fork 103
/
document_writer.h
53 lines (41 loc) · 1.01 KB
/
document_writer.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
/*
SPDX-FileCopyrightText: 2012-2013 Graeme Gott <graeme@gottcode.org>
SPDX-License-Identifier: GPL-3.0-or-later
*/
#ifndef FOCUSWRITER_DOCUMENT_WRITER_H
#define FOCUSWRITER_DOCUMENT_WRITER_H
#include <QString>
class QTextDocument;
class DocumentWriter
{
public:
explicit DocumentWriter();
~DocumentWriter();
void setDocument(const QTextDocument* document);
void setFileName(const QString& filename);
void setType(const QString& type);
void setWriteByteOrderMark(bool write_bom);
bool write();
private:
QString m_filename;
QString m_type;
const QTextDocument* m_document;
bool m_write_bom;
};
inline void DocumentWriter::setDocument(const QTextDocument* document)
{
m_document = document;
}
inline void DocumentWriter::setFileName(const QString& filename)
{
m_filename = filename;
}
inline void DocumentWriter::setType(const QString& type)
{
m_type = type.toLower();
}
inline void DocumentWriter::setWriteByteOrderMark(bool write_bom)
{
m_write_bom = write_bom;
}
#endif // FOCUSWRITER_DOCUMENT_WRITER_H