forked from wxWidgets/Phoenix
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfilename.sip
39 lines (29 loc) · 1.04 KB
/
filename.sip
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
//--------------------------------------------------------------------------
// Name: filename.sip
// Purpose: Implements a %MappedType for wxFileName
//
// Author: Robin Dunn
//
// Created: 30-July-2012
// Copyright: (c) 2012-2020 by Total Control Software
// Licence: wxWindows license
//--------------------------------------------------------------------------
// wxFileNames are mapped to/from Unicode string objects
%MappedType wxFileName
{
%ConvertToTypeCode
// Code to test a PyObject for compatibility with wxFileName
if (!sipIsErr) {
if (PyBytes_Check(sipPy) || PyUnicode_Check(sipPy))
return TRUE;
return FALSE;
}
// Code to convert a compatible PyObject to a wxFileName
*sipCppPtr = new wxFileName(Py2wxString(sipPy));
return sipGetState(sipTransferObj);
%End
%ConvertFromTypeCode
// Convert a wxString to a Python Unicode object. See wxpy_api.sip
return wx2PyString(sipCpp->GetFullPath());
%End
};