Jan 18th update

This commit is contained in:
Ned Wright
2023-01-18 16:36:27 +00:00
parent 35b6a4aebf
commit bb0714e4cb
7 changed files with 409 additions and 149 deletions

View File

@@ -32,6 +32,9 @@
#define GCC_VERSION (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__)
enum base64_variants {SINGLE_B64_CHUNK_CONVERT, KEY_VALUE_B64_PAIR, CONTINUE_AS_IS};
enum base64_stage {BEFORE_EQUAL, EQUAL, DONE, MISDETECT};
// This is portable version of stricmp(), which is non-standard function (not even in C).
// Contrary to stricmp(), for a slight optimization, s2 is ASSUMED to be already in lowercase.
// s1 can be in mixed case and is convetred using tolower() before comparing to s2.
@@ -830,6 +833,13 @@ void unescapeUnicode(std::string &text);
// Try to find and decode UTF7 chunks
std::string filterUTF7(const std::string &text);
bool
decodeBase64Chunk(
const std::string &value,
std::string::const_iterator it,
std::string::const_iterator end,
std::string &decoded);
bool
b64DecodeChunk(
const std::string &value,
@@ -855,6 +865,11 @@ namespace Util {
int &deletedCount,
std::string &outStr);
base64_variants b64Test (
const std::string &s,
std::string &key,
std::string &value);
// The original stdlib implementation of isalpha() supports locale settings which we do not really need.
// It is also proven to contribute to slow performance in some of the algorithms using it.
// This function has reduced functionality compared to stdlib isalpha(), but is much faster.