diff options
author | Frerich Raabe <raabe@froglogic.com> | 2015-11-23 23:58:06 +0100 |
---|---|---|
committer | Katja Marttila <katja.marttila@theqtcompany.com> | 2016-02-15 05:48:59 +0000 |
commit | c790c068031edd8cd620d9195bda36ba8b5bb489 (patch) | |
tree | 3e47d86a8c89752c3b2229905f02b23732514773 /src/libs/installer/utils.h | |
parent | dd24111989653ec43275cc1992e633b5ec46612b (diff) |
Factored QFile usage out of VerboseWriter::flush()
This introduces a new 'VerboseWriterOutput' interface which can be
reimplemented to perform writing the installation log file by different
means. For now, there's just a standard QFile-based implementation. The
plan is to use this facility for implementing log writing via
RemoteFileEngine.
Change-Id: I89d91a4c7a146401ca96f27b25c49558099c5bb7
Reviewed-by: Katja Marttila <katja.marttila@theqtcompany.com>
Diffstat (limited to 'src/libs/installer/utils.h')
-rw-r--r-- | src/libs/installer/utils.h | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/src/libs/installer/utils.h b/src/libs/installer/utils.h index 55ec2009e..30415a2ec 100644 --- a/src/libs/installer/utils.h +++ b/src/libs/installer/utils.h @@ -72,6 +72,20 @@ namespace QInstaller { INSTALLER_EXPORT std::ostream& operator<<(std::ostream &os, const QString &string); + class INSTALLER_EXPORT VerboseWriterOutput + { + public: + virtual bool write(const QString &fileName, QIODevice::OpenMode openMode, const QByteArray &data) = 0; + + protected: + ~VerboseWriterOutput(); + }; + + class INSTALLER_EXPORT PlainVerboseWriterOutput : public VerboseWriterOutput + { + public: + virtual bool write(const QString &fileName, QIODevice::OpenMode openMode, const QByteArray &data); + }; class INSTALLER_EXPORT VerboseWriter { @@ -81,7 +95,7 @@ namespace QInstaller { static VerboseWriter *instance(); - bool flush(); + bool flush(VerboseWriterOutput *output); void appendLine(const QString &msg); void setFileName(const QString &fileName); |