1 /////////////////////////////////////////////////////////////////////////////
2 // Name: wx/mac/corefoundation/cfstring.h
3 // Purpose: wxMacCFStringHolder and other string functions
4 // Author: Stefan Csomor
6 // Created: 2004-10-29 (from code in wx/mac/carbon/private.h)
8 // Copyright: (c) Stefan Csomor
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
12 #ifndef __WX_CFSTRINGHOLDER_H__
13 #define __WX_CFSTRINGHOLDER_H__
16 #include <CoreFoundation/CFString.h>
21 #include "wx/fontenc.h"
23 class WXDLLIMPEXP_BASE wxString
;
25 void wxMacConvertNewlines13To10( char * data
) ;
26 void wxMacConvertNewlines10To13( char * data
) ;
27 void wxMacConvertNewlines13To10( wxString
*data
) ;
28 void wxMacConvertNewlines10To13( wxString
*data
) ;
31 void wxMacConvertNewlines13To10( wxChar
* data
) ;
32 void wxMacConvertNewlines10To13( wxChar
* data
) ;
35 wxUint32
wxMacGetSystemEncFromFontEnc(wxFontEncoding encoding
) ;
36 wxFontEncoding
wxMacGetFontEncFromSystemEnc(wxUint32 encoding
) ;
39 class wxMacCFStringHolder
43 : m_cfs(NULL
) , m_release(false)
47 wxMacCFStringHolder(const wxString
&str
, wxFontEncoding encoding
)
48 : m_cfs(NULL
) , m_release(false)
50 Assign( str
, encoding
) ;
53 wxMacCFStringHolder(CFStringRef ref
, bool release
= true )
54 : m_cfs(ref
) , m_release(release
)
58 ~wxMacCFStringHolder()
65 CFStringRef retval
= m_cfs
;
73 if ( m_release
&& m_cfs
)
78 void Assign( const wxString
&str
, wxFontEncoding encoding
) ;
80 operator CFStringRef () const { return m_cfs
; }
81 wxString
AsString( wxFontEncoding encoding
= wxFONTENCODING_DEFAULT
) ;
88 DECLARE_NO_COPY_CLASS( wxMacCFStringHolder
)
91 #endif //__WXCFSTRINGHOLDER_H__