]> git.saurik.com Git - wxWidgets.git/blobdiff - include/wx/base64.h
wxMSW: return correct value from wxMessageDialog::GetReturnCode().
[wxWidgets.git] / include / wx / base64.h
index 7d5c72637e56c0aa94a2e6d6f245b2263aeba74e..96c6dd80ef58220e7432857652c2937fb12525dd 100644 (file)
@@ -3,7 +3,6 @@
 // Purpose:     declaration of BASE64 encoding/decoding functionality
 // Author:      Charles Reimers, Vadim Zeitlin
 // Created:     2007-06-18
-// RCS-ID:      $Id$
 // Licence:     wxWindows licence
 ///////////////////////////////////////////////////////////////////////////////
 
@@ -89,6 +88,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