1//-------------------------------------------------------------------------- 2// Name: filename.sip 3// Purpose: Implements a %MappedType for wxFileName 4// 5// Author: Robin Dunn 6// 7// Created: 30-July-2012 8// Copyright: (c) 2012-2018 by Total Control Software 9// Licence: wxWindows license 10//-------------------------------------------------------------------------- 11 12 13// wxFileNames are mapped to/from Unicode string objects 14 15%MappedType wxFileName 16{ 17 %ConvertToTypeCode 18 // Code to test a PyObject for compatibility with wxFileName 19 if (!sipIsErr) { 20 if (PyBytes_Check(sipPy) || PyUnicode_Check(sipPy)) 21 return TRUE; 22 return FALSE; 23 } 24 25 // Code to convert a compatible PyObject to a wxFileName 26 *sipCppPtr = new wxFileName(Py2wxString(sipPy)); 27 return sipGetState(sipTransferObj); 28 %End 29 30 31 %ConvertFromTypeCode 32 // Convert a wxString to a Python Unicode object. See wxpy_api.sip 33 return wx2PyString(sipCpp->GetFullPath()); 34 %End 35}; 36 37 38 39 40