itom
Loading...
Searching...
No Matches
pythonStream.h
1/* ********************************************************************
2 itom software
3 URL: http://www.uni-stuttgart.de/ito
4 Copyright (C) 2020, Institut für Technische Optik (ITO),
5 Universität Stuttgart, Germany
6
7 This file is part of itom.
8
9 itom is free software; you can redistribute it and/or modify it
10 under the terms of the GNU Library General Public Licence as published by
11 the Free Software Foundation; either version 2 of the Licence, or (at
12 your option) any later version.
13
14 itom is distributed in the hope that it will be useful, but
15 WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library
17 General Public Licence for more details.
18
19 You should have received a copy of the GNU Library General Public License
20 along with itom. If not, see <http://www.gnu.org/licenses/>.
21*********************************************************************** */
22
23//###################
24//# pythonStream.h #
25//###################
26
27#ifndef PYTHONSTREAM_H
28#define PYTHONSTREAM_H
29
30#ifndef Q_MOC_RUN
31#include "python/pythonWrapper.h"
32#endif
33
34namespace ito
35{
36
38 {
39
40 public:
41
43 /*
44 The struct's name is PythonStream. This python type consists of the basic elements for every python type,
45 included an integer value type, which indicates whether this stream corresponds to the stream \a cout or \a cerr.
46 */
47 typedef struct
48 {
49 PyObject_HEAD
50 int type;
51 PyObject *encoding;
52 char closed;
53 }
55
56 static void PythonStream_dealloc(PythonStream* self);
57 //static PyObject *PythonStream_new(PyTypeObject *type, PyObject *args, PyObject *kwds);
58 static int PythonStream_init(PythonStream *self, PyObject *args, PyObject *kwds);
59
60 static PyObject *PythonStream_name(PythonStream* self);
61 static PyObject *PythonStream_fileno(PythonStream* self);
62 static PyObject *PythonStream_write(PythonStream* self, PyObject *args);
63 static PyObject *PythonStream_flush(PythonStream* self, PyObject *args);
64 static PyObject *PythonStream_readline(PythonStream* self, PyObject *args);
65 static PyObject *PythonStream_isatty(PythonStream* self, PyObject *args);
66 static PyObject *PythonStream_seekable(PythonStream* self, PyObject *args);
67 static PyObject *PythonStream_writable(PythonStream* self, PyObject *args);
68 static PyObject *PythonStream_readable(PythonStream* self, PyObject *args);
69
70 static PyMemberDef PythonStream_members[];
71 static PyMethodDef PythonStream_methods[];
72 static PyTypeObject PythonStreamType;
73 };
74
75} //end namespace ito
76
77
78#endif
static class which implements a new python type. The members cout and cerr of the python system are s...
Definition pythonStream.h:38
static void PythonStream_dealloc(PythonStream *self)
static method which is called if variable of type PyStream in python workspace has been deleted in or...
Definition pythonStream.cpp:43
static PyMemberDef PythonStream_members[]
static PyMemberDef table which describes every member of PyStream type
Definition pythonStream.h:70
static PyObject * PythonStream_isatty(PythonStream *self, PyObject *args)
setting IOBase params to False since help(bla) will open a terminal if True.idfc.
Definition pythonStream.cpp:91
static PyMethodDef PythonStream_methods[]
static table of type PyMethodDef which contains function pointers and descriptions to all methods,...
Definition pythonStream.h:71
static PyObject * PythonStream_flush(PythonStream *self, PyObject *args)
static method is invoked if stream has been flushed
Definition pythonStream.cpp:249
static int PythonStream_init(PythonStream *self, PyObject *args, PyObject *kwds)
static init method, which is called if any variable of type PyStream is initialized....
Definition pythonStream.cpp:50
static PyObject * PythonStream_write(PythonStream *self, PyObject *args)
static method invoked if string has been written to stream
Definition pythonStream.cpp:170
static PyObject * PythonStream_name(PythonStream *self)
static method returning name representation of this type
Definition pythonStream.cpp:81
static PyTypeObject PythonStreamType
static PyTypeObject for type PyStream with function pointers to all required static methods.
Definition pythonStream.h:72
Definition apiFunctionsGraph.cpp:40
Definition pythonStream.h:48
PyObject_HEAD int type
Definition pythonStream.h:50