X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/5267aefd85739afd26bd19bfba998005119db446..6bd1764f2716e8d0814edd6374b20960bba23579:/interface/wx/strconv.h diff --git a/interface/wx/strconv.h b/interface/wx/strconv.h index 9a40c5cdec..2f1f55eda8 100644 --- a/interface/wx/strconv.h +++ b/interface/wx/strconv.h @@ -174,8 +174,25 @@ public: 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; //@{ /** @@ -201,8 +218,25 @@ public: 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; //@{ /** @@ -469,7 +503,7 @@ public: could use it like this: @code - wxChar *name = wxT("rawfile.doc"); + wxChar *name = "rawfile.doc"; FILE *fil = fopen(wxFNCONV(name), "r"); @endcode