summaryrefslogtreecommitdiffstats
path: root/src/common/file_util.h
diff options
context:
space:
mode:
authorJames Rowe <jroweboy@gmail.com>2018-07-02 19:10:41 +0200
committerbunnei <bunneidev@gmail.com>2018-07-03 03:45:47 +0200
commit6269a01b4e9963ffdaf98ddf5d5f2a90d49e58ff (patch)
treec69305f1bca02461e4af8dc20f0b47601f276fc0 /src/common/file_util.h
parentUpdate clang format (diff)
downloadyuzu-6269a01b4e9963ffdaf98ddf5d5f2a90d49e58ff.tar
yuzu-6269a01b4e9963ffdaf98ddf5d5f2a90d49e58ff.tar.gz
yuzu-6269a01b4e9963ffdaf98ddf5d5f2a90d49e58ff.tar.bz2
yuzu-6269a01b4e9963ffdaf98ddf5d5f2a90d49e58ff.tar.lz
yuzu-6269a01b4e9963ffdaf98ddf5d5f2a90d49e58ff.tar.xz
yuzu-6269a01b4e9963ffdaf98ddf5d5f2a90d49e58ff.tar.zst
yuzu-6269a01b4e9963ffdaf98ddf5d5f2a90d49e58ff.zip
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
class IOFile : public NonCopyable {
public:
IOFile();
- IOFile(const std::string& filename, const char openmode[]);
+ // flags is used for windows specific file open mode flags, which
+ // allows yuzu to open the logs in shared write mode, so that the file
+ // isn't considered "locked" while yuzu is open and people can open the log file and view it
+ IOFile(const std::string& filename, const char openmode[], int flags = 0);
~IOFile();
@@ -165,7 +168,7 @@ public:
void Swap(IOFile& other) noexcept;
- bool Open(const std::string& filename, const char openmode[]);
+ bool Open(const std::string& filename, const char openmode[], int flags = 0);
bool Close();
template <typename T>
@@ -220,6 +223,10 @@ public:
return WriteArray(&object, 1);
}
+ size_t WriteString(const std::string& str) {
+ return WriteArray(str.c_str(), str.length());
+ }
+
bool IsOpen() const {
return nullptr != m_file;
}