forked from kactus2/kactus2dev
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathFileChannel.h
More file actions
43 lines (31 loc) · 932 Bytes
/
FileChannel.h
File metadata and controls
43 lines (31 loc) · 932 Bytes
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
//-----------------------------------------------------------------------------
// File: FileChannel.h
//-----------------------------------------------------------------------------
// Project: Kactus2
// Author: Esko Pekkarinen
// Date: 05.02.2021
//
// Description:
// Writable output channel for files e.g stdout.
//-----------------------------------------------------------------------------
#ifndef FILECHANNEL_H
#define FILECHANNEL_H
#include <PythonAPI/WriteChannel.h>
#include <QObject>
#include <QString>
#include <QTextStream>
class FileChannel: public QObject, public WriteChannel
{
Q_OBJECT
public:
//! The constructor.
FileChannel(FILE* fileHandle);
//! The destructor.
~FileChannel() = default;
public slots:
// Called when text is written into the file.
virtual void write(QString const& text) override final;
private:
QTextStream output_;
};
#endif // FILECHANNEL_H