X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/dd9b4b7f114427e2fc089c4f1b2d4d43d7b003d4..ea098413d0e9c3f794f43826137a636e229f26f9:/include/wx/mac/corefoundation/cfstring.h diff --git a/include/wx/mac/corefoundation/cfstring.h b/include/wx/mac/corefoundation/cfstring.h index 526f5791a5..ae3e73d375 100644 --- a/include/wx/mac/corefoundation/cfstring.h +++ b/include/wx/mac/corefoundation/cfstring.h @@ -18,6 +18,10 @@ #include #endif +#include "wx/fontenc.h" + +class WXDLLIMPEXP_BASE wxString; + void wxMacConvertNewlines13To10( char * data ) ; void wxMacConvertNewlines10To13( char * data ) ; void wxMacConvertNewlines13To10( wxString *data ) ; @@ -35,19 +39,20 @@ void wxMacWakeUp() ; class wxMacCFStringHolder { public: - wxMacCFStringHolder() - : m_cfs(NULL) , m_release(false) + wxMacCFStringHolder() + : m_cfs(NULL) , m_release(false) { } - wxMacCFStringHolder(const wxString &str , wxFontEncoding encoding ) - : m_cfs(NULL) , m_release(false) + wxMacCFStringHolder(const wxString &str, + wxFontEncoding encoding = wxFONTENCODING_DEFAULT) + : m_cfs(NULL) , m_release(false) { Assign( str , encoding ) ; } wxMacCFStringHolder(CFStringRef ref , bool release = true ) - : m_cfs(ref) , m_release(release) + : m_cfs(ref) , m_release(release) { } @@ -71,7 +76,8 @@ public: m_cfs = NULL ; } - void Assign( const wxString &str , wxFontEncoding encoding ) ; + void Assign(const wxString &str, + wxFontEncoding encoding = wxFONTENCODING_DEFAULT); operator CFStringRef () const { return m_cfs; } wxString AsString( wxFontEncoding encoding = wxFONTENCODING_DEFAULT ) ; @@ -80,8 +86,25 @@ private: CFStringRef m_cfs; bool m_release ; - + DECLARE_NO_COPY_CLASS( wxMacCFStringHolder ) } ; +// corresponding class for holding UniChars (native unicode characters) + +class wxMacUniCharBuffer +{ +public : + wxMacUniCharBuffer( const wxString &str ) ; + + ~wxMacUniCharBuffer() ; + + UniChar* GetBuffer() ; + + UniCharCount GetChars() ; + +private : + UniChar* m_ubuf ; + UniCharCount m_chars ; +}; #endif //__WXCFSTRINGHOLDER_H__