Don't use wxWxCharBuffer any more

We still provide this #define, but there is no reason to use it inside
the library itself, so replace it with the more clear wxWCharBuffer.

No real changes.
This commit is contained in:
Vadim Zeitlin 2022-10-28 20:00:59 +01:00
parent c5f8cefe1e
commit 5f45e697bd
7 changed files with 13 additions and 14 deletions

View file

@ -72,7 +72,7 @@ struct WXDLLIMPEXP_BASE wxStringOperationsWchar
buf.data[1] = 0;
return buf;
}
static wxWxCharBuffer EncodeNChars(size_t n, const wxUniChar& ch);
static wxWCharBuffer EncodeNChars(size_t n, const wxUniChar& ch);
static bool IsSingleCodeUnitCharacter(const wxUniChar&) { return true; }
#endif

View file

@ -128,8 +128,7 @@ protected:
wxString m_string; // the string we tokenize
wxString::const_iterator m_stringEnd;
// FIXME-UTF8: use wxWcharBuffer
wxWxCharBuffer m_delims; // all possible delimiters
wxWCharBuffer m_delims; // all possible delimiters
size_t m_delimsLen;
wxString::const_iterator m_pos; // the current position in m_string

View file

@ -405,7 +405,7 @@ wxFileConfig::wxFileConfig(wxInputStream &inStream, const wxMBConv& conv)
m_linesTail = nullptr;
// read the entire stream contents in memory
wxWxCharBuffer cbuf;
wxWCharBuffer cbuf;
static const size_t chunkLen = 1024;
wxMemoryBuffer buf(chunkLen);
@ -501,8 +501,8 @@ void wxFileConfig::Parse(const wxTextBuffer& buffer, bool bLocal)
for ( size_t n = 0; n < nLineCount; n++ )
{
wxString strLine = buffer[n];
// FIXME-UTF8: rewrite using iterators, without this buffer
wxWxCharBuffer buf(strLine.c_str());
// FIXME-UTF8: rewrite using iterators
wxWCharBuffer buf(strLine.c_str());
const wxChar *pStart;
const wxChar *pEnd;

View file

@ -75,9 +75,9 @@ wxWCharBuffer wxStringOperationsWchar::EncodeNChars(size_t n, const wxUniChar& c
#else
wxWxCharBuffer wxStringOperationsWchar::EncodeNChars(size_t n, const wxUniChar& ch)
wxWCharBuffer wxStringOperationsWchar::EncodeNChars(size_t n, const wxUniChar& ch)
{
wxWxCharBuffer buf(n);
wxWCharBuffer buf(n);
#if wxUSE_UNICODE_WCHAR
wmemset(buf.data(), (wchar_t)ch, n);
#else // ANSI

View file

@ -386,7 +386,7 @@ private:
// retrieve the command line history into the provided buffer and return
// its length
int GetCommandHistory(wxWxCharBuffer& buf) const;
int GetCommandHistory(wxWCharBuffer& buf) const;
// check if the console history has changed
bool IsHistoryUnchanged() const;
@ -398,7 +398,7 @@ private:
HANDLE m_hStderr; // console handle, if it's valid we must call
// FreeConsole() (even if m_ok != 1)
wxWxCharBuffer m_history; // command history on startup
wxWCharBuffer m_history; // command history on startup
int m_historyLen; // length command history buffer
wxCharBuffer m_data; // data between empty line and cursor position
@ -493,7 +493,7 @@ bool wxConsoleStderr::DoInit()
return true;
}
int wxConsoleStderr::GetCommandHistory(wxWxCharBuffer& buf) const
int wxConsoleStderr::GetCommandHistory(wxWCharBuffer& buf) const
{
// these functions are internal and may only be called by cmd.exe
static const wxChar *CMD_EXE = wxT("cmd.exe");
@ -519,7 +519,7 @@ bool wxConsoleStderr::IsHistoryUnchanged() const
wxASSERT_MSG( m_ok == 1, wxT("shouldn't be called if not initialized") );
// get (possibly changed) command history
wxWxCharBuffer history;
wxWCharBuffer history;
const int historyLen = GetCommandHistory(history);
// and compare it with the original one

View file

@ -456,7 +456,7 @@ void wxMSWHeaderCtrl::DoInsertItem(const wxHeaderColumn& col, unsigned int idx)
// notice that we need to store the string we use the pointer to until we
// pass it to the control
hdi.mask |= HDI_TEXT;
wxWxCharBuffer buf = col.GetTitle().t_str();
wxWCharBuffer buf = col.GetTitle().t_str();
hdi.pszText = buf.data();
hdi.cchTextMax = wxStrlen(buf);

View file

@ -760,7 +760,7 @@ long wxExecute(const wxString& cmd, int flags, wxProcess *handler,
dwFlags |= CREATE_DEFAULT_ERROR_MODE ;
wxWxCharBuffer envBuffer;
wxWCharBuffer envBuffer;
bool useCwd = false;
if ( env )
{