本文整理汇总了C++中Text::add方法的典型用法代码示例。如果您正苦于以下问题:C++ Text::add方法的具体用法?C++ Text::add怎么用?C++ Text::add使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Text
的用法示例。
在下文中一共展示了Text::add方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: asText
Text TextArray::asText() const throw()
{
Text result = "[\"";
const int length = this->length();
for (int i = 0; i < length - 1; ++i)
{
result.add (this->at (i));
result.add ("\", ");
}
result.add (this->at (length - 1));
result.add ("\"]");
return result;
}
示例2: readAll
Text TextFileInternal::readAll() throw()
{
Text buffer (Text::emptyWithAllocatedSize (512));
ResultCode result = PlankResult_OK;
int bytesRead;
char temp[17];
while (result == PlankResult_OK)
{
result = pl_File_Read (getPeerRef(), temp, 16, &bytesRead);
temp[bytesRead] = '\0';
buffer.add (temp);
}
return buffer;
}
示例3: read
Text TextFileInternal::read (const int numBytes) throw()
{
Text buffer (Text::emptyWithAllocatedSize (numBytes));
ResultCode result = PlankResult_OK;
int bytesRead, bytesRemaining, bytesThisTime;
char temp[17];
bytesRemaining = numBytes;
while ((result == PlankResult_OK) && (bytesRemaining > 0))
{
bytesThisTime = plonk::min (bytesRemaining, 16);
result = pl_File_Read (getPeerRef(), temp, bytesThisTime, &bytesRead);
temp[bytesRead] = '\0';
buffer.add (temp);
bytesRemaining -= bytesRead;
}
return buffer;
}