1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-01-04 02:41:19 +00:00

Make VFS::Path::Normalized constructor from std::string_view explicit

This commit is contained in:
elsid 2024-03-01 14:10:25 +01:00
parent a63528343d
commit 84adb0a148
No known key found for this signature in database
GPG Key ID: 4DE04C198CBA7625
3 changed files with 4 additions and 3 deletions

View File

@ -328,7 +328,8 @@ namespace MWLua
},
[](const sol::object&) -> sol::object { return sol::nil; });
api["fileExists"] = [vfs](std::string_view fileName) -> bool { return vfs->exists(fileName); };
api["fileExists"]
= [vfs](std::string_view fileName) -> bool { return vfs->exists(VFS::Path::Normalized(fileName)); };
api["pathsWithPrefix"] = [vfs](std::string_view prefix) {
auto iterator = vfs->getRecursiveDirectoryIterator(prefix);
return sol::as_function([iterator, current = iterator.begin()]() mutable -> sol::optional<std::string> {

View File

@ -29,7 +29,7 @@ namespace Resource
static bool collectStatUpdate = false;
static bool collectStatEngine = false;
constexpr std::string_view sFontName = "Fonts/DejaVuLGCSansMono.ttf";
static const VFS::Path::Normalized sFontName("Fonts/DejaVuLGCSansMono.ttf");
static void setupStatCollection()
{

View File

@ -130,7 +130,7 @@ namespace VFS::Path
public:
Normalized() = default;
Normalized(std::string_view value)
explicit Normalized(std::string_view value)
: mValue(normalizeFilename(value))
{
}