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. | |
bool | MakeDirs (const string &path) |
Create all the parent directories for path; like mkdir -p `basename path`. | |
virtual string | ReadFile (const string &path, string *err) |
Read a file to a string. Fill in |err| on error. | |
RealDiskInterface () | |
virtual int | RemoveFile (const string &path) |
Remove the file named path. | |
virtual TimeStamp | Stat (const string &path) |
stat() a file, returning the mtime, or 0 if missing and -1 on other errors. | |
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. | |
virtual | ~RealDiskInterface () |
Public Attributes | |
bool | quiet_ |
Whether to print on errors. Used to make a test quieter. |
Implementation of DiskInterface that actually hits the disk.
Definition at line 57 of file disk_interface.h.
RealDiskInterface::RealDiskInterface | ( | ) | [inline] |
Definition at line 58 of file disk_interface.h.
virtual RealDiskInterface::~RealDiskInterface | ( | ) | [inline, virtual] |
Definition at line 59 of file disk_interface.h.
bool RealDiskInterface::MakeDir | ( | const string & | path | ) | [virtual] |
Create a directory, returning false on failure.
Implements DiskInterface.
Definition at line 147 of file disk_interface.cc.
References Error().
bool DiskInterface::MakeDirs | ( | const string & | path | ) | [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().
string RealDiskInterface::ReadFile | ( | const string & | path, |
string * | err | ||
) | [virtual] |
Read a file to a string. Fill in |err| on error.
Implements DiskInterface.
Definition at line 155 of file disk_interface.cc.
int RealDiskInterface::RemoveFile | ( | const string & | path | ) | [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().
TimeStamp RealDiskInterface::Stat | ( | const string & | path | ) | [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.
bool RealDiskInterface::WriteFile | ( | const string & | path, |
const string & | contents | ||
) | [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().
Whether to print on errors. Used to make a test quieter.
Definition at line 67 of file disk_interface.h.
Referenced by Stat().