Added some inline helpers so the dependence on wxUSE_UNICODE and
wxUSE_WCHAR_T can be localized instead of having #if's all over the place. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@15545 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -2031,6 +2031,39 @@ typedef void (wxEvtHandler::*wxStyledTextEventFunction)(wxStyledTextEvent&);
|
||||
#endif
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// Utility functions used within wxSTC
|
||||
|
||||
#ifndef SWIG
|
||||
|
||||
inline wxString stc2wx(const char* str) {
|
||||
#if wxUSE_UNICODE
|
||||
return wxString(str, wxConvUTF8);
|
||||
#else
|
||||
return wxString(str);
|
||||
#endif
|
||||
}
|
||||
|
||||
inline wxString stc2wx(const char* str, size_t len) {
|
||||
#if wxUSE_UNICODE
|
||||
return wxString(str, wxConvUTF8, len);
|
||||
#else
|
||||
return wxString(str, len);
|
||||
#endif
|
||||
}
|
||||
|
||||
#if wxUSE_UNICODE
|
||||
inline const wxWX2MBbuf wx2stc(const wxString& str) {
|
||||
return str.mb_str(wxConvUTF8);
|
||||
}
|
||||
#else
|
||||
inline const wxWX2MBbuf wx2stc(const wxString& str) {
|
||||
return str.mbc_str();
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
#endif
|
||||
|
||||
|
Reference in New Issue
Block a user