moving wxOSXCreateURLFromFileSystemPath to common OSX

This commit is contained in:
Stefan Csomor
2020-04-06 16:08:47 +02:00
parent 1dc0c777ae
commit eaec76ee97
2 changed files with 14 additions and 9 deletions

View File

@@ -51,7 +51,6 @@ wxString WXDLLIMPEXP_CORE wxMacMakeStringFromPascal( const unsigned char * from
WXDLLIMPEXP_BASE wxString wxMacFSRefToPath( const FSRef *fsRef , CFStringRef additionalPathComponent = NULL ); WXDLLIMPEXP_BASE wxString wxMacFSRefToPath( const FSRef *fsRef , CFStringRef additionalPathComponent = NULL );
WXDLLIMPEXP_BASE OSStatus wxMacPathToFSRef( const wxString&path , FSRef *fsRef ); WXDLLIMPEXP_BASE OSStatus wxMacPathToFSRef( const wxString&path , FSRef *fsRef );
WXDLLIMPEXP_BASE wxString wxMacHFSUniStrToString( ConstHFSUniStr255Param uniname ); WXDLLIMPEXP_BASE wxString wxMacHFSUniStrToString( ConstHFSUniStr255Param uniname );
WXDLLIMPEXP_BASE CFURLRef wxOSXCreateURLFromFileSystemPath( const wxString& path);
// keycode utils from app.cpp // keycode utils from app.cpp
@@ -60,6 +59,8 @@ WXDLLIMPEXP_BASE long wxMacTranslateKey(unsigned char key, unsigned char code);
#endif #endif
WXDLLIMPEXP_BASE CFURLRef wxOSXCreateURLFromFileSystemPath( const wxString& path);
#if wxUSE_GUI #if wxUSE_GUI
#if wxOSX_USE_IPHONE #if wxOSX_USE_IPHONE

View File

@@ -796,7 +796,16 @@ wxString wxPathOnly (const wxString& path)
// and back again - or we get nasty problems with delimiters. // and back again - or we get nasty problems with delimiters.
// Also, convert to lower case, since case is significant in UNIX. // Also, convert to lower case, since case is significant in UNIX.
#if defined(__WXMAC__) && !defined(__WXOSX_IPHONE__) #ifdef __WXOSX__
CFURLRef wxOSXCreateURLFromFileSystemPath( const wxString& path)
{
wxCFRef<CFMutableStringRef> cfMutableString(CFStringCreateMutableCopy(NULL, 0, wxCFStringRef(path)));
CFStringNormalize(cfMutableString,kCFStringNormalizationFormD);
return CFURLCreateWithFileSystemPath(kCFAllocatorDefault, cfMutableString , kCFURLPOSIXPathStyle, false);
}
#ifndef __WXOSX_IPHONE__
wxString wxMacFSRefToPath( const FSRef *fsRef , CFStringRef additionalPathComponent ) wxString wxMacFSRefToPath( const FSRef *fsRef , CFStringRef additionalPathComponent )
{ {
@@ -842,13 +851,6 @@ wxString wxMacHFSUniStrToString( ConstHFSUniStr255Param uniname )
return wxCFStringRef::AsStringWithNormalizationFormC(cfname); return wxCFStringRef::AsStringWithNormalizationFormC(cfname);
} }
CFURLRef wxOSXCreateURLFromFileSystemPath( const wxString& path)
{
wxCFRef<CFMutableStringRef> cfMutableString(CFStringCreateMutableCopy(NULL, 0, wxCFStringRef(path)));
CFStringNormalize(cfMutableString,kCFStringNormalizationFormD);
return CFURLCreateWithFileSystemPath(kCFAllocatorDefault, cfMutableString , kCFURLPOSIXPathStyle, false);
}
#ifndef __LP64__ #ifndef __LP64__
wxString wxMacFSSpec2MacFilename( const FSSpec *spec ) wxString wxMacFSSpec2MacFilename( const FSSpec *spec )
@@ -871,6 +873,8 @@ void wxMacFilename2FSSpec( const wxString& path , FSSpec *spec )
} }
#endif #endif
#endif // !__WXOSX_IPHONE__
#endif // __WXMAC__ #endif // __WXMAC__