本文整理汇总了C++中CKnownFile::SetAICHRecoverHashSetAvailable方法的典型用法代码示例。如果您正苦于以下问题:C++ CKnownFile::SetAICHRecoverHashSetAvailable方法的具体用法?C++ CKnownFile::SetAICHRecoverHashSetAvailable怎么用?C++ CKnownFile::SetAICHRecoverHashSetAvailable使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CKnownFile
的用法示例。
在下文中一共展示了CKnownFile::SetAICHRecoverHashSetAvailable方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Run
//.........这里部分代码省略.........
error2->Delete();
}
}
else{
TCHAR buffer[MAX_CFEXP_ERRORMSG];
error->GetErrorMessage(buffer, ARRSIZE(buffer));
LogError(LOG_STATUSBAR,GetResString(IDS_ERR_SERVERMET_UNKNOWN),buffer);
}
error->Delete();
return false;
}
// now we check that all files which are in the sharedfilelist have a corresponding hash in out list
// those who don'T are added to the hashinglist
CList<CAICHHash> liUsedHashs;
CSingleLock sharelock(&theApp.sharedfiles->m_mutWriteList);
sharelock.Lock();
bool bDbgMsgCreatingPartHashs = true;
for (int i = 0; i < theApp.sharedfiles->GetCount(); i++){
CKnownFile* pCurFile = theApp.sharedfiles->GetFileByIndex(i);
if (pCurFile != NULL && !pCurFile->IsPartFile() )
{
if (theApp.emuledlg==NULL || !theApp.emuledlg->IsRunning()) // in case of shutdown while still hashing
return 0;
if (pCurFile->GetFileIdentifier().HasAICHHash()){
bool bFound = false;
for (POSITION pos = liKnown2Hashs.GetHeadPosition();pos != 0;)
{
CAICHHash current_hash = liKnown2Hashs.GetNext(pos);
if (current_hash == pCurFile->GetFileIdentifier().GetAICHHash()){
bFound = true;
liUsedHashs.AddTail(current_hash);
pCurFile->SetAICHRecoverHashSetAvailable(true);
// Has the file the proper AICH Parthashset? If not probably upgrading, create it
if (!pCurFile->GetFileIdentifier().HasExpectedAICHHashCount())
{
if (bDbgMsgCreatingPartHashs)
{
bDbgMsgCreatingPartHashs = false;
DebugLogWarning(_T("Missing AICH Part Hashsets for known files - maybe upgrading from earlier version. Creating them out of full AICH Recovery Hashsets, shouldn't take too long"));
}
CAICHRecoveryHashSet tempHashSet(pCurFile, pCurFile->GetFileSize());
tempHashSet.SetMasterHash(pCurFile->GetFileIdentifier().GetAICHHash(), AICH_HASHSETCOMPLETE);
if (!tempHashSet.LoadHashSet())
{
ASSERT( false );
DebugLogError(_T("Failed to load full AICH Recovery Hashset - known2.met might be corrupt. Unable to create AICH Part Hashset - %s"), pCurFile->GetFileName());
}
else
{
if (!pCurFile->GetFileIdentifier().SetAICHHashSet(tempHashSet))
{
DebugLogError(_T("Failed to create AICH Part Hashset out of full AICH Recovery Hashset - %s"), pCurFile->GetFileName());
ASSERT( false );
}
ASSERT(pCurFile->GetFileIdentifier().HasExpectedAICHHashCount());
}
}
//theApp.QueueDebugLogLine(false, _T("%s - %s"), current_hash.GetString(), pCurFile->GetFileName());
/*#ifdef _DEBUG
// in debugmode we load and verify all hashsets
CAICHRecoveryHashSet* pTempHashSet = new CAICHRecoveryHashSet(pCurFile);
pTempHashSet->SetFileSize(pCurFile->GetFileSize());
pTempHashSet->SetMasterHash(pCurFile->GetFileIdentifier().GetAICHHash(), AICH_HASHSETCOMPLETE)
ASSERT( pTempHashSet->LoadHashSet() );