Kactus2
Kactus2 reference guide
Loading...
Searching...
No Matches
FileChannel.h
Go to the documentation of this file.
1//-----------------------------------------------------------------------------
2// File: FileChannel.h
3//-----------------------------------------------------------------------------
4// Project: Kactus2
5// Author: Esko Pekkarinen
6// Date: 05.02.2021
7//
8// Description:
9// Writable output channel for files e.g stdout.
10//-----------------------------------------------------------------------------
11
12#ifndef FILECHANNEL_H
13#define FILECHANNEL_H
14
16
17#include <QObject>
18#include <QString>
19#include <QTextStream>
20
21class FileChannel: public QObject, public WriteChannel
22{
23 Q_OBJECT
24public:
25
27 FileChannel(FILE* fileHandle);
28
30 ~FileChannel() = default;
31
32public slots:
33
34 // Called when text is written into the file.
35 virtual void write(QString const& text) override final;
36
37private:
38
39 QTextStream output_;
40};
41
42
43#endif // FILECHANNEL_H
FileChannel(FILE *fileHandle)
The constructor.
~FileChannel()=default
The destructor.
virtual void write(QString const &text) override final
WriteChannel()=default
The constructor.