StringToHex.cpp File Reference

Go to the source code of this file.

Functions

 FENNEL_BEGIN_CPPFILE ("$Id: //open/dev/fennel/calculator/StringToHex.cpp#2 $")
string stringToHex (char const *const buf)
string stringToHex (string const &s)
string stringToHex (char const *const buf, uint buflen)
 FENNEL_END_CPPFILE ("$Id: //open/dev/fennel/calculator/StringToHex.cpp#2 $")


Function Documentation

FENNEL_BEGIN_CPPFILE ( "$Id: //open/dev/fennel/calculator/StringToHex.cpp#2 $"   ) 

FENNEL_END_CPPFILE ( "$Id: //open/dev/fennel/calculator/StringToHex.cpp#2 $"   ) 

string 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 stringToHex ( string const &  s  ) 

Definition at line 45 of file StringToHex.cpp.

00046 {
00047     return stringToHex(s.c_str());
00048 }

string stringToHex ( char const *const  buf  ) 

Definition at line 37 of file StringToHex.cpp.

Referenced by stringToHex(), CalcInstFactoryTest::testBoolPointer(), CalcMiscTest::testCalcContinueOnException(), CalcExtCastTest::testCalcExtCastCharToBoolean(), CalcExtCastTest::testCalcExtCastCharToDecimal(), CalcExtCastTest::testCalcExtCastCharToExact(), CalcExtCastTest::testCalcExtCastStringToApprox(), CalcExtCastTest::testCalcExtCastStringToChar(), CalcExtCastTest::testCalcExtCastStringToDecimalFails(), CalcExtCastTest::testCalcExtCastStringToDecimalMinMax(), CalcExtCastTest::testCalcExtCastStringToDecimalRange(), CalcExtCastTest::testCalcExtCastStringToExactFails(), CalcExtCastTest::testCalcExtCastStringToVarChar(), CalcExtCastTest::testCalcExtCastVarCharToBoolean(), CalcExtCastTest::testCalcExtCastVarCharToDecimal(), CalcExtCastTest::testCalcExtCastVarCharToExact(), CalcExtRegExpTest::testCalcExtRegExpLikeAChar(), CalcExtRegExpTest::testCalcExtRegExpLikeAVarChar(), CalcExtRegExpTest::testCalcExtRegExpSimilarAChar(), CalcExtRegExpTest::testCalcExtRegExpSimilarAVarChar(), CalcExtStringTest::testCalcExtStringCatA2(), CalcExtStringTest::testCalcExtStringCatA3(), CalcExtStringTest::testCalcExtStringCmpA(), CalcExtStringTest::testCalcExtStringLenBitA(), CalcExtStringTest::testCalcExtStringLenCharA(), CalcExtStringTest::testCalcExtStringLenOctA(), CalcExtStringTest::testCalcExtStringOverlayA4(), CalcExtStringTest::testCalcExtStringOverlayA5(), CalcExtStringTest::testCalcExtStringPosA(), CalcExtStringTest::testCalcExtStringSubStringA3(), CalcExtStringTest::testCalcExtStringSubStringA4(), CalcExtStringTest::testCalcExtStringToANull(), CalcExtStringTest::testCalcExtStringToLower(), CalcExtStringTest::testCalcExtStringToUpper(), CalcExtStringTest::testCalcExtStringTrim(), CalcMiscTest::testCalcRaise(), CalcMiscTest::testCalcRefInst(), CalcInstFactoryTest::testIntegralPointer(), CalcAssemblerTest::testLiteralBinding(), CalcInstFactoryTest::testPointerIntegral(), CalcInstFactoryTest::testPointerPointer(), and CalcAssemblerTestCase::toLiteralString().

00038 {
00039     assert(buf != NULL);
00040     uint buflen = strlen(buf);
00041     return stringToHex(buf, buflen);
00042 }


Generated on Mon Jun 22 04:00:22 2009 for Fennel by  doxygen 1.5.1