26#ifndef ETL_BASE64_INCLUDED
27#define ETL_BASE64_INCLUDED
34#include "static_assert.h"
63 base64_exception(string_type reason_, string_type file_name_, numeric_type line_number_)
64 :
exception(reason_, file_name_, line_number_)
72 class base64_overflow :
public base64_exception
76 base64_overflow(string_type file_name_, numeric_type line_number_)
77 : base64_exception(ETL_ERROR_TEXT(
"base64:overflow", ETL_BASE64_FILE_ID
"A"), file_name_, line_number_)
85 class base64_invalid_data :
public base64_exception
89 base64_invalid_data(string_type file_name_, numeric_type line_number_)
90 : base64_exception(ETL_ERROR_TEXT(
"base64:invalid data", ETL_BASE64_FILE_ID
"B"), file_name_, line_number_)
98 class base64_invalid_decode_input_length :
public base64_exception
102 base64_invalid_decode_input_length(string_type file_name_, numeric_type line_number_)
103 : base64_exception(ETL_ERROR_TEXT(
"base64:invalid decode input length", ETL_BASE64_FILE_ID
"C"), file_name_, line_number_)
126 RFC_4648_URL_PADDING,
132 ETL_ENUM_TYPE(RFC_2152,
"RFC_2152")
133 ETL_ENUM_TYPE(RFC_3501,
"RFC_3501")
134 ETL_ENUM_TYPE(RFC_4648,
"RFC_4648")
135 ETL_ENUM_TYPE(RFC_4648_PADDING,
"RFC_4648_PADDING")
136 ETL_ENUM_TYPE(RFC_4648_URL,
"RFC_4648_URL")
137 ETL_ENUM_TYPE(RFC_4648_URL_PADDING,
"RFC_4648_URL_PADDING")
150 ETL_ENUM_TYPE(No_Padding,
"No_Padding")
151 ETL_ENUM_TYPE(Use_Padding,
"Use_Padding")
164 ETL_ENUM_TYPE(Ignore,
"Ignore")
165 ETL_ENUM_TYPE(Reject,
"Reject")
172 Min_Encode_Buffer_Size = 4,
173 Min_Decode_Buffer_Size = 3
178 ETL_CONSTEXPR14
base64(
const char* encoder_table_,
bool use_padding_)
179 : encoder_table(encoder_table_)
180 , use_padding(use_padding_)
187 static ETL_CONSTEXPR14
const char* character_set_1()
189 return "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
195 static ETL_CONSTEXPR14
const char* character_set_2()
197 return "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_";
203 static ETL_CONSTEXPR14
const char* character_set_3()
205 return "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+,";
208 const char* encoder_table;
209 const bool use_padding;
Common Base64 definitions.
Definition base64.h:112
#define ETL_DECLARE_ENUM_TYPE(TypeName, ValueType)
Definition enum_type.h:90
ETL_EXCEPTION_CONSTEXPR exception(string_type reason_, string_type, numeric_type)
Constructor.
Definition exception.h:81
Definition exception.h:59
Definition integral_limits.h:518
bitset_ext
Definition absolute.h:40