Minor corrections to ToWChar() comment.

Don't refer to the non-existent outputBuf parameter and don't imply that the
value of dstLen matters to decide whether we really convert or not -- only
whether dst pointer itself is NULL or not does.

See #11486.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62792 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin 2009-12-06 02:29:56 +00:00
parent 62b5065560
commit 961326054f

View File

@ -61,19 +61,21 @@ public:
// there is not enough space for everything, including the trailing NUL // there is not enough space for everything, including the trailing NUL
// character(s), in the output buffer, wxCONV_FAILED is returned. // character(s), in the output buffer, wxCONV_FAILED is returned.
// //
// In the special case when dstLen is 0 (outputBuf may be NULL then) the // In the special case when dst is NULL (the value of dstLen is ignored
// return value is the length of the needed buffer but nothing happens // then) the return value is the length of the needed buffer but nothing
// otherwise. If srcLen is wxNO_LEN, the entire string, up to and // happens otherwise. If srcLen is wxNO_LEN, the entire string, up to and
// including the trailing NUL(s), is converted, otherwise exactly srcLen // including the trailing NUL(s), is converted, otherwise exactly srcLen
// bytes are. // bytes are.
// //
// Typical usage: // Typical usage:
// //
// size_t dstLen = conv.ToWChar(NULL, 0, src); // size_t dstLen = conv.ToWChar(NULL, 0, src);
// if ( dstLen != wxCONV_FAILED ) // if ( dstLen == wxCONV_FAILED )
// ... handle error ... // ... handle error ...
// wchar_t *wbuf = new wchar_t[dstLen]; // wchar_t *wbuf = new wchar_t[dstLen];
// conv.ToWChar(wbuf, dstLen, src); // conv.ToWChar(wbuf, dstLen, src);
// ... work with wbuf ...
// delete [] wbuf;
// //
virtual size_t ToWChar(wchar_t *dst, size_t dstLen, virtual size_t ToWChar(wchar_t *dst, size_t dstLen,
const char *src, size_t srcLen = wxNO_LEN) const; const char *src, size_t srcLen = wxNO_LEN) const;