(file) Return to Base64.cpp CVS log (file) (dir) Up to [Pegasus] / pegasus / src / Pegasus / Common

Diff for /pegasus/src/Pegasus/Common/Base64.cpp between version 1.16 and 1.17

version 1.16, 2003/08/06 14:08:48 version 1.17, 2003/08/12 17:59:21
Line 31 
Line 31 
 #include "Base64.h" #include "Base64.h"
 #include <Pegasus/Common/ArrayInternal.h> #include <Pegasus/Common/ArrayInternal.h>
  
 #ifdef PEGASUS_OS_OS400  
 // OS400 is EBCDIC so it needs to convert string and characters to ASCII  
 // prior to decode and encode.  The encoding and decoding are done in ASCII.  
 #include <Pegasus/Common/OS400ConvertChar.h>  
 // This converts all string literal to ccsid 819  
 #pragma convert(819)  
 #endif  
   
 PEGASUS_NAMESPACE_BEGIN PEGASUS_NAMESPACE_BEGIN
 PEGASUS_USING_STD; PEGASUS_USING_STD;
  
Line 127 
Line 119 
     if (vby.size() == 0)     if (vby.size() == 0)
         return retArray;         return retArray;
     // for every character in the input array taken 3 bytes at a time     // for every character in the input array taken 3 bytes at a time
   
 #ifdef PEGASUS_OS_OS400  
     //For OS400 convert from ebcdic to ascii  
     EtoA((char *)vby.getData(), vby.size());  
 #endif  
   
     for (Uint32 i=0; i < vby.size(); i+=3)     for (Uint32 i=0; i < vby.size(); i+=3)
     {     {
  
Line 178 
Line 164 
         */         */
     };     };
  
 #ifdef PEGASUS_OS_OS400  
     //For OS400 convert from ascii to ebcdic  
     AtoE((char *)retArray.getData(), retArray.size());  
 #endif  
   
     return retArray;     return retArray;
 }; };
 /*I checked for the zero length. The algorithm would also work for zero length input stream, but I’m pretty adamant about handling border conditions. They are often the culprits of run-time production failures. /*I checked for the zero length. The algorithm would also work for zero length input stream, but I’m pretty adamant about handling border conditions. They are often the culprits of run-time production failures.
Line 194 
Line 175 
 */ */
 Array<Uint8> Base64::decode(const Array<Sint8> strInput) Array<Uint8> Base64::decode(const Array<Sint8> strInput)
 { {
 #ifdef PEGASUS_OS_OS400  
     //For OS400 convert from ebcdic to ascii  
     EtoA((char *)strInput.getData(), strInput.size());  
 #endif  
   
     //Strip any non-base64 characters from the input     //Strip any non-base64 characters from the input
     Array<Sint8> str;     Array<Sint8> str;
     for (Uint32 j=0;j<strInput.size();j++)     for (Uint32 j=0;j<strInput.size();j++)
Line 248 
Line 224 
             retArray.append( ((by3&0x3)<<6)|by4 );             retArray.append( ((by3&0x3)<<6)|by4 );
     }     }
  
 #ifdef PEGASUS_OS_OS400  
     //For OS400 convert from ascii to ebcdic  
     AtoE((char *)retArray.getData(), retArray.size());  
 #endif  
  
     return retArray;     return retArray;
 }; };


Legend:
Removed from v.1.16  
changed lines
  Added in v.1.17

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2