summaryrefslogtreecommitdiff
path: root/base64.h
diff options
context:
space:
mode:
authorweidai <weidai@57ff6487-cd31-0410-9ec3-f628ee90f5f0>2002-10-04 17:31:41 +0000
committerweidai <weidai@57ff6487-cd31-0410-9ec3-f628ee90f5f0>2002-10-04 17:31:41 +0000
commitb21162cf8e06f40baa1f58be6a8c17435cebc34d (patch)
tree8b045309c238226c32a563b1df6b9c30a2f0e0b3 /base64.h
downloadcryptopp-b21162cf8e06f40baa1f58be6a8c17435cebc34d.tar.gz
Initial revision
git-svn-id: svn://svn.code.sf.net/p/cryptopp/code/trunk/c5@2 57ff6487-cd31-0410-9ec3-f628ee90f5f0
Diffstat (limited to 'base64.h')
-rw-r--r--base64.h36
1 files changed, 36 insertions, 0 deletions
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 &parameters);
+};
+
+//! Base64 Decoder Class
+class Base64Decoder : public BaseN_Decoder
+{
+public:
+ Base64Decoder(BufferedTransformation *attachment = NULL)
+ : BaseN_Decoder(GetDecodingLookupArray(), 6, attachment) {}
+
+ void IsolatedInitialize(const NameValuePairs &parameters) {}
+
+private:
+ static const int *GetDecodingLookupArray();
+};
+
+NAMESPACE_END
+
+#endif