本文整理汇总了C++中Data::ChildWithValue方法的典型用法代码示例。如果您正苦于以下问题:C++ Data::ChildWithValue方法的具体用法?C++ Data::ChildWithValue怎么用?C++ Data::ChildWithValue使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Data
的用法示例。
在下文中一共展示了Data::ChildWithValue方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: MakeDepFileName
std::shared_ptr<DependencyValidation> Store::MakeDependencyValidation(const ResChar intermediateFileName[]) const
{
// When we process a file, we write a little text file to the
// ".deps" directory. This contains a list of dependency files, and
// the state of those files when this file was compiled.
// If the current files don't match the state that's recorded in
// the .deps file, then we can assume that it is out of date and
// must be recompiled.
ResChar buffer[MaxPath];
MakeDepFileName(buffer, _baseDirectory.c_str(), intermediateFileName);
if (!DoesFileExist(buffer)) return nullptr;
Data data;
data.LoadFromFile(buffer);
auto* basePath = data.StrAttribute("BasePath");
auto validation = std::make_shared<DependencyValidation>();
auto* dependenciesBlock = data.ChildWithValue("Dependencies");
if (dependenciesBlock) {
for (auto* dependency = dependenciesBlock->child; dependency; dependency = dependency->next) {
auto* depName = dependency->value;
if (!depName || !depName[0]) continue;
auto dateLow = (unsigned)dependency->IntAttribute("ModTimeL");
auto dateHigh = (unsigned)dependency->IntAttribute("ModTimeH");
std::shared_ptr<RetainedFileRecord> record;
if (basePath && basePath[0]) {
XlConcatPath(buffer, dimof(buffer), basePath, depName, XlStringEnd(depName));
record = GetRetainedFileRecord(buffer);
} else
record = GetRetainedFileRecord(depName);
RegisterAssetDependency(validation, record);
if (record->_state._status == DependentFileState::Status::Shadowed) {
LogInfo << "Asset (" << intermediateFileName << ") is invalidated because dependency (" << depName << ") is marked shadowed";
return nullptr;
}
if (!record->_state._timeMarker) {
LogInfo
<< "Asset (" << intermediateFileName
<< ") is invalidated because of missing dependency (" << depName << ")";
return nullptr;
} else if (record->_state._timeMarker != ((uint64(dateHigh) << 32ull) | uint64(dateLow))) {
LogInfo
<< "Asset (" << intermediateFileName
<< ") is invalidated because of file data on dependency (" << depName << ")";
return nullptr;
}
}
}
return validation;
}