Changeset 84287 in vbox for trunk/src/VBox/Main/glue
- Timestamp:
- May 13, 2020 1:59:34 PM (5 years ago)
- svn:sync-xref-src-repo-rev:
- 137924
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/glue/string.cpp
r83785 r84287 18 18 #include "VBox/com/string.h" 19 19 20 #include <iprt/base64.h> 20 21 #include <iprt/err.h> 22 #include <iprt/log.h> 21 23 #include <iprt/path.h> 22 #include <iprt/log.h>23 24 #include <iprt/string.h> 24 25 #include <iprt/uni.h> … … 228 229 return ucLeft < ucRight ? -1 : 1; 229 230 } 231 } 232 233 HRESULT Bstr::base64Encode(const void *pvData, size_t cbData, bool fLineBreaks /*= false*/) 234 { 235 uint32_t const fFlags = fLineBreaks ? RTBASE64_FLAGS_EOL_LF : RTBASE64_FLAGS_NO_LINE_BREAKS; 236 size_t cwcEncoded = RTBase64EncodedUtf16LengthEx(cbData, fFlags); 237 HRESULT hrc = reserveNoThrow(cwcEncoded + 1); 238 if (SUCCEEDED(hrc)) 239 { 240 int vrc = RTBase64EncodeUtf16Ex(pvData, cbData, fFlags, mutableRaw(), cwcEncoded, &cwcEncoded); 241 AssertRCReturnStmt(vrc, setNull(), E_FAIL); 242 hrc = joltNoThrow(cwcEncoded); 243 } 244 return hrc; 230 245 } 231 246
Note:
See TracChangeset
for help on using the changeset viewer.