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
15
#include <
PythonAPI/WriteChannel.h
>
16
17
#include <QObject>
18
#include <QString>
19
#include <QTextStream>
20
21
class
FileChannel
:
public
QObject,
public
WriteChannel
22
{
23
Q_OBJECT
24
public
:
25
27
FileChannel
(FILE* fileHandle);
28
30
~FileChannel
() =
default
;
31
32
public
slots:
33
34
// Called when text is written into the file.
35
virtual
void
write
(QString
const
& text)
override
final
;
36
37
private
:
38
39
QTextStream output_;
40
};
41
42
43
#endif
// FILECHANNEL_H
WriteChannel.h
FileChannel::FileChannel
FileChannel(FILE *fileHandle)
The constructor.
Definition
FileChannel.cpp:17
FileChannel::~FileChannel
~FileChannel()=default
The destructor.
FileChannel::write
virtual void write(QString const &text) override final
Definition
FileChannel.cpp:26
WriteChannel::WriteChannel
WriteChannel()=default
The constructor.
kactus2dev
PythonAPI
FileChannel.h
Generated by
1.13.2