diff options
author | glx22 <glx@openttd.org> | 2021-04-30 15:41:58 +0200 |
---|---|---|
committer | Loïc Guilloux <glx22@users.noreply.github.com> | 2021-05-03 19:46:57 +0200 |
commit | 983c7ade60f82a49d8c23c1f295add1fd9a913b0 (patch) | |
tree | 879eace14cb5fa56c407fbd3c0b5a04fa6a808e2 /src/fileio_func.h | |
parent | 34215f7faa2de08d767b4f6945443a8f3175acbf (diff) | |
download | openttd-983c7ade60f82a49d8c23c1f295add1fd9a913b0.tar.xz |
Codechange: Replace FOR_ALL_SEARCHPATHS with range-based for loops
Diffstat (limited to 'src/fileio_func.h')
-rw-r--r-- | src/fileio_func.h | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/src/fileio_func.h b/src/fileio_func.h index 142835650..4b9b2dd9e 100644 --- a/src/fileio_func.h +++ b/src/fileio_func.h @@ -13,6 +13,7 @@ #include "core/enum_type.hpp" #include "fileio_type.h" #include <string> +#include <vector> void FioSeekTo(size_t pos, int mode); void FioSeekToFile(uint8 slot, size_t pos); @@ -26,16 +27,6 @@ void FioOpenFile(int slot, const std::string &filename, Subdirectory subdir); void FioReadBlock(void *ptr, size_t size); void FioSkipBytes(int n); -/** - * Checks whether the given search path is a valid search path - * @param sp the search path to check - * @return true if the search path is valid - */ -bool IsValidSearchPath(Searchpath sp); - -/** Iterator for all the search paths */ -#define FOR_ALL_SEARCHPATHS(sp) for (sp = SP_FIRST_DIR; sp < NUM_SEARCHPATHS; sp++) if (IsValidSearchPath(sp)) - void FioFCloseFile(FILE *f); FILE *FioFOpenFile(const std::string &filename, const char *mode, Subdirectory subdir, size_t *filesize = nullptr); bool FioCheckFileExists(const std::string &filename, Subdirectory subdir); @@ -54,6 +45,7 @@ bool FileExists(const std::string &filename); bool ExtractTar(const std::string &tar_filename, Subdirectory subdir); extern std::string _personal_dir; ///< custom directory for personal settings, saves, newgrf, etc. +extern std::vector<Searchpath> _valid_searchpaths; /** Helper for scanning for files with a given name */ class FileScanner { |