本文整理汇总了C++中Message::AddInt64方法的典型用法代码示例。如果您正苦于以下问题:C++ Message::AddInt64方法的具体用法?C++ Message::AddInt64怎么用?C++ Message::AddInt64使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Message
的用法示例。
在下文中一共展示了Message::AddInt64方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ReadZipFileAux
static status_t ReadZipFileAux(zipFile zf, Message & msg, char * nameBuf, uint32 nameBufLen, bool loadData)
{
while(unzOpenCurrentFile(zf) == UNZ_OK)
{
unz_file_info fileInfo;
if (unzGetCurrentFileInfo(zf, &fileInfo, nameBuf, nameBufLen, NULL, 0, NULL, 0) != UNZ_OK) return B_ERROR;
// Add the new entry to the appropriate spot in the tree (demand-allocate sub-Messages as necessary)
{
const char * nulByte = strchr(nameBuf, '\0');
const bool isFolder = ((nulByte > nameBuf)&&(*(nulByte-1) == '/'));
Message * m = &msg;
StringTokenizer tok(true, nameBuf, "/");
const char * nextTok;
while((nextTok = tok()) != NULL)
{
String fn(nextTok);
if ((isFolder)||(tok.GetRemainderOfString()))
{
// Demand-allocate a sub-message
MessageRef subMsg;
if (m->FindMessage(fn, subMsg) != B_NO_ERROR)
{
if ((m->AddMessage(fn, Message()) != B_NO_ERROR)||(m->FindMessage(fn, subMsg) != B_NO_ERROR)) return B_ERROR;
}
m = subMsg();
}
else
{
if (loadData)
{
ByteBufferRef bufRef = GetByteBufferFromPool((uint32) fileInfo.uncompressed_size);
if ((bufRef() == NULL)||(unzReadCurrentFile(zf, bufRef()->GetBuffer(), bufRef()->GetNumBytes()) != (int32)bufRef()->GetNumBytes())||(m->AddFlat(fn, bufRef) != B_NO_ERROR)) return B_ERROR;
}
else if (m->AddInt64(fn, fileInfo.uncompressed_size) != B_NO_ERROR) return B_ERROR;
}
}
}
if (unzCloseCurrentFile(zf) != UNZ_OK) return B_ERROR;
if (unzGoToNextFile(zf) != UNZ_OK) break;
}
return B_NO_ERROR;
}