// Purpose: interface of wxMBConvUTF7
// Author: wxWidgets team
// RCS-ID: $Id$
-// Licence: wxWindows license
+// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
/**
This method can be used to allocate the buffer with enough space for the
trailing @c NUL characters for any encoding.
*/
- const size_t GetMaxMBNulLen();
+ static size_t GetMaxMBNulLen();
/**
Convert multibyte string to a wide character one.
The number of character written (or which would have been written
if it were non-@NULL) to @a dst or @c wxCONV_FAILED on error.
*/
- virtual size_t ToWChar(wchar_t* dst, size_t dstLen,
- const char* src,
+ virtual size_t ToWChar(wchar_t* dst, size_t dstLen, const char* src,
size_t srcLen = wxNO_LEN) const;
/**
The number of character written (or which would have been written
if it were non-@NULL) to @a dst or @c wxCONV_FAILED on error.
*/
- virtual size_t FromWChar(char* dst, size_t dstLen,
- const wchar_t* src,
+ virtual size_t FromWChar(char* dst, size_t dstLen, const wchar_t* src,
size_t srcLen = wxNO_LEN) const;
/**
compatibility concerns).
*/
const wxWCharBuffer cMB2WC(const char* in,
- size_t inLen = wxNO_LEN,
- size_t *outLen = NULL) const;
+ size_t inLen,
+ size_t *outLen) const;
+
+ /**
+ Converts a char buffer to wide char one.
+
+ This is the most convenient and safest conversion function as you
+ don't have to deal with the buffer lengths directly. Use it if the
+ input buffer is known not to be empty or if you are sure that the
+ conversion is going to succeed -- otherwise, use the overload above to
+ be able to distinguish between empty input and conversion failure.
+
+ @return
+ The buffer containing the converted text, empty if the input was
+ empty or if the conversion failed.
+
+ @since 2.9.1
+ */
+ const wxWCharBuffer cMB2WC(const wxCharBuffer& buf) const;
//@{
/**
FromWChar(), please see the description of cMB2WC() for more details.
*/
const wxCharBuffer cWC2MB(const wchar_t* in,
- size_t inLen = wxNO_LEN,
- size_t *outLen = NULL) const;
+ size_t inLen,
+ size_t *outLen) const;
+
+ /**
+ Converts a wide char buffer to char one.
+
+ This is the most convenient and safest conversion function as you
+ don't have to deal with the buffer lengths directly. Use it if the
+ input buffer is known not to be empty or if you are sure that the
+ conversion is going to succeed -- otherwise, use the overload above to
+ be able to distinguish between empty input and conversion failure.
+
+ @return
+ The buffer containing the converted text, empty if the input was
+ empty or if the conversion failed.
+
+ @since 2.9.1
+ */
+ const wxCharBuffer cWC2MB(const wxWCharBuffer& buf) const;
//@{
/**
could use it like this:
@code
- wxChar *name = wxT("rawfile.doc");
+ wxChar *name = "rawfile.doc";
FILE *fil = fopen(wxFNCONV(name), "r");
@endcode