aboutsummaryrefslogtreecommitdiff
path: root/src/base64.cpp
diff options
context:
space:
mode:
authorMike Buland <eichlan@xagasoft.com>2009-07-29 23:02:26 +0000
committerMike Buland <eichlan@xagasoft.com>2009-07-29 23:02:26 +0000
commit24d46e151326b1b159603442e74540bf87897a53 (patch)
tree581d72fe2bda347793dddd4457f06614636474b4 /src/base64.cpp
parentc2292209eb4ece185f555a5c7823726794fe34cc (diff)
downloadlibbu++-24d46e151326b1b159603442e74540bf87897a53.tar.gz
libbu++-24d46e151326b1b159603442e74540bf87897a53.tar.bz2
libbu++-24d46e151326b1b159603442e74540bf87897a53.tar.xz
libbu++-24d46e151326b1b159603442e74540bf87897a53.zip
Base64, now more clever with fewer options.
Diffstat (limited to '')
-rw-r--r--src/base64.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/base64.cpp b/src/base64.cpp
index 723788b..b81d028 100644
--- a/src/base64.cpp
+++ b/src/base64.cpp
@@ -4,13 +4,13 @@ const char Bu::Base64::tblEnc[65] = {
4 "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/" 4 "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"
5}; 5};
6 6
7Bu::Base64::Base64( Bu::Stream &rNext, Mode eMode ) : 7Bu::Base64::Base64( Bu::Stream &rNext ) :
8 Bu::Filter( rNext ), 8 Bu::Filter( rNext ),
9 iBPos( 0 ), 9 iBPos( 0 ),
10 iBuf( 0 ), 10 iBuf( 0 ),
11 iTotalIn( 0 ), 11 iTotalIn( 0 ),
12 iTotalOut( 0 ), 12 iTotalOut( 0 ),
13 eMode( eMode ) 13 eMode( Nothing )
14{ 14{
15 start(); 15 start();
16 16
@@ -54,7 +54,7 @@ void Bu::Base64::start()
54 54
55size_t Bu::Base64::stop() 55size_t Bu::Base64::stop()
56{ 56{
57 if( eMode == Write ) 57// if( eMode |= Encode )
58 { 58 {
59 char outBuf[4]; 59 char outBuf[4];
60 int iBUsed = 4-(3-iBPos); 60 int iBUsed = 4-(3-iBPos);
@@ -71,10 +71,10 @@ size_t Bu::Base64::stop()
71 iTotalOut += rNext.write( outBuf, 4 ); 71 iTotalOut += rNext.write( outBuf, 4 );
72 return iTotalOut; 72 return iTotalOut;
73 } 73 }
74 else 74// else
75 { 75// {
76 return iTotalIn; 76 return iTotalIn;
77 } 77// }
78} 78}
79 79
80size_t Bu::Base64::read( void *pBuf, size_t nBytes ) 80size_t Bu::Base64::read( void *pBuf, size_t nBytes )