Azure C++ Utils 1.5.2+3
Azure REST API Helpers for Modern C++
siddiqsoft::Base64Utils Struct Reference

Base64 encode/decode functions. More...

#include <base64-utils.hpp>

Static Public Member Functions

template<typename T = char>
requires std::same_as<T, char> || std::same_as<T, wchar_t>
static std::basic_string< T > urlEscape (const std::basic_string< T > &src)
 URL escape the base64 encoded string. More...
 
template<typename T = char>
requires std::same_as<T, char> || std::same_as<T, wchar_t>
static std::basic_string< T > encode (const std::basic_string< T > &argBin)
 Base64 encode a given "binary" string and optionally url escape. More...
 
template<typename T = char>
requires std::same_as<T, char> || std::same_as<T, wchar_t>
static std::basic_string< T > decode (const std::basic_string< T > &textuallyEncoded)
 Base64 decode the given encoded string back to the binary value. More...
 

Detailed Description

Base64 encode/decode functions.

Definition at line 59 of file base64-utils.hpp.

Member Function Documentation

◆ decode()

template<typename T = char>
requires std::same_as<T, char> || std::same_as<T, wchar_t>
static std::basic_string< T > siddiqsoft::Base64Utils::decode ( const std::basic_string< T > &  textuallyEncoded)
inlinestatic

Base64 decode the given encoded string back to the binary value.

Parameters
textuallyEncodedPreviously encoded value.
Returns
Base64 decoded string
Remarks
This is not a generic be-all implementation. For this, you should really call the underlying function directly with the necessary options. The implementation here is focussed on meeting the requirements for Azure services.

Definition at line 162 of file base64-utils.hpp.

◆ encode()

template<typename T = char>
requires std::same_as<T, char> || std::same_as<T, wchar_t>
static std::basic_string< T > siddiqsoft::Base64Utils::encode ( const std::basic_string< T > &  argBin)
inlinestatic

Base64 encode a given "binary" string and optionally url escape.

Parameters
argBinThe bytes to encode
Returns
Base64 encoded string
Remarks
This is not a generic be-all implementation. For this, you should really call the underlying function directly with the necessary options. The implementation here is focussed on meeting the requirements for Azure services.

Definition at line 112 of file base64-utils.hpp.

◆ urlEscape()

template<typename T = char>
requires std::same_as<T, char> || std::same_as<T, wchar_t>
static std::basic_string< T > siddiqsoft::Base64Utils::urlEscape ( const std::basic_string< T > &  src)
inlinestatic

URL escape the base64 encoded string.

Template Parameters
Tstd::string or std::wstring
Parameters
srcThe source MUST be a base64 encoded string
Returns
url encoded base64 source string

Definition at line 67 of file base64-utils.hpp.


The documentation for this struct was generated from the following file: