本文整理汇总了C++中CFile::IsIncomplete方法的典型用法代码示例。如果您正苦于以下问题:C++ CFile::IsIncomplete方法的具体用法?C++ CFile::IsIncomplete怎么用?C++ CFile::IsIncomplete使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CFile
的用法示例。
在下文中一共展示了CFile::IsIncomplete方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: AddTorrentFromFile
bool CTorrent::AddTorrentFromFile(const QByteArray& Torrent)
{
CFile* pFile = GetFile();
m_TorrentInfo = new CTorrentInfo(this);
if(!m_TorrentInfo->LoadTorrentFile(Torrent))
return false;
// Privat etorrents should only be shared on the torrent network
// Note: we overwrite any user choices except the file is completed than the use has all liberties
if(pFile->IsIncomplete() && m_TorrentInfo->IsPrivate())
pFile->SetProperty("Torrent", 2);
if(!pFile->IsPending())
SaveTorrentToFile();
pFile->SetFileSize(m_TorrentInfo->GetTotalLength());
LoadPieceHashes();
theCore->m_TorrentManager->RegisterInfoHash(m_TorrentInfo->GetInfoHash());
pFile->SetMasterHash(m_pHash);
pFile->SetFileName(m_TorrentInfo->GetTorrentName());
pFile->SetProperty("Description", m_TorrentInfo->GetProperty("Description"));
SetupPartMap();
return true;
}
示例2: InstallMetadata
bool CTorrent::InstallMetadata()
{
CFile* pFile = GetFile();
ASSERT(m_TorrentInfo);
CPartMap* pPartMap = pFile->GetPartMap();
if(pPartMap && !CompareSubFiles(pPartMap))
{
if(pFile->GetInspector()->BadMetaData(GetHash()))
pPartMap = NULL;
else
return false;
}
if(m_pHash->Compare(pFile->GetMasterHash().data()))
pFile->SetFileName(m_TorrentInfo->GetTorrentName());
bool bOpenIO = false;
CJoinedPartMap* pJoinedParts = qobject_cast<CJoinedPartMap*>(pPartMap);
if((pPartMap == NULL && !pFile->IsComplete()) || (pJoinedParts && pJoinedParts->GetLinks().isEmpty()))
{
bOpenIO = true;
if(!pPartMap)
pFile->SetFileSize(m_TorrentInfo->GetTotalLength());
SetupPartMap();
if(!pPartMap && !pFile->IsPending())
pFile->SetFilePath();
}
LoadPieceHashes();
if(pFile->IsIncomplete() && pFile->GetMasterHash()->GetType() == HashTorrent)
pFile->CleanUpHashes();
// Note: if neo is the masterhash the IO is already opened
if(bOpenIO && !pFile->IsPending())
pFile->Resume();
return true;
}