本文整理汇总了C++中sid::String::getHexRepresentation方法的典型用法代码示例。如果您正苦于以下问题:C++ String::getHexRepresentation方法的具体用法?C++ String::getHexRepresentation怎么用?C++ String::getHexRepresentation使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类sid::String
的用法示例。
在下文中一共展示了String::getHexRepresentation方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: checkHexRepresentation
void checkHexRepresentation(const Sid::String& test, const Sid::String& expected)
{
const char* origData = test.data();
Sid::String res = test.getHexRepresentation();
CPPUNIT_ASSERT_PRINTF(res == expected,
"getHexRepresentation() yielded unexpected result for value "
"\"%s\", should have been \"%s\", instead got \"%s\"\n",
test.isNull() ? "(NULL)" : test.data(),
expected.isNull() ? "(NULL)" : expected.data(),
res.isNull() ? "(NULL)" : res.data());
CPPUNIT_ASSERT_MESSAGE("getHexRepresentation() causes object to relinquish its reference!",
origData == test.data());
}
示例2: checkToBinary
void checkToBinary(const Sid::String& test, const char* expected, size_t expectedSize, const Sid::String& hex)
{
const char* origData = test.data();
checkToBinary(test, expected, expectedSize);
Sid::String expHex(hex);
Sid::String resHex = test.getHexRepresentation();
CPPUNIT_ASSERT_PRINTF(expHex == resHex,
"getHexRepresentation() yielded unexpected "
"result:\n"
"\"%s\" (expected)\n"
"\"%s\" (result)\n",
expHex.isNull() ? "(NULL)" : expHex.data(),
resHex.isNull() ? "(NULL)" : resHex.data());
CPPUNIT_ASSERT_MESSAGE("toBinary() causes object to relinquish its reference!",
origData == test.data());
}