summaryrefslogtreecommitdiff
path: root/src/common/file_util.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/common/file_util.h')
-rw-r--r--src/common/file_util.h11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/common/file_util.h b/src/common/file_util.h
index fc6b3ea46..5bc7fbf7c 100644
--- a/src/common/file_util.h
+++ b/src/common/file_util.h
@@ -156,7 +156,10 @@ void SplitFilename83(const std::string& filename, std::array<char, 9>& short_nam
156class IOFile : public NonCopyable { 156class IOFile : public NonCopyable {
157public: 157public:
158 IOFile(); 158 IOFile();
159 IOFile(const std::string& filename, const char openmode[]); 159 // flags is used for windows specific file open mode flags, which
160 // allows yuzu to open the logs in shared write mode, so that the file
161 // isn't considered "locked" while yuzu is open and people can open the log file and view it
162 IOFile(const std::string& filename, const char openmode[], int flags = 0);
160 163
161 ~IOFile(); 164 ~IOFile();
162 165
@@ -165,7 +168,7 @@ public:
165 168
166 void Swap(IOFile& other) noexcept; 169 void Swap(IOFile& other) noexcept;
167 170
168 bool Open(const std::string& filename, const char openmode[]); 171 bool Open(const std::string& filename, const char openmode[], int flags = 0);
169 bool Close(); 172 bool Close();
170 173
171 template <typename T> 174 template <typename T>
@@ -220,6 +223,10 @@ public:
220 return WriteArray(&object, 1); 223 return WriteArray(&object, 1);
221 } 224 }
222 225
226 size_t WriteString(const std::string& str) {
227 return WriteArray(str.c_str(), str.length());
228 }
229
223 bool IsOpen() const { 230 bool IsOpen() const {
224 return nullptr != m_file; 231 return nullptr != m_file;
225 } 232 }