1 /*
2 * Interface wrapper code.
3 *
4 * Generated by SIP 4.19.16
5 *
6 * Copyright: (c) 2018 by Total Control Software
7 * License: wxWindows License
8 */
9
10 #include "sipAPI_core.h"
11
12 #include <wx/fs_mem.h>
13
14 #include <wx/filesys.h>
15 #include <wx/filesys.h>
16 #include <wx/image.h>
17 #include <wx/bitmap.h>
18 #include <wx/object.h>
19 #include <wx/object.h>
20 #include <wx/object.h>
_wxMemoryFSHandler_AddFile(const wxString * filename,const wxString * textdata)21 void _wxMemoryFSHandler_AddFile(const wxString* filename, const wxString* textdata)
22 {
23 wxScopedCharBuffer buf = textdata->utf8_str();
24 wxMemoryFSHandler::AddFile(*filename, (const char*)buf, strlen(buf));
25 }
_wxMemoryFSHandler_AddFile(const wxString * filename,wxPyBuffer * binarydata)26 void _wxMemoryFSHandler_AddFile(const wxString* filename, wxPyBuffer* binarydata)
27 {
28 wxMemoryFSHandler::AddFile(*filename, binarydata->m_ptr, binarydata->m_len);
29 }
_wxMemoryFSHandler_AddFileWithMimeType(const wxString * filename,const wxString * textdata,const wxString * mimetype)30 void _wxMemoryFSHandler_AddFileWithMimeType(const wxString* filename, const wxString* textdata, const wxString* mimetype)
31 {
32 wxScopedCharBuffer buf = textdata->utf8_str();
33 wxMemoryFSHandler::AddFileWithMimeType(*filename, (const char*)buf, strlen(buf), *mimetype);
34 }
_wxMemoryFSHandler_AddFileWithMimeType(const wxString * filename,wxPyBuffer * binarydata,const wxString * mimetype)35 void _wxMemoryFSHandler_AddFileWithMimeType(const wxString* filename, wxPyBuffer* binarydata, const wxString* mimetype)
36 {
37 wxMemoryFSHandler::AddFileWithMimeType(
38 *filename, binarydata->m_ptr, binarydata->m_len, *mimetype);
39 }
40
41
42 class sipwxMemoryFSHandler : public ::wxMemoryFSHandler
43 {
44 public:
45 sipwxMemoryFSHandler();
46 virtual ~sipwxMemoryFSHandler();
47
48 /*
49 * There is a public method for every protected method visible from
50 * this class.
51 */
52 static ::wxString sipProtect_GetAnchor(const ::wxString&);
53 static ::wxString sipProtect_GetLeftLocation(const ::wxString&);
54 static ::wxString sipProtect_GetProtocol(const ::wxString&);
55 static ::wxString sipProtect_GetRightLocation(const ::wxString&);
56
57 /*
58 * There is a protected method for every virtual method visible from
59 * this class.
60 */
61 protected:
62 bool CanOpen(const ::wxString&) SIP_OVERRIDE;
63 ::wxString FindFirst(const ::wxString&,int) SIP_OVERRIDE;
64 ::wxString FindNext() SIP_OVERRIDE;
65 ::wxFSFile* OpenFile( ::wxFileSystem&,const ::wxString&) SIP_OVERRIDE;
66
67 public:
68 sipSimpleWrapper *sipPySelf;
69
70 private:
71 sipwxMemoryFSHandler(const sipwxMemoryFSHandler &);
72 sipwxMemoryFSHandler &operator = (const sipwxMemoryFSHandler &);
73
74 char sipPyMethods[4];
75 };
76
sipwxMemoryFSHandler()77 sipwxMemoryFSHandler::sipwxMemoryFSHandler(): ::wxMemoryFSHandler(), sipPySelf(SIP_NULLPTR)
78 {
79 memset(sipPyMethods, 0, sizeof (sipPyMethods));
80 }
81
~sipwxMemoryFSHandler()82 sipwxMemoryFSHandler::~sipwxMemoryFSHandler()
83 {
84 sipInstanceDestroyedEx(&sipPySelf);
85 }
86
CanOpen(const::wxString & location)87 bool sipwxMemoryFSHandler::CanOpen(const ::wxString& location)
88 {
89 sip_gilstate_t sipGILState;
90 PyObject *sipMeth;
91
92 sipMeth = sipIsPyMethod(&sipGILState,&sipPyMethods[0],sipPySelf,SIP_NULLPTR,sipName_CanOpen);
93
94 if (!sipMeth)
95 return ::wxMemoryFSHandler::CanOpen(location);
96
97 extern bool sipVH__core_9(sip_gilstate_t, sipVirtErrorHandlerFunc, sipSimpleWrapper *, PyObject *, const ::wxString&);
98
99 return sipVH__core_9(sipGILState, 0, sipPySelf, sipMeth, location);
100 }
101
FindFirst(const::wxString & spec,int flags)102 ::wxString sipwxMemoryFSHandler::FindFirst(const ::wxString& spec,int flags)
103 {
104 sip_gilstate_t sipGILState;
105 PyObject *sipMeth;
106
107 sipMeth = sipIsPyMethod(&sipGILState,&sipPyMethods[1],sipPySelf,SIP_NULLPTR,sipName_FindFirst);
108
109 if (!sipMeth)
110 return ::wxMemoryFSHandler::FindFirst(spec,flags);
111
112 extern ::wxString sipVH__core_10(sip_gilstate_t, sipVirtErrorHandlerFunc, sipSimpleWrapper *, PyObject *, const ::wxString&,int);
113
114 return sipVH__core_10(sipGILState, 0, sipPySelf, sipMeth, spec, flags);
115 }
116
FindNext()117 ::wxString sipwxMemoryFSHandler::FindNext()
118 {
119 sip_gilstate_t sipGILState;
120 PyObject *sipMeth;
121
122 sipMeth = sipIsPyMethod(&sipGILState,&sipPyMethods[2],sipPySelf,SIP_NULLPTR,sipName_FindNext);
123
124 if (!sipMeth)
125 return ::wxMemoryFSHandler::FindNext();
126
127 extern ::wxString sipVH__core_11(sip_gilstate_t, sipVirtErrorHandlerFunc, sipSimpleWrapper *, PyObject *);
128
129 return sipVH__core_11(sipGILState, 0, sipPySelf, sipMeth);
130 }
131
OpenFile(::wxFileSystem & fs,const::wxString & location)132 ::wxFSFile* sipwxMemoryFSHandler::OpenFile( ::wxFileSystem& fs,const ::wxString& location)
133 {
134 sip_gilstate_t sipGILState;
135 PyObject *sipMeth;
136
137 sipMeth = sipIsPyMethod(&sipGILState,&sipPyMethods[3],sipPySelf,SIP_NULLPTR,sipName_OpenFile);
138
139 if (!sipMeth)
140 return ::wxMemoryFSHandler::OpenFile(fs,location);
141
142 extern ::wxFSFile* sipVH__core_12(sip_gilstate_t, sipVirtErrorHandlerFunc, sipSimpleWrapper *, PyObject *, ::wxFileSystem&,const ::wxString&);
143
144 return sipVH__core_12(sipGILState, 0, sipPySelf, sipMeth, fs, location);
145 }
146
sipProtect_GetAnchor(const::wxString & location)147 ::wxString sipwxMemoryFSHandler::sipProtect_GetAnchor(const ::wxString& location)
148 {
149 return ::wxFileSystemHandler::GetAnchor(location);
150 }
151
sipProtect_GetLeftLocation(const::wxString & location)152 ::wxString sipwxMemoryFSHandler::sipProtect_GetLeftLocation(const ::wxString& location)
153 {
154 return ::wxFileSystemHandler::GetLeftLocation(location);
155 }
156
sipProtect_GetProtocol(const::wxString & location)157 ::wxString sipwxMemoryFSHandler::sipProtect_GetProtocol(const ::wxString& location)
158 {
159 return ::wxFileSystemHandler::GetProtocol(location);
160 }
161
sipProtect_GetRightLocation(const::wxString & location)162 ::wxString sipwxMemoryFSHandler::sipProtect_GetRightLocation(const ::wxString& location)
163 {
164 return ::wxFileSystemHandler::GetRightLocation(location);
165 }
166
167
168 PyDoc_STRVAR(doc_wxMemoryFSHandler_GetAnchor, "GetAnchor(location) -> String\n"
169 "\n"
170 "Returns the anchor if present in the location.");
171
172 extern "C" {static PyObject *meth_wxMemoryFSHandler_GetAnchor(PyObject *, PyObject *, PyObject *);}
meth_wxMemoryFSHandler_GetAnchor(PyObject *,PyObject * sipArgs,PyObject * sipKwds)173 static PyObject *meth_wxMemoryFSHandler_GetAnchor(PyObject *, PyObject *sipArgs, PyObject *sipKwds)
174 {
175 PyObject *sipParseErr = SIP_NULLPTR;
176
177 {
178 const ::wxString* location;
179 int locationState = 0;
180
181 static const char *sipKwdList[] = {
182 sipName_location,
183 };
184
185 if (sipParseKwdArgs(&sipParseErr, sipArgs, sipKwds, sipKwdList, SIP_NULLPTR, "J1", sipType_wxString,&location, &locationState))
186 {
187 ::wxString*sipRes;
188
189 PyErr_Clear();
190
191 Py_BEGIN_ALLOW_THREADS
192 sipRes = new ::wxString(sipwxMemoryFSHandler::sipProtect_GetAnchor(*location));
193 Py_END_ALLOW_THREADS
194 sipReleaseType(const_cast< ::wxString *>(location),sipType_wxString,locationState);
195
196 if (PyErr_Occurred())
197 return 0;
198
199 return sipConvertFromNewType(sipRes,sipType_wxString,SIP_NULLPTR);
200 }
201 }
202
203 /* Raise an exception if the arguments couldn't be parsed. */
204 sipNoMethod(sipParseErr, sipName_MemoryFSHandler, sipName_GetAnchor, SIP_NULLPTR);
205
206 return SIP_NULLPTR;
207 }
208
209
210 PyDoc_STRVAR(doc_wxMemoryFSHandler_GetLeftLocation, "GetLeftLocation(location) -> String\n"
211 "\n"
212 "Returns the left location string extracted from location.");
213
214 extern "C" {static PyObject *meth_wxMemoryFSHandler_GetLeftLocation(PyObject *, PyObject *, PyObject *);}
meth_wxMemoryFSHandler_GetLeftLocation(PyObject *,PyObject * sipArgs,PyObject * sipKwds)215 static PyObject *meth_wxMemoryFSHandler_GetLeftLocation(PyObject *, PyObject *sipArgs, PyObject *sipKwds)
216 {
217 PyObject *sipParseErr = SIP_NULLPTR;
218
219 {
220 const ::wxString* location;
221 int locationState = 0;
222
223 static const char *sipKwdList[] = {
224 sipName_location,
225 };
226
227 if (sipParseKwdArgs(&sipParseErr, sipArgs, sipKwds, sipKwdList, SIP_NULLPTR, "J1", sipType_wxString,&location, &locationState))
228 {
229 ::wxString*sipRes;
230
231 PyErr_Clear();
232
233 Py_BEGIN_ALLOW_THREADS
234 sipRes = new ::wxString(sipwxMemoryFSHandler::sipProtect_GetLeftLocation(*location));
235 Py_END_ALLOW_THREADS
236 sipReleaseType(const_cast< ::wxString *>(location),sipType_wxString,locationState);
237
238 if (PyErr_Occurred())
239 return 0;
240
241 return sipConvertFromNewType(sipRes,sipType_wxString,SIP_NULLPTR);
242 }
243 }
244
245 /* Raise an exception if the arguments couldn't be parsed. */
246 sipNoMethod(sipParseErr, sipName_MemoryFSHandler, sipName_GetLeftLocation, SIP_NULLPTR);
247
248 return SIP_NULLPTR;
249 }
250
251
252 PyDoc_STRVAR(doc_wxMemoryFSHandler_GetProtocol, "GetProtocol(location) -> String\n"
253 "\n"
254 "Returns the protocol string extracted from location.");
255
256 extern "C" {static PyObject *meth_wxMemoryFSHandler_GetProtocol(PyObject *, PyObject *, PyObject *);}
meth_wxMemoryFSHandler_GetProtocol(PyObject *,PyObject * sipArgs,PyObject * sipKwds)257 static PyObject *meth_wxMemoryFSHandler_GetProtocol(PyObject *, PyObject *sipArgs, PyObject *sipKwds)
258 {
259 PyObject *sipParseErr = SIP_NULLPTR;
260
261 {
262 const ::wxString* location;
263 int locationState = 0;
264
265 static const char *sipKwdList[] = {
266 sipName_location,
267 };
268
269 if (sipParseKwdArgs(&sipParseErr, sipArgs, sipKwds, sipKwdList, SIP_NULLPTR, "J1", sipType_wxString,&location, &locationState))
270 {
271 ::wxString*sipRes;
272
273 PyErr_Clear();
274
275 Py_BEGIN_ALLOW_THREADS
276 sipRes = new ::wxString(sipwxMemoryFSHandler::sipProtect_GetProtocol(*location));
277 Py_END_ALLOW_THREADS
278 sipReleaseType(const_cast< ::wxString *>(location),sipType_wxString,locationState);
279
280 if (PyErr_Occurred())
281 return 0;
282
283 return sipConvertFromNewType(sipRes,sipType_wxString,SIP_NULLPTR);
284 }
285 }
286
287 /* Raise an exception if the arguments couldn't be parsed. */
288 sipNoMethod(sipParseErr, sipName_MemoryFSHandler, sipName_GetProtocol, SIP_NULLPTR);
289
290 return SIP_NULLPTR;
291 }
292
293
294 PyDoc_STRVAR(doc_wxMemoryFSHandler_GetRightLocation, "GetRightLocation(location) -> String\n"
295 "\n"
296 "Returns the right location string extracted from location.");
297
298 extern "C" {static PyObject *meth_wxMemoryFSHandler_GetRightLocation(PyObject *, PyObject *, PyObject *);}
meth_wxMemoryFSHandler_GetRightLocation(PyObject *,PyObject * sipArgs,PyObject * sipKwds)299 static PyObject *meth_wxMemoryFSHandler_GetRightLocation(PyObject *, PyObject *sipArgs, PyObject *sipKwds)
300 {
301 PyObject *sipParseErr = SIP_NULLPTR;
302
303 {
304 const ::wxString* location;
305 int locationState = 0;
306
307 static const char *sipKwdList[] = {
308 sipName_location,
309 };
310
311 if (sipParseKwdArgs(&sipParseErr, sipArgs, sipKwds, sipKwdList, SIP_NULLPTR, "J1", sipType_wxString,&location, &locationState))
312 {
313 ::wxString*sipRes;
314
315 PyErr_Clear();
316
317 Py_BEGIN_ALLOW_THREADS
318 sipRes = new ::wxString(sipwxMemoryFSHandler::sipProtect_GetRightLocation(*location));
319 Py_END_ALLOW_THREADS
320 sipReleaseType(const_cast< ::wxString *>(location),sipType_wxString,locationState);
321
322 if (PyErr_Occurred())
323 return 0;
324
325 return sipConvertFromNewType(sipRes,sipType_wxString,SIP_NULLPTR);
326 }
327 }
328
329 /* Raise an exception if the arguments couldn't be parsed. */
330 sipNoMethod(sipParseErr, sipName_MemoryFSHandler, sipName_GetRightLocation, SIP_NULLPTR);
331
332 return SIP_NULLPTR;
333 }
334
335
336 PyDoc_STRVAR(doc_wxMemoryFSHandler_AddFile, "AddFile(filename, image, type)\n"
337 "AddFile(filename, bitmap, type)\n"
338 "AddFile(filename, textdata)\n"
339 "AddFile(filename, binarydata)\n"
340 "\n"
341 "Adds a file to the list of the files stored in memory.\n"
342 "\n"
343 "\n"
344 "");
345
346 extern "C" {static PyObject *meth_wxMemoryFSHandler_AddFile(PyObject *, PyObject *, PyObject *);}
meth_wxMemoryFSHandler_AddFile(PyObject *,PyObject * sipArgs,PyObject * sipKwds)347 static PyObject *meth_wxMemoryFSHandler_AddFile(PyObject *, PyObject *sipArgs, PyObject *sipKwds)
348 {
349 PyObject *sipParseErr = SIP_NULLPTR;
350
351 {
352 const ::wxString* filename;
353 int filenameState = 0;
354 ::wxImage* image;
355 ::wxBitmapType type;
356
357 static const char *sipKwdList[] = {
358 sipName_filename,
359 sipName_image,
360 sipName_type,
361 };
362
363 if (sipParseKwdArgs(&sipParseErr, sipArgs, sipKwds, sipKwdList, SIP_NULLPTR, "J1J9E", sipType_wxString,&filename, &filenameState, sipType_wxImage, &image, sipType_wxBitmapType, &type))
364 {
365 PyErr_Clear();
366
367 Py_BEGIN_ALLOW_THREADS
368 ::wxMemoryFSHandler::AddFile(*filename,*image,type);
369 Py_END_ALLOW_THREADS
370 sipReleaseType(const_cast< ::wxString *>(filename),sipType_wxString,filenameState);
371
372 if (PyErr_Occurred())
373 return 0;
374
375 Py_INCREF(Py_None);
376 return Py_None;
377 }
378 }
379
380 {
381 const ::wxString* filename;
382 int filenameState = 0;
383 const ::wxBitmap* bitmap;
384 ::wxBitmapType type;
385
386 static const char *sipKwdList[] = {
387 sipName_filename,
388 sipName_bitmap,
389 sipName_type,
390 };
391
392 if (sipParseKwdArgs(&sipParseErr, sipArgs, sipKwds, sipKwdList, SIP_NULLPTR, "J1J9E", sipType_wxString,&filename, &filenameState, sipType_wxBitmap, &bitmap, sipType_wxBitmapType, &type))
393 {
394 PyErr_Clear();
395
396 Py_BEGIN_ALLOW_THREADS
397 ::wxMemoryFSHandler::AddFile(*filename,*bitmap,type);
398 Py_END_ALLOW_THREADS
399 sipReleaseType(const_cast< ::wxString *>(filename),sipType_wxString,filenameState);
400
401 if (PyErr_Occurred())
402 return 0;
403
404 Py_INCREF(Py_None);
405 return Py_None;
406 }
407 }
408
409 {
410 const ::wxString* filename;
411 int filenameState = 0;
412 const ::wxString* textdata;
413 int textdataState = 0;
414
415 static const char *sipKwdList[] = {
416 sipName_filename,
417 sipName_textdata,
418 };
419
420 if (sipParseKwdArgs(&sipParseErr, sipArgs, sipKwds, sipKwdList, SIP_NULLPTR, "J1J1", sipType_wxString,&filename, &filenameState, sipType_wxString,&textdata, &textdataState))
421 {
422 int sipIsErr = 0;
423
424 PyErr_Clear();
425 Py_BEGIN_ALLOW_THREADS
426 _wxMemoryFSHandler_AddFile(filename, textdata);
427 Py_END_ALLOW_THREADS
428 if (PyErr_Occurred()) sipIsErr = 1;
429 sipReleaseType(const_cast< ::wxString *>(filename),sipType_wxString,filenameState);
430 sipReleaseType(const_cast< ::wxString *>(textdata),sipType_wxString,textdataState);
431
432 if (sipIsErr)
433 return 0;
434
435 Py_INCREF(Py_None);
436 return Py_None;
437 }
438 }
439
440 {
441 const ::wxString* filename;
442 int filenameState = 0;
443 ::wxPyBuffer* binarydata;
444 int binarydataState = 0;
445
446 static const char *sipKwdList[] = {
447 sipName_filename,
448 sipName_binarydata,
449 };
450
451 if (sipParseKwdArgs(&sipParseErr, sipArgs, sipKwds, sipKwdList, SIP_NULLPTR, "J1J0", sipType_wxString,&filename, &filenameState, sipType_wxPyBuffer,&binarydata, &binarydataState))
452 {
453 int sipIsErr = 0;
454
455 PyErr_Clear();
456 Py_BEGIN_ALLOW_THREADS
457 _wxMemoryFSHandler_AddFile(filename, binarydata);
458 Py_END_ALLOW_THREADS
459 if (PyErr_Occurred()) sipIsErr = 1;
460 sipReleaseType(const_cast< ::wxString *>(filename),sipType_wxString,filenameState);
461 sipReleaseType(binarydata,sipType_wxPyBuffer,binarydataState);
462
463 if (sipIsErr)
464 return 0;
465
466 Py_INCREF(Py_None);
467 return Py_None;
468 }
469 }
470
471 /* Raise an exception if the arguments couldn't be parsed. */
472 sipNoMethod(sipParseErr, sipName_MemoryFSHandler, sipName_AddFile, SIP_NULLPTR);
473
474 return SIP_NULLPTR;
475 }
476
477
478 PyDoc_STRVAR(doc_wxMemoryFSHandler_AddFileWithMimeType, "AddFileWithMimeType(filename, textdata, mimetype)\n"
479 "AddFileWithMimeType(filename, binarydata, mimetype)\n"
480 "\n"
481 "Add a file from text data, which will first be converted to utf-8\n"
482 "encoded bytes.\n"
483 "");
484
485 extern "C" {static PyObject *meth_wxMemoryFSHandler_AddFileWithMimeType(PyObject *, PyObject *, PyObject *);}
meth_wxMemoryFSHandler_AddFileWithMimeType(PyObject *,PyObject * sipArgs,PyObject * sipKwds)486 static PyObject *meth_wxMemoryFSHandler_AddFileWithMimeType(PyObject *, PyObject *sipArgs, PyObject *sipKwds)
487 {
488 PyObject *sipParseErr = SIP_NULLPTR;
489
490 {
491 const ::wxString* filename;
492 int filenameState = 0;
493 const ::wxString* textdata;
494 int textdataState = 0;
495 const ::wxString* mimetype;
496 int mimetypeState = 0;
497
498 static const char *sipKwdList[] = {
499 sipName_filename,
500 sipName_textdata,
501 sipName_mimetype,
502 };
503
504 if (sipParseKwdArgs(&sipParseErr, sipArgs, sipKwds, sipKwdList, SIP_NULLPTR, "J1J1J1", sipType_wxString,&filename, &filenameState, sipType_wxString,&textdata, &textdataState, sipType_wxString,&mimetype, &mimetypeState))
505 {
506 int sipIsErr = 0;
507
508 PyErr_Clear();
509 Py_BEGIN_ALLOW_THREADS
510 _wxMemoryFSHandler_AddFileWithMimeType(filename, textdata, mimetype);
511 Py_END_ALLOW_THREADS
512 if (PyErr_Occurred()) sipIsErr = 1;
513 sipReleaseType(const_cast< ::wxString *>(filename),sipType_wxString,filenameState);
514 sipReleaseType(const_cast< ::wxString *>(textdata),sipType_wxString,textdataState);
515 sipReleaseType(const_cast< ::wxString *>(mimetype),sipType_wxString,mimetypeState);
516
517 if (sipIsErr)
518 return 0;
519
520 Py_INCREF(Py_None);
521 return Py_None;
522 }
523 }
524
525 {
526 const ::wxString* filename;
527 int filenameState = 0;
528 ::wxPyBuffer* binarydata;
529 int binarydataState = 0;
530 const ::wxString* mimetype;
531 int mimetypeState = 0;
532
533 static const char *sipKwdList[] = {
534 sipName_filename,
535 sipName_binarydata,
536 sipName_mimetype,
537 };
538
539 if (sipParseKwdArgs(&sipParseErr, sipArgs, sipKwds, sipKwdList, SIP_NULLPTR, "J1J0J1", sipType_wxString,&filename, &filenameState, sipType_wxPyBuffer,&binarydata, &binarydataState, sipType_wxString,&mimetype, &mimetypeState))
540 {
541 int sipIsErr = 0;
542
543 PyErr_Clear();
544 Py_BEGIN_ALLOW_THREADS
545 _wxMemoryFSHandler_AddFileWithMimeType(filename, binarydata, mimetype);
546 Py_END_ALLOW_THREADS
547 if (PyErr_Occurred()) sipIsErr = 1;
548 sipReleaseType(const_cast< ::wxString *>(filename),sipType_wxString,filenameState);
549 sipReleaseType(binarydata,sipType_wxPyBuffer,binarydataState);
550 sipReleaseType(const_cast< ::wxString *>(mimetype),sipType_wxString,mimetypeState);
551
552 if (sipIsErr)
553 return 0;
554
555 Py_INCREF(Py_None);
556 return Py_None;
557 }
558 }
559
560 /* Raise an exception if the arguments couldn't be parsed. */
561 sipNoMethod(sipParseErr, sipName_MemoryFSHandler, sipName_AddFileWithMimeType, SIP_NULLPTR);
562
563 return SIP_NULLPTR;
564 }
565
566
567 PyDoc_STRVAR(doc_wxMemoryFSHandler_RemoveFile, "RemoveFile(filename)\n"
568 "\n"
569 "Removes a file from memory FS and frees the occupied memory.");
570
571 extern "C" {static PyObject *meth_wxMemoryFSHandler_RemoveFile(PyObject *, PyObject *, PyObject *);}
meth_wxMemoryFSHandler_RemoveFile(PyObject *,PyObject * sipArgs,PyObject * sipKwds)572 static PyObject *meth_wxMemoryFSHandler_RemoveFile(PyObject *, PyObject *sipArgs, PyObject *sipKwds)
573 {
574 PyObject *sipParseErr = SIP_NULLPTR;
575
576 {
577 const ::wxString* filename;
578 int filenameState = 0;
579
580 static const char *sipKwdList[] = {
581 sipName_filename,
582 };
583
584 if (sipParseKwdArgs(&sipParseErr, sipArgs, sipKwds, sipKwdList, SIP_NULLPTR, "J1", sipType_wxString,&filename, &filenameState))
585 {
586 PyErr_Clear();
587
588 Py_BEGIN_ALLOW_THREADS
589 ::wxMemoryFSHandler::RemoveFile(*filename);
590 Py_END_ALLOW_THREADS
591 sipReleaseType(const_cast< ::wxString *>(filename),sipType_wxString,filenameState);
592
593 if (PyErr_Occurred())
594 return 0;
595
596 Py_INCREF(Py_None);
597 return Py_None;
598 }
599 }
600
601 /* Raise an exception if the arguments couldn't be parsed. */
602 sipNoMethod(sipParseErr, sipName_MemoryFSHandler, sipName_RemoveFile, SIP_NULLPTR);
603
604 return SIP_NULLPTR;
605 }
606
607
608 PyDoc_STRVAR(doc_wxMemoryFSHandler_CanOpen, "CanOpen(self, location: object) -> bool");
609
610 extern "C" {static PyObject *meth_wxMemoryFSHandler_CanOpen(PyObject *, PyObject *, PyObject *);}
meth_wxMemoryFSHandler_CanOpen(PyObject * sipSelf,PyObject * sipArgs,PyObject * sipKwds)611 static PyObject *meth_wxMemoryFSHandler_CanOpen(PyObject *sipSelf, PyObject *sipArgs, PyObject *sipKwds)
612 {
613 PyObject *sipParseErr = SIP_NULLPTR;
614 bool sipSelfWasArg = (!sipSelf || sipIsDerivedClass((sipSimpleWrapper *)sipSelf));
615
616 {
617 const ::wxString* location;
618 int locationState = 0;
619 ::wxMemoryFSHandler *sipCpp;
620
621 static const char *sipKwdList[] = {
622 sipName_location,
623 };
624
625 if (sipParseKwdArgs(&sipParseErr, sipArgs, sipKwds, sipKwdList, SIP_NULLPTR, "BJ1", &sipSelf, sipType_wxMemoryFSHandler, &sipCpp, sipType_wxString,&location, &locationState))
626 {
627 bool sipRes;
628
629 PyErr_Clear();
630
631 Py_BEGIN_ALLOW_THREADS
632 sipRes = (sipSelfWasArg ? sipCpp-> ::wxMemoryFSHandler::CanOpen(*location) : sipCpp->CanOpen(*location));
633 Py_END_ALLOW_THREADS
634 sipReleaseType(const_cast< ::wxString *>(location),sipType_wxString,locationState);
635
636 if (PyErr_Occurred())
637 return 0;
638
639 return PyBool_FromLong(sipRes);
640 }
641 }
642
643 /* Raise an exception if the arguments couldn't be parsed. */
644 sipNoMethod(sipParseErr, sipName_MemoryFSHandler, sipName_CanOpen, doc_wxMemoryFSHandler_CanOpen);
645
646 return SIP_NULLPTR;
647 }
648
649
650 PyDoc_STRVAR(doc_wxMemoryFSHandler_OpenFile, "OpenFile(self, fs: FileSystem, location: object) -> FSFile");
651
652 extern "C" {static PyObject *meth_wxMemoryFSHandler_OpenFile(PyObject *, PyObject *, PyObject *);}
meth_wxMemoryFSHandler_OpenFile(PyObject * sipSelf,PyObject * sipArgs,PyObject * sipKwds)653 static PyObject *meth_wxMemoryFSHandler_OpenFile(PyObject *sipSelf, PyObject *sipArgs, PyObject *sipKwds)
654 {
655 PyObject *sipParseErr = SIP_NULLPTR;
656 bool sipSelfWasArg = (!sipSelf || sipIsDerivedClass((sipSimpleWrapper *)sipSelf));
657
658 {
659 ::wxFileSystem* fs;
660 const ::wxString* location;
661 int locationState = 0;
662 ::wxMemoryFSHandler *sipCpp;
663
664 static const char *sipKwdList[] = {
665 sipName_fs,
666 sipName_location,
667 };
668
669 if (sipParseKwdArgs(&sipParseErr, sipArgs, sipKwds, sipKwdList, SIP_NULLPTR, "BJ9J1", &sipSelf, sipType_wxMemoryFSHandler, &sipCpp, sipType_wxFileSystem, &fs, sipType_wxString,&location, &locationState))
670 {
671 ::wxFSFile*sipRes;
672
673 PyErr_Clear();
674
675 Py_BEGIN_ALLOW_THREADS
676 sipRes = (sipSelfWasArg ? sipCpp-> ::wxMemoryFSHandler::OpenFile(*fs,*location) : sipCpp->OpenFile(*fs,*location));
677 Py_END_ALLOW_THREADS
678 sipReleaseType(const_cast< ::wxString *>(location),sipType_wxString,locationState);
679
680 if (PyErr_Occurred())
681 return 0;
682
683 return sipConvertFromNewType(sipRes,sipType_wxFSFile,SIP_NULLPTR);
684 }
685 }
686
687 /* Raise an exception if the arguments couldn't be parsed. */
688 sipNoMethod(sipParseErr, sipName_MemoryFSHandler, sipName_OpenFile, doc_wxMemoryFSHandler_OpenFile);
689
690 return SIP_NULLPTR;
691 }
692
693
694 PyDoc_STRVAR(doc_wxMemoryFSHandler_FindFirst, "FindFirst(self, spec: object, flags: int = 0) -> object");
695
696 extern "C" {static PyObject *meth_wxMemoryFSHandler_FindFirst(PyObject *, PyObject *, PyObject *);}
meth_wxMemoryFSHandler_FindFirst(PyObject * sipSelf,PyObject * sipArgs,PyObject * sipKwds)697 static PyObject *meth_wxMemoryFSHandler_FindFirst(PyObject *sipSelf, PyObject *sipArgs, PyObject *sipKwds)
698 {
699 PyObject *sipParseErr = SIP_NULLPTR;
700 bool sipSelfWasArg = (!sipSelf || sipIsDerivedClass((sipSimpleWrapper *)sipSelf));
701
702 {
703 const ::wxString* spec;
704 int specState = 0;
705 int flags = 0;
706 ::wxMemoryFSHandler *sipCpp;
707
708 static const char *sipKwdList[] = {
709 sipName_spec,
710 sipName_flags,
711 };
712
713 if (sipParseKwdArgs(&sipParseErr, sipArgs, sipKwds, sipKwdList, SIP_NULLPTR, "BJ1|i", &sipSelf, sipType_wxMemoryFSHandler, &sipCpp, sipType_wxString,&spec, &specState, &flags))
714 {
715 ::wxString*sipRes;
716
717 PyErr_Clear();
718
719 Py_BEGIN_ALLOW_THREADS
720 sipRes = new ::wxString((sipSelfWasArg ? sipCpp-> ::wxMemoryFSHandler::FindFirst(*spec,flags) : sipCpp->FindFirst(*spec,flags)));
721 Py_END_ALLOW_THREADS
722 sipReleaseType(const_cast< ::wxString *>(spec),sipType_wxString,specState);
723
724 if (PyErr_Occurred())
725 return 0;
726
727 return sipConvertFromNewType(sipRes,sipType_wxString,SIP_NULLPTR);
728 }
729 }
730
731 /* Raise an exception if the arguments couldn't be parsed. */
732 sipNoMethod(sipParseErr, sipName_MemoryFSHandler, sipName_FindFirst, doc_wxMemoryFSHandler_FindFirst);
733
734 return SIP_NULLPTR;
735 }
736
737
738 PyDoc_STRVAR(doc_wxMemoryFSHandler_FindNext, "FindNext(self) -> object");
739
740 extern "C" {static PyObject *meth_wxMemoryFSHandler_FindNext(PyObject *, PyObject *);}
meth_wxMemoryFSHandler_FindNext(PyObject * sipSelf,PyObject * sipArgs)741 static PyObject *meth_wxMemoryFSHandler_FindNext(PyObject *sipSelf, PyObject *sipArgs)
742 {
743 PyObject *sipParseErr = SIP_NULLPTR;
744 bool sipSelfWasArg = (!sipSelf || sipIsDerivedClass((sipSimpleWrapper *)sipSelf));
745
746 {
747 ::wxMemoryFSHandler *sipCpp;
748
749 if (sipParseArgs(&sipParseErr, sipArgs, "B", &sipSelf, sipType_wxMemoryFSHandler, &sipCpp))
750 {
751 ::wxString*sipRes;
752
753 PyErr_Clear();
754
755 Py_BEGIN_ALLOW_THREADS
756 sipRes = new ::wxString((sipSelfWasArg ? sipCpp-> ::wxMemoryFSHandler::FindNext() : sipCpp->FindNext()));
757 Py_END_ALLOW_THREADS
758
759 if (PyErr_Occurred())
760 return 0;
761
762 return sipConvertFromNewType(sipRes,sipType_wxString,SIP_NULLPTR);
763 }
764 }
765
766 /* Raise an exception if the arguments couldn't be parsed. */
767 sipNoMethod(sipParseErr, sipName_MemoryFSHandler, sipName_FindNext, doc_wxMemoryFSHandler_FindNext);
768
769 return SIP_NULLPTR;
770 }
771
772
773 /* Cast a pointer to a type somewhere in its inheritance hierarchy. */
774 extern "C" {static void *cast_wxMemoryFSHandler(void *, const sipTypeDef *);}
cast_wxMemoryFSHandler(void * sipCppV,const sipTypeDef * targetType)775 static void *cast_wxMemoryFSHandler(void *sipCppV, const sipTypeDef *targetType)
776 {
777 ::wxMemoryFSHandler *sipCpp = reinterpret_cast< ::wxMemoryFSHandler *>(sipCppV);
778
779 if (targetType == sipType_wxFileSystemHandler)
780 return static_cast< ::wxFileSystemHandler *>(sipCpp);
781
782 if (targetType == sipType_wxObject)
783 return static_cast< ::wxObject *>(sipCpp);
784
785 return sipCppV;
786 }
787
788
789 /* Call the instance's destructor. */
790 extern "C" {static void release_wxMemoryFSHandler(void *, int);}
release_wxMemoryFSHandler(void * sipCppV,int sipState)791 static void release_wxMemoryFSHandler(void *sipCppV, int sipState)
792 {
793 Py_BEGIN_ALLOW_THREADS
794
795 if (sipState & SIP_DERIVED_CLASS)
796 delete reinterpret_cast<sipwxMemoryFSHandler *>(sipCppV);
797 else
798 delete reinterpret_cast< ::wxMemoryFSHandler *>(sipCppV);
799
800 Py_END_ALLOW_THREADS
801 }
802
803
804 extern "C" {static void dealloc_wxMemoryFSHandler(sipSimpleWrapper *);}
dealloc_wxMemoryFSHandler(sipSimpleWrapper * sipSelf)805 static void dealloc_wxMemoryFSHandler(sipSimpleWrapper *sipSelf)
806 {
807 if (sipIsDerivedClass(sipSelf))
808 reinterpret_cast<sipwxMemoryFSHandler *>(sipGetAddress(sipSelf))->sipPySelf = SIP_NULLPTR;
809
810 if (sipIsOwnedByPython(sipSelf))
811 {
812 release_wxMemoryFSHandler(sipGetAddress(sipSelf), sipIsDerivedClass(sipSelf));
813 }
814 }
815
816
817 extern "C" {static void *init_type_wxMemoryFSHandler(sipSimpleWrapper *, PyObject *, PyObject *, PyObject **, PyObject **, PyObject **);}
init_type_wxMemoryFSHandler(sipSimpleWrapper * sipSelf,PyObject * sipArgs,PyObject * sipKwds,PyObject ** sipUnused,PyObject **,PyObject ** sipParseErr)818 static void *init_type_wxMemoryFSHandler(sipSimpleWrapper *sipSelf, PyObject *sipArgs, PyObject *sipKwds, PyObject **sipUnused, PyObject **, PyObject **sipParseErr)
819 {
820 sipwxMemoryFSHandler *sipCpp = SIP_NULLPTR;
821
822 {
823 if (sipParseKwdArgs(sipParseErr, sipArgs, sipKwds, SIP_NULLPTR, sipUnused, ""))
824 {
825 PyErr_Clear();
826
827 Py_BEGIN_ALLOW_THREADS
828 sipCpp = new sipwxMemoryFSHandler();
829 Py_END_ALLOW_THREADS
830
831 if (PyErr_Occurred())
832 {
833 delete sipCpp;
834 return SIP_NULLPTR;
835 }
836
837 sipCpp->sipPySelf = sipSelf;
838
839 return sipCpp;
840 }
841 }
842
843 return SIP_NULLPTR;
844 }
845
846
847 /* Define this type's super-types. */
848 static sipEncodedTypeDef supers_wxMemoryFSHandler[] = {{165, 255, 1}};
849
850
851 static PyMethodDef methods_wxMemoryFSHandler[] = {
852 {SIP_MLNAME_CAST(sipName_AddFile), SIP_MLMETH_CAST(meth_wxMemoryFSHandler_AddFile), METH_VARARGS|METH_KEYWORDS, SIP_MLDOC_CAST(doc_wxMemoryFSHandler_AddFile)},
853 {SIP_MLNAME_CAST(sipName_AddFileWithMimeType), SIP_MLMETH_CAST(meth_wxMemoryFSHandler_AddFileWithMimeType), METH_VARARGS|METH_KEYWORDS, SIP_MLDOC_CAST(doc_wxMemoryFSHandler_AddFileWithMimeType)},
854 {SIP_MLNAME_CAST(sipName_CanOpen), SIP_MLMETH_CAST(meth_wxMemoryFSHandler_CanOpen), METH_VARARGS|METH_KEYWORDS, SIP_MLDOC_CAST(doc_wxMemoryFSHandler_CanOpen)},
855 {SIP_MLNAME_CAST(sipName_FindFirst), SIP_MLMETH_CAST(meth_wxMemoryFSHandler_FindFirst), METH_VARARGS|METH_KEYWORDS, SIP_MLDOC_CAST(doc_wxMemoryFSHandler_FindFirst)},
856 {SIP_MLNAME_CAST(sipName_FindNext), meth_wxMemoryFSHandler_FindNext, METH_VARARGS, SIP_MLDOC_CAST(doc_wxMemoryFSHandler_FindNext)},
857 {SIP_MLNAME_CAST(sipName_GetAnchor), SIP_MLMETH_CAST(meth_wxMemoryFSHandler_GetAnchor), METH_VARARGS|METH_KEYWORDS, SIP_NULLPTR},
858 {SIP_MLNAME_CAST(sipName_GetLeftLocation), SIP_MLMETH_CAST(meth_wxMemoryFSHandler_GetLeftLocation), METH_VARARGS|METH_KEYWORDS, SIP_NULLPTR},
859 {SIP_MLNAME_CAST(sipName_GetProtocol), SIP_MLMETH_CAST(meth_wxMemoryFSHandler_GetProtocol), METH_VARARGS|METH_KEYWORDS, SIP_NULLPTR},
860 {SIP_MLNAME_CAST(sipName_GetRightLocation), SIP_MLMETH_CAST(meth_wxMemoryFSHandler_GetRightLocation), METH_VARARGS|METH_KEYWORDS, SIP_NULLPTR},
861 {SIP_MLNAME_CAST(sipName_OpenFile), SIP_MLMETH_CAST(meth_wxMemoryFSHandler_OpenFile), METH_VARARGS|METH_KEYWORDS, SIP_MLDOC_CAST(doc_wxMemoryFSHandler_OpenFile)},
862 {SIP_MLNAME_CAST(sipName_RemoveFile), SIP_MLMETH_CAST(meth_wxMemoryFSHandler_RemoveFile), METH_VARARGS|METH_KEYWORDS, SIP_MLDOC_CAST(doc_wxMemoryFSHandler_RemoveFile)}
863 };
864
865 PyDoc_STRVAR(doc_wxMemoryFSHandler, "MemoryFSHandler()\n"
866 "\n"
867 "This wxFileSystem handler can store arbitrary data in memory stream\n"
868 "and make them accessible via an URL.");
869
870
871 sipClassTypeDef sipTypeDef__core_wxMemoryFSHandler = {
872 {
873 -1,
874 SIP_NULLPTR,
875 SIP_NULLPTR,
876 SIP_TYPE_SCC|SIP_TYPE_CLASS,
877 sipNameNr_wxMemoryFSHandler,
878 {SIP_NULLPTR},
879 SIP_NULLPTR
880 },
881 {
882 sipNameNr_MemoryFSHandler,
883 {0, 0, 1},
884 11, methods_wxMemoryFSHandler,
885 0, SIP_NULLPTR,
886 0, SIP_NULLPTR,
887 {SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR},
888 },
889 doc_wxMemoryFSHandler,
890 -1,
891 -1,
892 supers_wxMemoryFSHandler,
893 SIP_NULLPTR,
894 init_type_wxMemoryFSHandler,
895 SIP_NULLPTR,
896 SIP_NULLPTR,
897 #if PY_MAJOR_VERSION >= 3
898 SIP_NULLPTR,
899 SIP_NULLPTR,
900 #else
901 SIP_NULLPTR,
902 SIP_NULLPTR,
903 SIP_NULLPTR,
904 SIP_NULLPTR,
905 #endif
906 dealloc_wxMemoryFSHandler,
907 SIP_NULLPTR,
908 SIP_NULLPTR,
909 SIP_NULLPTR,
910 release_wxMemoryFSHandler,
911 cast_wxMemoryFSHandler,
912 SIP_NULLPTR,
913 SIP_NULLPTR,
914 SIP_NULLPTR,
915 SIP_NULLPTR,
916 SIP_NULLPTR,
917 SIP_NULLPTR
918 };
919