X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/e3408b704dd0e4dbd6e47cbb9dd90362e4957098..ae8079a2109cc4cfe27fe5de16679726dd7660ca:/include/wx/base64.h diff --git a/include/wx/base64.h b/include/wx/base64.h index 7d5c72637e..1632e60e7e 100644 --- a/include/wx/base64.h +++ b/include/wx/base64.h @@ -89,6 +89,17 @@ wxBase64Decode(void *dst, size_t dstLen, wxBase64DecodeMode mode = wxBase64DecodeMode_Strict, size_t *posErr = NULL); +inline size_t +wxBase64Decode(void *dst, size_t dstLen, + const wxString& src, + wxBase64DecodeMode mode = wxBase64DecodeMode_Strict, + size_t *posErr = NULL) +{ + // don't use str.length() here as the ASCII buffer is shorter than it for + // strings with embedded NULs + return wxBase64Decode(dst, dstLen, src.ToAscii(), wxNO_LEN, mode, posErr); +} + // decode the contents of the given string; the returned buffer is empty if an // error occurs during decoding WXDLLIMPEXP_BASE wxMemoryBuffer