1
0
Fork 0

Codechange: Use string_view for FileExists.

pull/14226/head
frosch 2025-05-04 19:01:17 +02:00 committed by frosch
parent d571491405
commit 1900125c98
2 changed files with 2 additions and 2 deletions

View File

@ -129,7 +129,7 @@ bool FioCheckFileExists(std::string_view filename, Subdirectory subdir)
* @param filename the file to test.
* @return true if and only if the file exists.
*/
bool FileExists(const std::string &filename)
bool FileExists(std::string_view filename)
{
std::error_code ec;
return std::filesystem::exists(OTTD2FS(filename), ec);

View File

@ -27,7 +27,7 @@ void SanitizeFilename(std::string &filename);
void AppendPathSeparator(std::string &buf);
void DeterminePaths(std::string_view exe, bool only_local_path);
std::unique_ptr<char[]> ReadFileToMem(const std::string &filename, size_t &lenp, size_t maxsize);
bool FileExists(const std::string &filename);
bool FileExists(std::string_view filename);
bool ExtractTar(const std::string &tar_filename, Subdirectory subdir);
extern std::string _personal_dir; ///< custom directory for personal settings, saves, newgrf, etc.