}
return target;
}
-
-#if PYTHON_API_VERSION >= 1009
- static char* wxStringErrorMsg = "String or Unicode type required";
-#else
- static char* wxStringErrorMsg = "String type required";
-#endif
#ifdef __cplusplus
extern "C" {
#endif
}
{
PyThreadState* __tstate = wxPyBeginAllowThreads();
- _result = (wxPyInputStream *)new_wxPyInputStream(_arg0);
+ _result = (wxPyInputStream *)new_wxPyInputStream(_arg0);
wxPyEndAllowThreads(__tstate);
if (PyErr_Occurred()) return NULL;
}
{
PyThreadState* __tstate = wxPyBeginAllowThreads();
- wxInputStream_close(_arg0);
+ wxInputStream_close(_arg0);
wxPyEndAllowThreads(__tstate);
if (PyErr_Occurred()) return NULL;
}
{
PyThreadState* __tstate = wxPyBeginAllowThreads();
- wxInputStream_flush(_arg0);
+ wxInputStream_flush(_arg0);
wxPyEndAllowThreads(__tstate);
if (PyErr_Occurred()) return NULL;
}
{
PyThreadState* __tstate = wxPyBeginAllowThreads();
- _result = (bool )wxInputStream_eof(_arg0);
+ _result = (bool )wxInputStream_eof(_arg0);
wxPyEndAllowThreads(__tstate);
if (PyErr_Occurred()) return NULL;
}
{
PyThreadState* __tstate = wxPyBeginAllowThreads();
- _result = (wxString *)wxInputStream_read(_arg0,_arg1);
+ _result = (wxString *)wxInputStream_read(_arg0,_arg1);
wxPyEndAllowThreads(__tstate);
if (PyErr_Occurred()) return NULL;
}{
+#if wxUSE_UNICODE
+ _resultobj = PyUnicode_FromUnicode(_result->c_str(), _result->Len());
+#else
_resultobj = PyString_FromStringAndSize(_result->c_str(), _result->Len());
+#endif
}
return _resultobj;
}
}
{
PyThreadState* __tstate = wxPyBeginAllowThreads();
- _result = (wxString *)wxInputStream_readline(_arg0,_arg1);
+ _result = (wxString *)wxInputStream_readline(_arg0,_arg1);
wxPyEndAllowThreads(__tstate);
if (PyErr_Occurred()) return NULL;
}{
+#if wxUSE_UNICODE
+ _resultobj = PyUnicode_FromUnicode(_result->c_str(), _result->Len());
+#else
_resultobj = PyString_FromStringAndSize(_result->c_str(), _result->Len());
+#endif
}
return _resultobj;
}
}
{
PyThreadState* __tstate = wxPyBeginAllowThreads();
- _result = (wxStringPtrList *)wxInputStream_readlines(_arg0,_arg1);
+ _result = (wxStringPtrList *)wxInputStream_readlines(_arg0,_arg1);
wxPyEndAllowThreads(__tstate);
if (PyErr_Occurred()) return NULL;
wxStringPtrList::Node *node = _result->GetFirst();
for (int i=0; node; i++) {
wxString *s = node->GetData();
+#if wxUSE_UNICODE
+ PyList_SetItem(_resultobj, i, PyUnicode_FromUnicode(s->c_str(), s->Len()));
+#else
PyList_SetItem(_resultobj, i, PyString_FromStringAndSize(s->c_str(), s->Len()));
+#endif
node = node->GetNext();
delete s;
}
}
{
PyThreadState* __tstate = wxPyBeginAllowThreads();
- wxInputStream_seek(_arg0,_arg1,_arg2);
+ wxInputStream_seek(_arg0,_arg1,_arg2);
wxPyEndAllowThreads(__tstate);
if (PyErr_Occurred()) return NULL;
}
{
PyThreadState* __tstate = wxPyBeginAllowThreads();
- _result = (int )wxInputStream_tell(_arg0);
+ _result = (int )wxInputStream_tell(_arg0);
wxPyEndAllowThreads(__tstate);
if (PyErr_Occurred()) return NULL;
}
}
{
-#if PYTHON_API_VERSION >= 1009
- char* tmpPtr; int tmpSize;
- if (!PyString_Check(_obj1) && !PyUnicode_Check(_obj1)) {
- PyErr_SetString(PyExc_TypeError, wxStringErrorMsg);
- return NULL;
- }
- if (PyString_AsStringAndSize(_obj1, &tmpPtr, &tmpSize) == -1)
+ _arg1 = wxString_in_helper(_obj1);
+ if (_arg1 == NULL)
return NULL;
- _arg1 = new wxString(tmpPtr, tmpSize);
-#else
- if (!PyString_Check(_obj1)) {
- PyErr_SetString(PyExc_TypeError, wxStringErrorMsg);
- return NULL;
- }
- _arg1 = new wxString(PyString_AS_STRING(_obj1), PyString_GET_SIZE(_obj1));
-#endif
}
{
PyThreadState* __tstate = wxPyBeginAllowThreads();
- wxOutputStream_write(_arg0,*_arg1);
+ wxOutputStream_write(_arg0,*_arg1);
wxPyEndAllowThreads(__tstate);
if (PyErr_Occurred()) return NULL;