1
0
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:
Konstantin
2023-04-16 20:42:56 +03:00
parent 0d35606a44
commit 7a5775a9f9
135 changed files with 552 additions and 585 deletions

View File

@@ -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