summaryrefslogtreecommitdiff
path: root/src/common/file_util.h
diff options
context:
space:
mode:
authorGravatar bunnei2016-04-12 11:58:41 -0400
committerGravatar bunnei2016-04-12 11:58:41 -0400
commitdb0db6a18256f5c7bae050fbad851990ee30addf (patch)
treeef3cd3f7082e97fdd289b1be7be9ad6a901e6038 /src/common/file_util.h
parentMerge pull request #1613 from mailwl/anp (diff)
parentFileUtil: Missing #include, Add const to IOFile methods (diff)
downloadyuzu-db0db6a18256f5c7bae050fbad851990ee30addf.tar.gz
yuzu-db0db6a18256f5c7bae050fbad851990ee30addf.tar.xz
yuzu-db0db6a18256f5c7bae050fbad851990ee30addf.zip
Merge pull request #1660 from MerryMage/file_util
FileUtil: Missing #include, Add const to IOFile methods
Diffstat (limited to 'src/common/file_util.h')
-rw-r--r--src/common/file_util.h13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/common/file_util.h b/src/common/file_util.h
index a85121aa6..880b8a1e3 100644
--- a/src/common/file_util.h
+++ b/src/common/file_util.h
@@ -14,6 +14,10 @@
14 14
15#include "common/common_types.h" 15#include "common/common_types.h"
16 16
17#ifdef _MSC_VER
18#include "common/string_util.h"
19#endif
20
17// User directory indices for GetUserPath 21// User directory indices for GetUserPath
18enum { 22enum {
19 D_USER_IDX, 23 D_USER_IDX,
@@ -172,7 +176,7 @@ class IOFile : public NonCopyable
172{ 176{
173public: 177public:
174 IOFile(); 178 IOFile();
175 IOFile(std::FILE* file); 179 explicit IOFile(std::FILE* file);
176 IOFile(const std::string& filename, const char openmode[]); 180 IOFile(const std::string& filename, const char openmode[]);
177 181
178 ~IOFile(); 182 ~IOFile();
@@ -235,10 +239,10 @@ public:
235 return WriteArray(&object, 1); 239 return WriteArray(&object, 1);
236 } 240 }
237 241
238 bool IsOpen() { return nullptr != m_file; } 242 bool IsOpen() const { return nullptr != m_file; }
239 243
240 // m_good is set to false when a read, write or other function fails 244 // m_good is set to false when a read, write or other function fails
241 bool IsGood() { return m_good; } 245 bool IsGood() const { return m_good; }
242 operator void*() { return m_good ? m_file : nullptr; } 246 operator void*() { return m_good ? m_file : nullptr; }
243 247
244 std::FILE* ReleaseHandle(); 248 std::FILE* ReleaseHandle();
@@ -258,9 +262,6 @@ public:
258 262
259 std::FILE* m_file; 263 std::FILE* m_file;
260 bool m_good; 264 bool m_good;
261private:
262 IOFile(IOFile&);
263 IOFile& operator=(IOFile& other);
264}; 265};
265 266
266} // namespace 267} // namespace