X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/5c6eb3a84be918dcfed2496d014549e13af0f0e9..c6f41dc81e858f59f036978a3256c48bc24abdb6:/include/wx/osx/core/cfstring.h diff --git a/include/wx/osx/core/cfstring.h b/include/wx/osx/core/cfstring.h index c4b1719c4d..addef26fd7 100644 --- a/include/wx/osx/core/cfstring.h +++ b/include/wx/osx/core/cfstring.h @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: wx/mac/corefoundation/cfstring.h +// Name: wx/osx/core/cfstring.h // Purpose: wxCFStringRef and other string functions // Author: Stefan Csomor // Modified by: @@ -17,7 +17,13 @@ #include "wx/dlimpexp.h" #include "wx/fontenc.h" -#include "wx/mac/corefoundation/cfref.h" +#include "wx/osx/core/cfref.h" + +#ifdef WORDS_BIGENDIAN + #define kCFStringEncodingUTF32Native kCFStringEncodingUTF32BE +#else + #define kCFStringEncodingUTF32Native kCFStringEncodingUTF32LE +#endif class WXDLLIMPEXP_FWD_BASE wxString; @@ -41,13 +47,20 @@ public: wxCFStringRef(const wxString &str, wxFontEncoding encoding = wxFONTENCODING_DEFAULT) ; +#if wxOSX_USE_COCOA_OR_IPHONE + wxCFStringRef(NSString* ref) + : wxCFRef< CFStringRef >((CFStringRef) ref) + { + } +#endif + wxCFStringRef(CFStringRef ref) - : wxCFRef< CFStringRef >(ref) + : wxCFRef< CFStringRef >(ref) { } wxCFStringRef(const wxCFStringRef& otherRef ) - : wxCFRef< CFStringRef >(otherRef) + : wxCFRef< CFStringRef >(otherRef) { } @@ -55,8 +68,18 @@ public: { } - wxString AsString( wxFontEncoding encoding = wxFONTENCODING_DEFAULT ) ; + wxString AsString( wxFontEncoding encoding = wxFONTENCODING_DEFAULT ) const; + + static wxString AsString( CFStringRef ref, wxFontEncoding encoding = wxFONTENCODING_DEFAULT ) ; + static wxString AsStringWithNormalizationFormC( CFStringRef ref, wxFontEncoding encoding = wxFONTENCODING_DEFAULT ) ; +#if wxOSX_USE_COCOA_OR_IPHONE + static wxString AsString( NSString* ref, wxFontEncoding encoding = wxFONTENCODING_DEFAULT ) ; + static wxString AsStringWithNormalizationFormC( NSString* ref, wxFontEncoding encoding = wxFONTENCODING_DEFAULT ) ; +#endif +#if wxOSX_USE_COCOA_OR_IPHONE + NSString* AsNSString() const { return (NSString*)(CFStringRef) *this; } +#endif private: } ;