X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/524c47aa3adf2af11a3069fd5da035a604f08f66..aeab14d443572bdec6eef20def591d339e35df1e:/src/osx/carbon/utils.cpp diff --git a/src/osx/carbon/utils.cpp b/src/osx/carbon/utils.cpp index 7030447039..a1015f90c2 100644 --- a/src/osx/carbon/utils.cpp +++ b/src/osx/carbon/utils.cpp @@ -259,6 +259,27 @@ void wxMacNativeToPoint( const Point *n , wxPoint* wx ) wx->y = n->v; } +//--------------------------------------------------------------------------- +// wxMac Specific string utility functions +//--------------------------------------------------------------------------- + +void wxMacStringToPascal( const wxString&from , StringPtr to ) +{ + wxCharBuffer buf = from.mb_str( wxConvLocal ); + int len = strlen(buf); + + if ( len > 255 ) + len = 255; + to[0] = len; + memcpy( (char*) &to[1] , buf , len ); +} + +wxString wxMacMakeStringFromPascal( ConstStringPtr from ) +{ + return wxString( (char*) &from[1] , wxConvLocal , from[0] ); +} + + // ---------------------------------------------------------------------------- // Carbon Event Support // ----------------------------------------------------------------------------