mirror of
https://github.com/OpenMW/openmw.git
synced 2025-04-01 07:36:41 +00:00
Make Normalized constructor from const char* explicit
This commit is contained in:
parent
595e42ae43
commit
92d57d6e46
4 changed files with 15 additions and 1 deletions
|
@ -2,6 +2,7 @@
|
||||||
#define TESTING_UTIL_H
|
#define TESTING_UTIL_H
|
||||||
|
|
||||||
#include <filesystem>
|
#include <filesystem>
|
||||||
|
#include <initializer_list>
|
||||||
#include <sstream>
|
#include <sstream>
|
||||||
|
|
||||||
#include <components/misc/strings/conversion.hpp>
|
#include <components/misc/strings/conversion.hpp>
|
||||||
|
@ -73,6 +74,12 @@ namespace TestingOpenMW
|
||||||
return vfs;
|
return vfs;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
inline std::unique_ptr<VFS::Manager> createTestVFS(
|
||||||
|
std::initializer_list<std::pair<VFS::Path::NormalizedView, VFS::File*>> files)
|
||||||
|
{
|
||||||
|
return createTestVFS(VFS::FileMap(files.begin(), files.end()));
|
||||||
|
}
|
||||||
|
|
||||||
#define EXPECT_ERROR(X, ERR_SUBSTR) \
|
#define EXPECT_ERROR(X, ERR_SUBSTR) \
|
||||||
try \
|
try \
|
||||||
{ \
|
{ \
|
||||||
|
|
|
@ -57,6 +57,11 @@ namespace VFS
|
||||||
return mIndex.find(name) != mIndex.end();
|
return mIndex.find(name) != mIndex.end();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool Manager::exists(Path::NormalizedView name) const
|
||||||
|
{
|
||||||
|
return mIndex.find(name) != mIndex.end();
|
||||||
|
}
|
||||||
|
|
||||||
std::string Manager::getArchive(const Path::Normalized& name) const
|
std::string Manager::getArchive(const Path::Normalized& name) const
|
||||||
{
|
{
|
||||||
for (auto it = mArchives.rbegin(); it != mArchives.rend(); ++it)
|
for (auto it = mArchives.rbegin(); it != mArchives.rend(); ++it)
|
||||||
|
|
|
@ -43,6 +43,8 @@ namespace VFS
|
||||||
/// @note May be called from any thread once the index has been built.
|
/// @note May be called from any thread once the index has been built.
|
||||||
bool exists(const Path::Normalized& name) const;
|
bool exists(const Path::Normalized& name) const;
|
||||||
|
|
||||||
|
bool exists(Path::NormalizedView name) const;
|
||||||
|
|
||||||
/// Retrieve a file by name.
|
/// Retrieve a file by name.
|
||||||
/// @note Throws an exception if the file can not be found.
|
/// @note Throws an exception if the file can not be found.
|
||||||
/// @note May be called from any thread once the index has been built.
|
/// @note May be called from any thread once the index has been built.
|
||||||
|
|
|
@ -122,7 +122,7 @@ namespace VFS::Path
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
Normalized(const char* value)
|
explicit Normalized(const char* value)
|
||||||
: Normalized(std::string_view(value))
|
: Normalized(std::string_view(value))
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue