mirror of
https://github.com/vcmi/vcmi.git
synced 2025-11-25 22:42:04 +02:00
vcmi: use std::optional
This commit is contained in:
@@ -39,7 +39,7 @@ std::string CMappedFileLoader::getMountPoint() const
|
||||
return ""; // does not have any meaning with this type of data source
|
||||
}
|
||||
|
||||
boost::optional<boost::filesystem::path> CMappedFileLoader::getResourceName(const ResourceID & resourceName) const
|
||||
std::optional<boost::filesystem::path> CMappedFileLoader::getResourceName(const ResourceID & resourceName) const
|
||||
{
|
||||
return CResourceHandler::get()->getResourceName(fileList.at(resourceName));
|
||||
}
|
||||
@@ -90,11 +90,11 @@ std::string CFilesystemList::getMountPoint() const
|
||||
return "";
|
||||
}
|
||||
|
||||
boost::optional<boost::filesystem::path> CFilesystemList::getResourceName(const ResourceID & resourceName) const
|
||||
std::optional<boost::filesystem::path> CFilesystemList::getResourceName(const ResourceID & resourceName) const
|
||||
{
|
||||
if (existsResource(resourceName))
|
||||
return getResourcesWithName(resourceName).back()->getResourceName(resourceName);
|
||||
return boost::optional<boost::filesystem::path>();
|
||||
return std::optional<boost::filesystem::path>();
|
||||
}
|
||||
|
||||
std::set<boost::filesystem::path> CFilesystemList::getResourceNames(const ResourceID & resourceName) const
|
||||
|
||||
Reference in New Issue
Block a user