本文整理汇总了C++中StringBuilder::appendString方法的典型用法代码示例。如果您正苦于以下问题:C++ StringBuilder::appendString方法的具体用法?C++ StringBuilder::appendString怎么用?C++ StringBuilder::appendString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类StringBuilder
的用法示例。
在下文中一共展示了StringBuilder::appendString方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: doTree
void DotBuilder::doTree(ASTElement* tree)
{
_sb.appendString("digraph G {\n");
_sb.appendString(" node [shape=record];\n");
doElement(tree);
_sb.appendString("}\n");
}
示例2: doCall
void DotBuilder::doCall(ASTCall* element)
{
const Vector<ASTElement*>& arguments = element->getArguments();
size_t i, len = arguments.getLength();
size_t celter = len / 2;
_sb.appendFormat(" N_%u [label=\"", element->getElementId());
_sb.appendFormat("<F0>%s", Hash<Function>::dataToKey(element->getFunction()));
for (i = 0; i < len; i++)
{
_sb.appendFormat("<A%u>", (unsigned int)i);
}
_sb.appendString("\"];\n");
for (i = 0; i < len; i++)
{
_sb.appendFormat(" N_%u:A%u -> N_%u:F0;\n",
element->getElementId(),
(unsigned int)i,
arguments[i]->getElementId());
}
for (i = 0; i < len; i++)
{
doElement(arguments[i]);
}
}
示例3: run
virtual bool run(void* _func, StringBuilder& result, StringBuilder& expected)
{
typedef void (*Func)(uint32_t*, const uint32_t*, size_t);
Func func = asmjit_cast<Func>(_func);
enum { kBufferSize = 32 };
uint32_t dstBuffer[kBufferSize];
uint32_t srcBuffer[kBufferSize];
uint i;
for (i = 0; i < kBufferSize; i++)
{
dstBuffer[i] = 0;
srcBuffer[i] = i;
}
func(dstBuffer, srcBuffer, kBufferSize);
result.setString("buf={");
expected.setString("buf={");
for (i = 0; i < kBufferSize; i++)
{
if (i != 0)
{
result.appendString(", ");
expected.appendString(", ");
}
result.appendFormat("%u", static_cast<uint>(dstBuffer[i]));
expected.appendFormat("%u", static_cast<uint>(srcBuffer[i]));
}
result.appendString("}");
expected.appendString("}");
return memcmp(dstBuffer, srcBuffer, kBufferSize * sizeof(uint32_t)) == 0;
}