Ninja
|
Implementation of DiskInterface that actually hits the disk. More...
#include <disk_interface.h>
Public Member Functions | |
virtual bool | MakeDir (const string &path) |
Create a directory, returning false on failure. More... | |
bool | MakeDirs (const string &path) |
Create all the parent directories for path; like mkdir -p basename path . More... | |
virtual string | ReadFile (const string &path, string *err) |
Read a file to a string. Fill in |err| on error. More... | |
RealDiskInterface () | |
virtual int | RemoveFile (const string &path) |
Remove the file named path. More... | |
virtual TimeStamp | Stat (const string &path) |
stat() a file, returning the mtime, or 0 if missing and -1 on other errors. More... | |
virtual bool | WriteFile (const string &path, const string &contents) |
Create a file, with the specified name and contents Returns true on success, false on failure. More... | |
virtual | ~RealDiskInterface () |
Public Attributes | |
bool | quiet_ |
Whether to print on errors. Used to make a test quieter. More... | |
Implementation of DiskInterface that actually hits the disk.
Definition at line 57 of file disk_interface.h.
|
inline |
Definition at line 58 of file disk_interface.h.
|
inlinevirtual |
Definition at line 59 of file disk_interface.h.
|
virtual |
Create a directory, returning false on failure.
Implements DiskInterface.
Definition at line 147 of file disk_interface.cc.
References Error().
|
inherited |
Create all the parent directories for path; like mkdir -p basename path
.
Definition at line 59 of file disk_interface.cc.
References DiskInterface::MakeDir(), and DiskInterface::Stat().
Referenced by Builder::StartEdge().
|
virtual |
Read a file to a string. Fill in |err| on error.
Implements DiskInterface.
Definition at line 155 of file disk_interface.cc.
|
virtual |
Remove the file named path.
It behaves like 'rm -f path' so no errors are reported if it does not exists.
Implements DiskInterface.
Definition at line 165 of file disk_interface.cc.
References Error().
|
virtual |
stat() a file, returning the mtime, or 0 if missing and -1 on other errors.
Implements DiskInterface.
Definition at line 78 of file disk_interface.cc.
|
virtual |
Create a file, with the specified name and contents Returns true on success, false on failure.
Implements DiskInterface.
Definition at line 123 of file disk_interface.cc.
References Error().
bool RealDiskInterface::quiet_ |
Whether to print on errors. Used to make a test quieter.
Definition at line 67 of file disk_interface.h.
Referenced by Stat().