Go to the source code of this file.
Functions | |
string FENNEL_CALCULATOR_EXPORT | stringToHex (char const *const buf) |
string FENNEL_CALCULATOR_EXPORT | stringToHex (string const &s) |
string FENNEL_CALCULATOR_EXPORT | stringToHex (char const *const buf, uint buflen) |
string FENNEL_CALCULATOR_EXPORT stringToHex | ( | char const *const | buf, | |
uint | buflen | |||
) |
Definition at line 51 of file StringToHex.cpp.
00052 { 00053 assert(buf != NULL); 00054 ostringstream ostr; 00055 for (uint i = 0; i < buflen; i++) { 00056 unsigned char ch = (unsigned char) buf[i]; 00057 ostr << hex << setw(2) << setfill('0') << (uint) ch; 00058 } 00059 return ostr.str(); 00060 }
string FENNEL_CALCULATOR_EXPORT stringToHex | ( | string const & | s | ) |
Definition at line 45 of file StringToHex.cpp.
References stringToHex().
00046 { 00047 return stringToHex(s.c_str()); 00048 }
string FENNEL_CALCULATOR_EXPORT stringToHex | ( | char const *const | buf | ) |
Definition at line 37 of file StringToHex.cpp.
References stringToHex().
00038 { 00039 assert(buf != NULL); 00040 uint buflen = strlen(buf); 00041 return stringToHex(buf, buflen); 00042 }