From b21162cf8e06f40baa1f58be6a8c17435cebc34d Mon Sep 17 00:00:00 2001 From: weidai Date: Fri, 4 Oct 2002 17:31:41 +0000 Subject: Initial revision git-svn-id: svn://svn.code.sf.net/p/cryptopp/code/trunk/c5@2 57ff6487-cd31-0410-9ec3-f628ee90f5f0 --- base64.h | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 base64.h (limited to 'base64.h') diff --git a/base64.h b/base64.h new file mode 100644 index 0000000..33072a0 --- /dev/null +++ b/base64.h @@ -0,0 +1,36 @@ +#ifndef CRYPTOPP_BASE64_H +#define CRYPTOPP_BASE64_H + +#include "basecode.h" + +NAMESPACE_BEGIN(CryptoPP) + +//! Base64 Encoder Class +class Base64Encoder : public SimpleProxyFilter +{ +public: + Base64Encoder(BufferedTransformation *attachment = NULL, bool insertLineBreaks = true, int maxLineLength = 72) + : SimpleProxyFilter(new BaseN_Encoder(new Grouper), attachment) + { + IsolatedInitialize(MakeParameters("InsertLineBreaks", insertLineBreaks)("MaxLineLength", maxLineLength)); + } + + void IsolatedInitialize(const NameValuePairs ¶meters); +}; + +//! Base64 Decoder Class +class Base64Decoder : public BaseN_Decoder +{ +public: + Base64Decoder(BufferedTransformation *attachment = NULL) + : BaseN_Decoder(GetDecodingLookupArray(), 6, attachment) {} + + void IsolatedInitialize(const NameValuePairs ¶meters) {} + +private: + static const int *GetDecodingLookupArray(); +}; + +NAMESPACE_END + +#endif -- cgit v1.2.1