string.h

来自「很牛的GUI源码wxWidgets-2.8.0.zip 可在多种平台下运行.」· C头文件 代码 · 共 54 行

H
54
字号
///////////////////////////////////////////////////////////////////////////////// Name:        wx/cocoa/string.h// Purpose:     String conversion methods// Author:      David Elliott// Modified by:// Created:     2003/04/13// RCS-ID:      $Id: string.h,v 1.4 2004/05/23 20:50:42 JS Exp $// Copyright:   (c) 2003 David Elliott// Licence:     wxWindows licence///////////////////////////////////////////////////////////////////////////////#ifndef __WX_COCOA_STRING_H__#define __WX_COCOA_STRING_H__#import <Foundation/NSString.h>#include "wx/string.h"// FIXME: In unicode mode we are doing the conversion twice.  wxString// converts to UTF-8 and NSString converts from UTF-8.// One possible optimization is to convert to the wxString internal// representation which is an unsigned short (unichar) but unfortunately// there is little documentation on which encoding it uses by default.// Return an autoreleased NSStringinline NSString* wxNSStringWithWxString(const wxString &wxstring){#if wxUSE_UNICODE    return [NSString stringWithUTF8String: wxstring.mb_str(wxConvUTF8)];#else    return [NSString stringWithCString: wxstring.c_str() length:wxstring.Len()];#endif // wxUSE_UNICODE}// Intialize an NSString which has already been allocatedinline NSString* wxInitNSStringWithWxString(NSString *nsstring, const wxString &wxstring){#if wxUSE_UNICODE    return [nsstring initWithUTF8String: wxstring.mb_str(wxConvUTF8)];#else    return [nsstring initWithCString: wxstring.c_str() length:wxstring.Len()];#endif // wxUSE_UNICODE}inline wxString wxStringWithNSString(NSString *nsstring){#if wxUSE_UNICODE    return wxString([nsstring UTF8String], wxConvUTF8);#else    return wxString([nsstring lossyCString]);#endif // wxUSE_UNICODE}#endif // __WX_COCOA_STRING_H__

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?