]>
git.saurik.com Git - wxWidgets.git/blob - include/wx/stc/private.h
1 ////////////////////////////////////////////////////////////////////////////
2 // Name: wx/stc/private.h
3 // Purpose: Private declarations for wxSTC
6 // Copyright: (c) 2000 by Total Control Software
7 // Licence: wxWindows licence
8 /////////////////////////////////////////////////////////////////////////////
10 #ifndef _WX_STC_PRIVATE_H_
11 #define _WX_STC_PRIVATE_H_
14 #include "wx/string.h"
16 //----------------------------------------------------------------------
17 // Utility functions used within wxSTC
21 extern wxString
stc2wx(const char* str
);
22 extern wxString
stc2wx(const char* str
, size_t len
);
23 extern wxCharBuffer
wx2stc(const wxString
& str
);
25 // This function takes both wxString and wxCharBuffer because it uses either
26 // one or the other of them depending on the build mode. In Unicode it uses the
27 // length of the already converted buffer to avoid doing the conversion again
28 // just to compute the length.
29 inline size_t wx2stclen(const wxString
& WXUNUSED(str
), const wxCharBuffer
& buf
)
31 return buf
.length() - 1;
36 inline wxString
stc2wx(const char* str
) {
39 inline wxString
stc2wx(const char* str
, size_t len
) {
40 return wxString(str
, len
);
42 inline const char* wx2stc(const wxString
& str
) {
46 // As explained above, the buffer argument is only used in Unicode build.
47 inline size_t wx2stclen(const wxString
& str
, const char* WXUNUSED(buf
))
54 #endif // _WX_STC_PRIVATE_H_