diff options
Diffstat (limited to 'src/disk_interface.h')
-rw-r--r-- | src/disk_interface.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/disk_interface.h b/src/disk_interface.h index b0fed3d..c0f5ee5 100644 --- a/src/disk_interface.h +++ b/src/disk_interface.h @@ -34,6 +34,10 @@ struct DiskInterface { /// Create a directory, returning false on failure. virtual bool MakeDir(const string& path) = 0; + /// Create a file, with the specified name and contents + /// Returns true on success, false on failure + virtual bool WriteFile(const string & path, const string & contents) = 0; + /// Read a file to a string. Fill in |err| on error. virtual string ReadFile(const string& path, string* err) = 0; @@ -54,6 +58,7 @@ struct RealDiskInterface : public DiskInterface { virtual ~RealDiskInterface() {} virtual TimeStamp Stat(const string& path); virtual bool MakeDir(const string& path); + virtual bool WriteFile(const string & path, const string & contents); virtual string ReadFile(const string& path, string* err); virtual int RemoveFile(const string& path); }; |