本文整理汇总了C++中PathName::Empty方法的典型用法代码示例。如果您正苦于以下问题:C++ PathName::Empty方法的具体用法?C++ PathName::Empty怎么用?C++ PathName::Empty使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PathName
的用法示例。
在下文中一共展示了PathName::Empty方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: TryVerifyInstalledPackage
bool PackageManagerImpl::TryVerifyInstalledPackage(const string& packageId)
{
PackageInfo packageInfo = GetPackageInfo(packageId);
PathName prefix;
if (!session->IsAdminMode() && IsValidTimeT(packageInfo.timeInstalledByUser))
{
prefix = session->GetSpecialPath(SpecialPath::UserInstallRoot);
}
if (prefix.Empty())
{
prefix = session->GetSpecialPath(SpecialPath::CommonInstallRoot);
}
FileDigestTable fileDigests;
if (!TryCollectFileDigests(prefix, packageInfo.runFiles, fileDigests)
|| !TryCollectFileDigests(prefix, packageInfo.docFiles, fileDigests)
|| !TryCollectFileDigests(prefix, packageInfo.sourceFiles, fileDigests))
{
return false;
}
MD5Builder md5Builder;
for (const pair<string, MD5> p : fileDigests)
{
PathName path(p.first);
// we must dosify the path name for backward compatibility
path.ConvertToDos();
md5Builder.Update(path.GetData(), path.GetLength());
md5Builder.Update(p.second.data(), p.second.size());
}
bool ok = md5Builder.Final() == packageInfo.digest;
if (!ok)
{
trace_mpm->WriteLine(TRACE_FACILITY, fmt::format(T_("package {0} verification failed: some files have been modified"), Q_(packageId)));
trace_mpm->WriteLine(TRACE_FACILITY, fmt::format(T_("expected digest: {0}"), packageInfo.digest));
trace_mpm->WriteLine(TRACE_FACILITY, fmt::format(T_("computed digest: {0}"), md5Builder.GetMD5()));
}
return ok;
}