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:
Robin Dunn
2002-05-13 23:31:02 +00:00
parent 267484bc4f
commit 0c5b83b0fa
14 changed files with 246 additions and 140 deletions

View File

@@ -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