- // Note that outLen is the length of the output buffer, not the length of
- // the input (which is always supposed to be terminated by one or more
- // NULs, as appropriate for the encoding)!
- virtual size_t MB2WC(wchar_t *out, const char *in, size_t outLen) const = 0;
- virtual size_t WC2MB(char *out, const wchar_t *in, size_t outLen) const = 0;
+ // On success, the return value is the length (i.e. the number of
+ // characters, not bytes) of the converted string including any trailing
+ // L'\0' or (possibly multiple) '\0'(s). If the conversion fails or if
+ // there is not enough space for everything, including the trailing NUL
+ // character(s), in the output buffer, wxCONV_FAILED is returned.
+ //
+ // In the special case when dstLen is 0 (outputBuf may be NULL then) the
+ // return value is the length of the needed buffer but nothing happens
+ // otherwise. If srcLen is wxNO_LEN, the entire string, up to and
+ // including the trailing NUL(s), is converted, otherwise exactly srcLen
+ // bytes are.
+ //
+ // Typical usage:
+ //
+ // size_t dstLen = conv.ToWChar(NULL, 0, src);
+ // if ( dstLen != wxCONV_FAILED )
+ // ... handle error ...
+ // wchar_t *wbuf = new wchar_t[dstLen];
+ // conv.ToWChar(wbuf, dstLen, src);
+ //
+ virtual size_t ToWChar(wchar_t *dst, size_t dstLen,
+ const char *src, size_t srcLen = wxNO_LEN) const;
+
+ virtual size_t FromWChar(char *dst, size_t dstLen,
+ const wchar_t *src, size_t srcLen = wxNO_LEN) const;
+