mirror of
https://github.com/OpenMW/openmw.git
synced 2025-04-01 10:36:39 +00:00
Make VFS::Path::Normalized constructor from std::string_view explicit
This commit is contained in:
parent
a63528343d
commit
84adb0a148
3 changed files with 4 additions and 3 deletions
|
@ -328,7 +328,8 @@ namespace MWLua
|
||||||
},
|
},
|
||||||
[](const sol::object&) -> sol::object { return sol::nil; });
|
[](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) {
|
api["pathsWithPrefix"] = [vfs](std::string_view prefix) {
|
||||||
auto iterator = vfs->getRecursiveDirectoryIterator(prefix);
|
auto iterator = vfs->getRecursiveDirectoryIterator(prefix);
|
||||||
return sol::as_function([iterator, current = iterator.begin()]() mutable -> sol::optional<std::string> {
|
return sol::as_function([iterator, current = iterator.begin()]() mutable -> sol::optional<std::string> {
|
||||||
|
|
|
@ -29,7 +29,7 @@ namespace Resource
|
||||||
static bool collectStatUpdate = false;
|
static bool collectStatUpdate = false;
|
||||||
static bool collectStatEngine = 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()
|
static void setupStatCollection()
|
||||||
{
|
{
|
||||||
|
|
|
@ -130,7 +130,7 @@ namespace VFS::Path
|
||||||
public:
|
public:
|
||||||
Normalized() = default;
|
Normalized() = default;
|
||||||
|
|
||||||
Normalized(std::string_view value)
|
explicit Normalized(std::string_view value)
|
||||||
: mValue(normalizeFilename(value))
|
: mValue(normalizeFilename(value))
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue