(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.15 and 1.16

version 1.15, 2003/03/19 21:46:25 version 1.16, 2003/08/06 14:08:48
Line 46 
Line 46 
 #define inline #define inline
 #endif #endif
  
   
   //**********************************************************
   /*  Encode thanslates one six-bit pattern into a base-64 character.
       Unsigned char is used to represent a six-bit stream of date.
   
   */
   inline PEGASUS_COMMON_LINKAGE char Base64::_Encode(Uint8 uc)
   {
       if (uc < 26)
           return 'A'+uc;
   
       if (uc < 52)
           return 'a'+(uc-26);
   
       if (uc < 62)
           return '0'+(uc-52);
   
       if (uc == 62)
           return '+';
   
       return '/';
   };
   
    //Helper function returns true is a character is a valid base-64 character and false otherwise.
   
   inline Boolean Base64::_IsBase64(char c)
   {
   
       if (c >= 'A' && c <= 'Z')
           return true;
   
       if (c >= 'a' && c <= 'z')
           return true;
   
       if (c >= '0' && c <= '9')
           return true;
   
       if (c == '+')
           return true;
   
       if (c == '/')
           return true;
   
       if (c == '=')
           return true;
   
       return false;
   };
   
    // Translate one base-64 character into a six bit pattern
   inline Uint8 Base64::_Decode(char c)
   {
       if (c >= 'A' && c <= 'Z')
           return c - 'A';
       if (c >= 'a' && c <= 'z')
           return c - 'a' + 26;
   
       if (c >= '0' && c <= '9')
           return c - '0' + 52;
   
       if (c == '+')
           return 62;
   
       return 63;
   };
   
   
 //************************************************************* //*************************************************************
 /*  Encode static method takes an array of 8-bit values and /*  Encode static method takes an array of 8-bit values and
     returns a base-64 stream.     returns a base-64 stream.
Line 189 
Line 256 
     return retArray;     return retArray;
 }; };
  
 //**********************************************************  
 /*  Encode thanslates one six-bit pattern into a base-64 character.  
     Unsigned char is used to represent a six-bit stream of date.  
   
 */  
 inline PEGASUS_COMMON_LINKAGE char Base64::_Encode(Uint8 uc)  
 {  
     if (uc < 26)  
         return 'A'+uc;  
   
     if (uc < 52)  
         return 'a'+(uc-26);  
   
     if (uc < 62)  
         return '0'+(uc-52);  
   
     if (uc == 62)  
         return '+';  
   
     return '/';  
 };  
   
  //Helper function returns true is a character is a valid base-64 character and false otherwise.  
   
 inline Boolean Base64::_IsBase64(char c)  
 {  
   
     if (c >= 'A' && c <= 'Z')  
         return true;  
   
     if (c >= 'a' && c <= 'z')  
         return true;  
   
     if (c >= '0' && c <= '9')  
         return true;  
   
     if (c == '+')  
         return true;  
   
     if (c == '/')  
         return true;  
   
     if (c == '=')  
         return true;  
   
     return false;  
 };  
   
  // Translate one base-64 character into a six bit pattern  
 inline Uint8 Base64::_Decode(char c)  
 {  
     if (c >= 'A' && c <= 'Z')  
         return c - 'A';  
     if (c >= 'a' && c <= 'z')  
         return c - 'a' + 26;  
   
     if (c >= '0' && c <= '9')  
         return c - '0' + 52;  
   
     if (c == '+')  
         return 62;  
   
     return 63;  
 };  
   
   
 PEGASUS_NAMESPACE_END PEGASUS_NAMESPACE_END


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

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2