コード例 #1
0
bool DownloadManager::_getAssociatedFileSha1Sum(wstring sha1_url, wstring sha1_file, Sha1Sum &sha1sum)
{	
	DownloadInet inetacccess;
	bool bRslt;

	sha1_file += SHA1_EXTENSION;	
	bRslt = inetacccess.GetFile((wchar_t *)sha1_url.c_str(), (wchar_t *)sha1_file.c_str(), NULL, NULL);
	g_log.Log(L"DownloadManager::_getAssociatedFileSha1Sum '%s' is %u", (wchar_t *) sha1_url.c_str(), (wchar_t *) bRslt);

	sha1sum.SetFile(sha1_file);
	sha1sum.ReadFromFile();
	DeleteFile(sha1_file.c_str());
	return sha1sum.GetSum().empty() == false;
}
コード例 #2
0
bool Sha1Sum::operator==(Sha1Sum& other)
{
	wstring s1, s2;
	s1 = this->GetSum();
	s2 = other.GetSum();

	return s1 == s2;
}