本文整理汇总了C++中lliopipe::buffer_ptr_t::countAfter方法的典型用法代码示例。如果您正苦于以下问题:C++ buffer_ptr_t::countAfter方法的具体用法?C++ buffer_ptr_t::countAfter怎么用?C++ buffer_ptr_t::countAfter使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类lliopipe::buffer_ptr_t
的用法示例。
在下文中一共展示了buffer_ptr_t::countAfter方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: completedRaw
void completedRaw(
const LLChannelDescriptors& channels,
const LLIOPipe::buffer_ptr_t& buffer)
{
completedHeader();
if (!isGoodStatus())
{
if (getStatus() == HTTP_NOT_MODIFIED)
{
LL_INFOS("fsdata") << "Got [304] not modified for " << mURL << LL_ENDL;
}
else
{
LL_WARNS("fsdata") << "Error fetching " << mURL << " Status: [" << getStatus() << "]" << LL_ENDL;
}
return;
}
S32 data_size = buffer->countAfter(channels.in(), NULL);
if (data_size <= 0)
{
LL_WARNS("fsdata") << "Received zero data for " << mURL << LL_ENDL;
return;
}
U8* data = new U8[data_size];
buffer->readAfter(channels.in(), NULL, data, data_size);
// basic check for valid data received
LLXMLNodePtr xml_root;
if ( (!LLXMLNode::parseBuffer(data, data_size, xml_root, NULL)) || (xml_root.isNull()) || (!xml_root->hasName("script_library")) )
{
LL_WARNS("fsdata") << "Could not read the script library data from "<< mURL << LL_ENDL;
delete[] data;
data = NULL;
return;
}
LLAPRFile outfile ;
outfile.open(mFilename, LL_APR_WB);
if (!outfile.getFileHandle())
{
LL_WARNS("fsdata") << "Unable to open file for writing: " << mFilename << LL_ENDL;
}
else
{
LL_INFOS("fsdata") << "Saving " << mFilename << LL_ENDL;
outfile.write(data, data_size);
outfile.close() ;
}
delete[] data;
data = NULL;
}