diff options
Diffstat (limited to 'src/ninja.h')
-rw-r--r-- | src/ninja.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/ninja.h b/src/ninja.h index 180f90c..0f4a029 100644 --- a/src/ninja.h +++ b/src/ninja.h @@ -49,6 +49,10 @@ struct DiskInterface { virtual bool MakeDir(const string& path) = 0; /// Read a file to a string. Fill in |err| on error. virtual string ReadFile(const string& path, string* err) = 0; + /// Remove the file named @a path. It behaves like 'rm -f path' so no errors + /// are reported if it does not exists. + /// @returns whether the file has been removed. + virtual bool RemoveFile(const string& path) = 0; /// Create all the parent directories for path; like mkdir -p /// `basename path`. @@ -61,6 +65,7 @@ struct RealDiskInterface : public DiskInterface { virtual int Stat(const string& path); virtual bool MakeDir(const string& path); virtual string ReadFile(const string& path, string* err); + virtual bool RemoveFile(const string& path); }; /// Mapping of path -> FileStat. |