X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/b27679518606c4739f1821fbb600687b17497dbf..0951fe0add48def28403dc0ef730b7483fb1a9be:/src/osx/utils_osx.cpp?ds=sidebyside diff --git a/src/osx/utils_osx.cpp b/src/osx/utils_osx.cpp index 5882a67144..8bd06e843e 100644 --- a/src/osx/utils_osx.cpp +++ b/src/osx/utils_osx.cpp @@ -156,4 +156,24 @@ CGColorRef wxMacCreateCGColorFromHITheme( ThemeBrush brush ) return color; } +//--------------------------------------------------------------------------- +// Mac Specific string utility functions +//--------------------------------------------------------------------------- + +void wxMacStringToPascal( const wxString&from , unsigned char * 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( const unsigned char * from ) +{ + return wxString( (char*) &from[1] , wxConvLocal , from[0] ); +} + #endif // wxOSX_USE_COCOA_OR_CARBON