Botan  1.11.15
Functions
Botan::Charset Namespace Reference

Functions

bool caseless_cmp (char a, char b)
byte char2digit (char c)
char digit2char (byte b)
bool is_digit (char c)
bool is_space (char c)
std::string transcode (const std::string &str, Character_Set to, Character_Set from)

Function Documentation

bool BOTAN_DLL Botan::Charset::caseless_cmp ( char  a,
char  b 
)

Definition at line 193 of file charset.cpp.

Referenced by Botan::x500_name_cmp().

   {
   return (std::tolower(static_cast<unsigned char>(a)) ==
           std::tolower(static_cast<unsigned char>(b)));
   }
byte BOTAN_DLL Botan::Charset::char2digit ( char  c)

Definition at line 149 of file charset.cpp.

Referenced by Botan::BigInt::decode().

   {
   switch(c)
      {
      case '0': return 0;
      case '1': return 1;
      case '2': return 2;
      case '3': return 3;
      case '4': return 4;
      case '5': return 5;
      case '6': return 6;
      case '7': return 7;
      case '8': return 8;
      case '9': return 9;
      }

   throw Invalid_Argument("char2digit: Input is not a digit character");
   }
char BOTAN_DLL Botan::Charset::digit2char ( byte  b)

Definition at line 171 of file charset.cpp.

Referenced by Botan::BigInt::encode().

   {
   switch(b)
      {
      case 0: return '0';
      case 1: return '1';
      case 2: return '2';
      case 3: return '3';
      case 4: return '4';
      case 5: return '5';
      case 6: return '6';
      case 7: return '7';
      case 8: return '8';
      case 9: return '9';
      }

   throw Invalid_Argument("digit2char: Input is not a digit");
   }
bool BOTAN_DLL Botan::Charset::is_digit ( char  c)

Definition at line 128 of file charset.cpp.

Referenced by Botan::BigInt::decode(), Botan::X509_Time::set_to(), Botan::EAC_Time::set_to(), and Botan::timespec_to_u32bit().

   {
   if(c == '0' || c == '1' || c == '2' || c == '3' || c == '4' ||
      c == '5' || c == '6' || c == '7' || c == '8' || c == '9')
      return true;
   return false;
   }
bool BOTAN_DLL Botan::Charset::is_space ( char  c)

Definition at line 139 of file charset.cpp.

Referenced by Botan::BigInt::decode(), Botan::PGP_decode(), and Botan::x500_name_cmp().

   {
   if(c == ' ' || c == '\t' || c == '\n' || c == '\r')
      return true;
   return false;
   }
std::string BOTAN_DLL Botan::Charset::transcode ( const std::string &  str,
Character_Set  to,
Character_Set  from 
)