本文整理汇总了C++中Manifest::getVersion方法的典型用法代码示例。如果您正苦于以下问题:C++ Manifest::getVersion方法的具体用法?C++ Manifest::getVersion怎么用?C++ Manifest::getVersion使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Manifest
的用法示例。
在下文中一共展示了Manifest::getVersion方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: loadLocalManifest
void AssetsManagerEx::loadLocalManifest(const std::string& manifestUrl)
{
Manifest *cachedManifest = nullptr;
// Find the cached manifest file
if (_fileUtils->isFileExist(_cacheManifestPath))
{
cachedManifest = new (std::nothrow) Manifest();
if (cachedManifest) {
cachedManifest->parse(_cacheManifestPath);
if (!cachedManifest->isLoaded())
{
_fileUtils->removeFile(_cacheManifestPath);
CC_SAFE_RELEASE(cachedManifest);
cachedManifest = nullptr;
}
}
}
// Load local manifest in app package
_localManifest->parse(_manifestUrl);
if (_localManifest->isLoaded())
{
// Compare with cached manifest to determine which one to use
if (cachedManifest) {
if (strcmp(_localManifest->getVersion().c_str(), cachedManifest->getVersion().c_str()) > 0)
{
// Recreate storage, to empty the content
_fileUtils->removeDirectory(_storagePath);
_fileUtils->createDirectory(_storagePath);
CC_SAFE_RELEASE(cachedManifest);
}
else
{
CC_SAFE_RELEASE(_localManifest);
_localManifest = cachedManifest;
}
}
prepareLocalManifest();
}
// Fail to load local manifest
if (!_localManifest->isLoaded())
{
CCLOG("AssetsManagerEx : No local manifest file found error.\n");
dispatchUpdateEvent(EventAssetsManagerEx::EventCode::ERROR_NO_LOCAL_MANIFEST);
}
}