/usr/include/wx-3.0/wx/wxPython/i_files/_streams.i is in python-wxgtk3.0-dev 3.0.2.0+dfsg-4.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
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 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 | /////////////////////////////////////////////////////////////////////////////
// Name: _streams.i
// Purpose: SWIG typemaps and wrappers for wxInputStream
//
// Author: Robin Dunn
//
// Created: 25-Sept-2000
// RCS-ID: $Id$
// Copyright: (c) 2003 by Total Control Software
// Licence: wxWindows license
/////////////////////////////////////////////////////////////////////////////
// Not a %module
//---------------------------------------------------------------------------
%{
#include "wx/wxPython/pyistream.h"
%}
//---------------------------------------------------------------------------
%newgroup
// Typemaps for wxInputStream
//
// We assume that input params taking a wxInputStream& will *not* take
// ownership of the stream and so we manage it in the typemaps. On the other
// hand, when a paramter expects a wxInputStream* then it does take ownership
// (such as wxFSFile) and so the typemap will make a copy of the stream object
// to give to it.
%typemap(in) wxInputStream& (wxPyInputStream* temp, bool created) {
if (wxPyConvertSwigPtr($input, (void **)&temp, wxT("wxPyInputStream"))) {
$1 = temp->m_wxis;
created = false;
} else {
PyErr_Clear(); // clear the failure of the wxPyConvert above
$1 = wxPyCBInputStream_create($input, false);
if ($1 == NULL) {
PyErr_SetString(PyExc_TypeError, "Expected wx.InputStream or Python file-like object.");
SWIG_fail;
}
created = true;
}
}
%typemap(freearg) wxInputStream& { if (created$argnum) delete $1; }
%typemap(in) wxInputStream* (wxPyInputStream* temp) {
if (wxPyConvertSwigPtr($input, (void **)&temp, wxT("wxPyInputStream"))) {
$1 = wxPyCBInputStream_copy((wxPyCBInputStream*)temp->m_wxis);
} else {
PyErr_Clear(); // clear the failure of the wxPyConvert above
$1 = wxPyCBInputStream_create($input, true);
if ($1 == NULL) {
PyErr_SetString(PyExc_TypeError, "Expected wx.InputStream or Python file-like object.");
SWIG_fail;
}
}
}
%typemap(out) wxInputStream* {
wxPyInputStream * _ptr = NULL;
if ($1)
_ptr = new wxPyInputStream($1);
$result = wxPyConstructObject(_ptr, wxT("wxPyInputStream"), $owner);
}
//---------------------------------------------------------------------------
// Typemaps for wxOutputStream. We only need in by reference and out by
// pointer in this one.
%typemap(in) wxOutputStream& (wxPyOutputStream* temp, bool created) {
if (wxPyConvertSwigPtr($input, (void **)&temp, wxT("wxPyOutputStream"))) {
$1 = temp->m_wxos;
created = false;
} else {
PyErr_Clear(); // clear the failure of the wxPyConvert above
$1 = wxPyCBOutputStream_create($input, false);
if ($1 == NULL) {
PyErr_SetString(PyExc_TypeError, "Expected wx.OutputStream or Python file-like object.");
SWIG_fail;
}
created = true;
}
}
%typemap(freearg) wxOutputStream& { if (created$argnum) delete $1; }
%typemap(out) wxOutputStream* {
wxPyOutputStream * _ptr = NULL;
if ($1)
_ptr = new wxPyOutputStream($1);
$result = wxPyConstructObject(_ptr, wxT("wxPyOutputStream"), $owner);
}
//---------------------------------------------------------------------------
enum wxSeekMode
{
wxFromStart,
wxFromCurrent,
wxFromEnd
};
%rename(InputStream) wxPyInputStream;
class wxPyInputStream
{
public:
%extend {
wxPyInputStream(PyObject* p) {
wxInputStream* wxis = wxPyCBInputStream::create(p);
if (wxis)
return new wxPyInputStream(wxis);
else
return NULL;
}
}
~wxPyInputStream();
void close();
void flush();
bool eof();
PyObject* read(int size=-1);
PyObject* readline(int size=-1);
PyObject* readlines(int sizehint=-1);
void seek(int offset, int whence=0);
int tell();
char Peek();
char GetC();
size_t LastRead();
bool CanRead();
bool Eof();
bool Ungetch(char c);
long SeekI(long pos, wxSeekMode mode = wxFromStart);
long TellI();
};
%rename(OutputStream) wxPyOutputStream;
class wxPyOutputStream
{
public:
%extend {
wxPyOutputStream(PyObject* p) {
wxOutputStream* wxis = wxPyCBOutputStream::create(p);
if (wxis)
return new wxPyOutputStream(wxis);
else
return NULL;
}
}
~wxPyOutputStream();
void close();
void flush();
bool eof();
void seek(int offset, int whence=0);
int tell();
void write(PyObject* data);
//void writelines(wxStringArray& arr);
void PutC(char c);
size_t LastWrite();
unsigned long SeekO(unsigned long pos, wxSeekMode mode = wxFromStart);
unsigned long TellO();
};
//---------------------------------------------------------------------------
%init %{
wxPyPtrTypeMap_Add("wxInputStream", "wxPyInputStream");
wxPyPtrTypeMap_Add("wxOutputStream", "wxPyOutputStream");
%}
//---------------------------------------------------------------------------
|