diff options
| author | 2014-10-06 15:25:19 -0400 | |
|---|---|---|
| committer | 2014-10-06 15:25:19 -0400 | |
| commit | 0e2d83fa3ab4aad56dc8813e45d5fdfe05132a5a (patch) | |
| tree | 766620c93a936e767cc073382573660041c2e193 /src/common/file_util.h | |
| parent | Merge pull request #125 from purpasmart96/master (diff) | |
| parent | Common: Add a helper function to generate a 8.3 filename from a long one. (diff) | |
| download | yuzu-0e2d83fa3ab4aad56dc8813e45d5fdfe05132a5a.tar.gz yuzu-0e2d83fa3ab4aad56dc8813e45d5fdfe05132a5a.tar.xz yuzu-0e2d83fa3ab4aad56dc8813e45d5fdfe05132a5a.zip | |
Merge pull request #129 from linkmauve/master
Fix the filesystem implementation in order to get blargSnes to run
Diffstat (limited to 'src/common/file_util.h')
| -rw-r--r-- | src/common/file_util.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/common/file_util.h b/src/common/file_util.h index f9d91972f..288734cad 100644 --- a/src/common/file_util.h +++ b/src/common/file_util.h | |||
| @@ -4,6 +4,7 @@ | |||
| 4 | 4 | ||
| 5 | #pragma once | 5 | #pragma once |
| 6 | 6 | ||
| 7 | #include <array> | ||
| 7 | #include <fstream> | 8 | #include <fstream> |
| 8 | #include <cstdio> | 9 | #include <cstdio> |
| 9 | #include <cstring> | 10 | #include <cstring> |
| @@ -131,6 +132,16 @@ std::string &GetExeDirectory(); | |||
| 131 | size_t WriteStringToFile(bool text_file, const std::string &str, const char *filename); | 132 | size_t WriteStringToFile(bool text_file, const std::string &str, const char *filename); |
| 132 | size_t ReadFileToString(bool text_file, const char *filename, std::string &str); | 133 | size_t ReadFileToString(bool text_file, const char *filename, std::string &str); |
| 133 | 134 | ||
| 135 | /** | ||
| 136 | * Splits the filename into 8.3 format | ||
| 137 | * Loosely implemented following https://en.wikipedia.org/wiki/8.3_filename | ||
| 138 | * @param filename The normal filename to use | ||
| 139 | * @param short_name A 9-char array in which the short name will be written | ||
| 140 | * @param extension A 4-char array in which the extension will be written | ||
| 141 | */ | ||
| 142 | void SplitFilename83(const std::string& filename, std::array<char, 9>& short_name, | ||
| 143 | std::array<char, 4>& extension); | ||
| 144 | |||
| 134 | // simple wrapper for cstdlib file functions to | 145 | // simple wrapper for cstdlib file functions to |
| 135 | // hopefully will make error checking easier | 146 | // hopefully will make error checking easier |
| 136 | // and make forgetting an fclose() harder | 147 | // and make forgetting an fclose() harder |