From 724ebdde8aab56457bd0bbfd5e3a576f90b48590 Mon Sep 17 00:00:00 2001 From: David Elliott Date: Fri, 13 Jun 2003 21:09:21 +0000 Subject: [PATCH] Added wxString to NSString conversion functions git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@21130 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/cocoa/string.h | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 include/wx/cocoa/string.h diff --git a/include/wx/cocoa/string.h b/include/wx/cocoa/string.h new file mode 100644 index 0000000000..d9dde29d24 --- /dev/null +++ b/include/wx/cocoa/string.h @@ -0,0 +1,30 @@ +/////////////////////////////////////////////////////////////////////////////// +// Name: wx/cocoa/string.h +// Purpose: String conversion methods +// Author: David Elliott +// Modified by: +// Created: 2003/04/13 +// RCS-ID: $Id$ +// Copyright: (c) 2003 David Elliott +// Licence: wxWindows licence +/////////////////////////////////////////////////////////////////////////////// + +#ifndef __WX_COCOA_STRING_H__ +#define __WX_COCOA_STRING_H__ + +#import +#include "wx/string.h" + +// Return an autoreleased NSString +inline NSString* wxNSStringWithWxString(const wxString &wxstring) +{ + return [NSString stringWithCString: wxstring.c_str() length:wxstring.Len()]; +} + +// Intialize an NSString which has already been allocated +inline NSString* wxInitNSStringWithWxString(NSString *nsstring, const wxString &wxstring) +{ + return [nsstring initWithCString: wxstring.c_str() length:wxstring.Len()]; +} + +#endif // __WX_COCOA_STRING_H__ -- 2.50.0