26#ifndef ETL_BASE64_INCLUDED
27#define ETL_BASE64_INCLUDED
30#include "static_assert.h"
61 base64_exception(string_type reason_, string_type file_name_, numeric_type line_number_)
62 :
exception(reason_, file_name_, line_number_)
70 class base64_overflow :
public base64_exception
74 base64_overflow(string_type file_name_, numeric_type line_number_)
75 : base64_exception(ETL_ERROR_TEXT(
"base64:overflow", ETL_BASE64_FILE_ID
"A"), file_name_, line_number_)
83 class base64_invalid_data :
public base64_exception
87 base64_invalid_data(string_type file_name_, numeric_type line_number_)
88 : base64_exception(ETL_ERROR_TEXT(
"base64:invalid data", ETL_BASE64_FILE_ID
"B"), file_name_, line_number_)
96 class base64_invalid_decode_input_length :
public base64_exception
100 base64_invalid_decode_input_length(string_type file_name_, numeric_type line_number_)
101 : base64_exception(ETL_ERROR_TEXT(
"base64:invalid decode input length", ETL_BASE64_FILE_ID
"C"), file_name_, line_number_)
124 RFC_4648_URL_PADDING,
130 ETL_ENUM_TYPE(RFC_2152,
"RFC_2152")
131 ETL_ENUM_TYPE(RFC_3501,
"RFC_3501")
132 ETL_ENUM_TYPE(RFC_4648,
"RFC_4648")
133 ETL_ENUM_TYPE(RFC_4648_PADDING,
"RFC_4648_PADDING")
134 ETL_ENUM_TYPE(RFC_4648_URL,
"RFC_4648_URL")
135 ETL_ENUM_TYPE(RFC_4648_URL_PADDING,
"RFC_4648_URL_PADDING")
148 ETL_ENUM_TYPE(No_Padding,
"No_Padding")
149 ETL_ENUM_TYPE(Use_Padding,
"Use_Padding")
162 ETL_ENUM_TYPE(Ignore,
"Ignore")
163 ETL_ENUM_TYPE(Reject,
"Reject")
170 Min_Encode_Buffer_Size = 4,
171 Min_Decode_Buffer_Size = 3
177 base64(
const char* encoder_table_,
179 : encoder_table(encoder_table_)
180 , use_padding(use_padding_)
189 const char* character_set_1()
191 return "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
199 const char* character_set_2()
201 return "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_";
209 const char* character_set_3()
211 return "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+,";
214 const char* encoder_table;
215 const bool use_padding;
Common Base64 definitions.
Definition base64.h:110
#define ETL_DECLARE_ENUM_TYPE(TypeName, ValueType)
Definition enum_type.h:85
ETL_CONSTEXPR exception(string_type reason_, string_type, numeric_type line_)
Constructor.
Definition exception.h:69
Definition exception.h:47
Definition integral_limits.h:516
bitset_ext
Definition absolute.h:39