mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-08-19 04:29:09 +00:00
Codechange: Use string_view for FileExists.
This commit is contained in:
@@ -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);
|
||||
|
@@ -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.
|
||||
|
Reference in New Issue
Block a user