26#ifndef ETL_BASE64_INCLUDED
27#define ETL_BASE64_INCLUDED
60 base64_exception(string_type reason_, string_type file_name_, numeric_type line_number_)
61 :
exception(reason_, file_name_, line_number_)
69 class base64_overflow :
public base64_exception
73 base64_overflow(string_type file_name_, numeric_type line_number_)
74 : base64_exception(ETL_ERROR_TEXT(
"base64:overflow", ETL_BASE64_FILE_ID
"A"), file_name_, line_number_)
82 class base64_invalid_data :
public base64_exception
86 base64_invalid_data(string_type file_name_, numeric_type line_number_)
87 : base64_exception(ETL_ERROR_TEXT(
"base64:invalid data", ETL_BASE64_FILE_ID
"B"), file_name_, line_number_)
95 class base64_invalid_decode_input_length :
public base64_exception
99 base64_invalid_decode_input_length(string_type file_name_, numeric_type line_number_)
100 : base64_exception(ETL_ERROR_TEXT(
"base64:invalid decode input length", ETL_BASE64_FILE_ID
"C"), file_name_, line_number_)
123 RFC_4648_URL_PADDING,
129 ETL_ENUM_TYPE(RFC_2152,
"RFC_2152")
130 ETL_ENUM_TYPE(RFC_3501,
"RFC_3501")
131 ETL_ENUM_TYPE(RFC_4648,
"RFC_4648")
132 ETL_ENUM_TYPE(RFC_4648_PADDING,
"RFC_4648_PADDING")
133 ETL_ENUM_TYPE(RFC_4648_URL,
"RFC_4648_URL")
134 ETL_ENUM_TYPE(RFC_4648_URL_PADDING,
"RFC_4648_URL_PADDING")
147 ETL_ENUM_TYPE(No_Padding,
"No_Padding")
148 ETL_ENUM_TYPE(Use_Padding,
"Use_Padding")
161 ETL_ENUM_TYPE(Ignore,
"Ignore")
162 ETL_ENUM_TYPE(Reject,
"Reject")
169 Min_Encode_Buffer_Size = 4,
170 Min_Decode_Buffer_Size = 3
175 ETL_CONSTEXPR14
base64(
const char* encoder_table_,
bool use_padding_)
176 : encoder_table(encoder_table_)
177 , use_padding(use_padding_)
184 static ETL_CONSTEXPR14
const char* character_set_1()
186 return "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
192 static ETL_CONSTEXPR14
const char* character_set_2()
194 return "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_";
200 static ETL_CONSTEXPR14
const char* character_set_3()
202 return "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+,";
205 const char* encoder_table;
206 const bool use_padding;
Common Base64 definitions.
Definition base64.h:109
ETL_EXCEPTION_CONSTEXPR exception(string_type reason_, string_type, numeric_type)
Constructor.
Definition exception.h:81
Definition exception.h:59
Definition integral_limits.h:517
#define ETL_DECLARE_ENUM_TYPE(TypeName, ValueType)
Definition enum_type.h:90