diff options
| author | louist103 <35883445+louist103@users.noreply.github.com> | 2022-12-05 23:19:25 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-12-05 23:19:25 -0500 |
| commit | a80f36ca0f003a3901fc781505f707ca2ef4c63a (patch) | |
| tree | 2b9cec4c873c194ada5449f276a18bf0090483be /ZAPDUtils/Utils/File.h | |
| parent | 645444f209bfeca025b3862548a59d31ef9bca08 (diff) | |
Read from an external file for entrance lists (#271)
* Read from entrance list file
* Remove switch.
* Add check for special entrances.
* Ignore warning for GCC in specific spot.
* u
Diffstat (limited to 'ZAPDUtils/Utils/File.h')
| -rw-r--r-- | ZAPDUtils/Utils/File.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/ZAPDUtils/Utils/File.h b/ZAPDUtils/Utils/File.h index 084152f..7bc5d29 100644 --- a/ZAPDUtils/Utils/File.h +++ b/ZAPDUtils/Utils/File.h @@ -33,6 +33,8 @@ public: static std::string ReadAllText(const fs::path& filePath) { std::ifstream file(filePath, std::ios::in | std::ios::binary | std::ios::ate); + if (!file.is_open()) + return ""; int32_t fileSize = (int32_t)file.tellg(); file.seekg(0); char* data = new char[fileSize + 1]; |
