From 0b196ccd2aca64945771a6508accfc81ec0443b6 Mon Sep 17 00:00:00 2001 From: Myun2 Date: Mon, 21 May 2012 22:53:27 +0900 Subject: [PATCH] base64.hpp --- roast/include/roast/net/base64.hpp | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/roast/include/roast/net/base64.hpp b/roast/include/roast/net/base64.hpp index 2d817751..077cad77 100644 --- a/roast/include/roast/net/base64.hpp +++ b/roast/include/roast/net/base64.hpp @@ -9,21 +9,32 @@ namespace roast { struct base64 { + static const char* table; + template - void encode(const _InputIterator& it, _OutputStream& os) + void encode(_InputIterator it, _OutputStream& os) { - + for(; it.available(); it++) + { + // Check the char + const _It it_work = it; + _EncCheck checker; + if ( checker.analyze(it_work, param) == false ) + break; + + m_str.append(1,*p); + } } template - void decode(const _InputIterator& it, _OutputStream& os) + void decode(_InputIterator it, _OutputStream& os) { } }; + + const char* base64::table = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="; } -#define _ROAST_BASE64_ENC_TABLE "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=" - inline void roast_base64_enc(const char* s, size_t length, char* result) { const char* p_in = s; -- 2.11.0