aboutsummaryrefslogtreecommitdiff
path: root/src/Platform.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/Platform.h')
-rw-r--r--src/Platform.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/Platform.h b/src/Platform.h
index 21b3d46..425c712 100644
--- a/src/Platform.h
+++ b/src/Platform.h
@@ -137,6 +137,11 @@ enum FileMode : unsigned {
Text = 0b01'00'00,
/**
+ * Opens a file in append mode.
+ */
+ Append = 0b10'00'00,
+
+ /**
* Opens a file for reading and writing.
* Equivalent to <tt>Read | Write</tt>.
*/
@@ -201,6 +206,13 @@ FileHandle* OpenLocalFile(const std::string& path, FileMode mode);
bool FileExists(const std::string& name);
bool LocalFileExists(const std::string& name);
+// Returns true if we have permission to write to the file.
+// Warning: Also creates the file if not present!
+bool CheckFileWritable(const std::string& filepath);
+
+// Same as above (CheckFileWritable()) but for local files.
+bool CheckLocalFileWritable(const std::string& filepath);
+
/** Close a file opened with \c OpenFile.
* @returns \c true if the file was closed successfully, false otherwise.
* @post \c file is no longer valid and should not be used.