+ // this function is used in the implementation of cMB2WC() to distinguish
+ // between the following cases:
+ //
+ // a) var width encoding with strings terminated by a single NUL
+ // (usual multibyte encodings): return 1 in this case
+ // b) fixed width encoding with 2 bytes/char and so terminated by
+ // 2 NULs (UTF-16/UCS-2 and variants): return 2 in this case
+ // c) fixed width encoding with 4 bytes/char and so terminated by
+ // 4 NULs (UTF-32/UCS-4 and variants): return 4 in this case
+ //
+ // anything else is not supported currently and -1 should be returned
+ virtual size_t GetMBNulLen() const { return 1; }
+
+ // return the maximal value currently returned by GetMBNulLen() for any
+ // encoding
+ static size_t GetMaxMBNulLen() { return 4 /* for UTF-32 */; }
+
+
+ // The old conversion functions. The existing classes currently mostly
+ // implement these ones but we're in transition to using To/FromWChar()
+ // instead and any new classes should implement just the new functions.
+ // For now, however, we provide default implementation of To/FromWChar() in
+ // this base class in terms of MB2WC/WC2MB() to avoid having to rewrite all
+ // the conversions at once.
+ //
+ // On success, the return value is the length (i.e. the number of
+ // characters, not bytes) not counting the trailing NUL(s) of the converted
+ // string. On failure, (size_t)-1 is returned. In the special case when
+ // outputBuf is NULL the return value is the same one but nothing is
+ // written to the buffer.
+ //
+ // 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;
+ virtual size_t WC2MB(char *out, const wchar_t *in, size_t outLen) const;
+
+
+ // make a heap-allocated copy of this object
+ virtual wxMBConv *Clone() const = 0;
+