diff options
author | George Hazan <ghazan@miranda.im> | 2022-09-29 20:37:34 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2022-09-29 20:37:34 +0300 |
commit | b359d6b48c63e7bc264e144d637aa4aea4044b41 (patch) | |
tree | 9a7f770b319df40f5c50188a2e9ca896e2909be5 /src/mir_core | |
parent | 935a628516e3f273b35198183bd46626da588803 (diff) |
additional helper for base64 encoding of MBinBuffer contents
Diffstat (limited to 'src/mir_core')
-rw-r--r-- | src/mir_core/src/http.cpp | 10 | ||||
-rw-r--r-- | src/mir_core/src/mir_core.def | 1 | ||||
-rw-r--r-- | src/mir_core/src/mir_core64.def | 1 |
3 files changed, 12 insertions, 0 deletions
diff --git a/src/mir_core/src/http.cpp b/src/mir_core/src/http.cpp index 12d2add914..e983676dd0 100644 --- a/src/mir_core/src/http.cpp +++ b/src/mir_core/src/http.cpp @@ -105,6 +105,16 @@ MIR_CORE_DLL(char*) mir_base64_encode(const void *input, size_t inputLen) return mir_base64_encodebuf(input, inputLen, output, outputLen);
}
+MIR_CORE_DLL(char *) mir_base64_encode(const MBinBuffer &buf)
+{
+ size_t outputLen = mir_base64_encode_bufsize(buf.length());
+ char *output = (char *)mir_alloc(outputLen);
+ if (output == nullptr)
+ return nullptr;
+
+ return mir_base64_encodebuf(buf.data(), buf.length(), output, outputLen);
+}
+
MIR_CORE_DLL(char*) mir_base64_encodebuf(const void *input, size_t inputLen, char *output, size_t outputLen)
{
if (input == nullptr)
diff --git a/src/mir_core/src/mir_core.def b/src/mir_core/src/mir_core.def index 51c2de344b..012cd74908 100644 --- a/src/mir_core/src/mir_core.def +++ b/src/mir_core/src/mir_core.def @@ -1545,3 +1545,4 @@ _Utils_CorrectFontSize@4 @1762 NONAME ??0MBinBuffer@@QAE@I@Z @1765 NONAME
?Utils_ClipboardCopy@@YGXPBD@Z @1766 NONAME
?Utils_ClipboardCopy@@YGXPB_W@Z @1767 NONAME
+?mir_base64_encode@@YGPADABVMBinBuffer@@@Z @1768 NONAME
diff --git a/src/mir_core/src/mir_core64.def b/src/mir_core/src/mir_core64.def index 20ad714a5f..b2e8cf77de 100644 --- a/src/mir_core/src/mir_core64.def +++ b/src/mir_core/src/mir_core64.def @@ -1545,3 +1545,4 @@ Utils_CorrectFontSize @1762 NONAME ??0MBinBuffer@@QEAA@_K@Z @1765 NONAME
?Utils_ClipboardCopy@@YAXPEBD@Z @1766 NONAME
?Utils_ClipboardCopy@@YAXPEB_W@Z @1767 NONAME
+?mir_base64_encode@@YAPEADAEBVMBinBuffer@@@Z @1768 NONAME
|