|
Ninja
|
Implementation of DiskInterface that actually hits the disk. More...
#include <disk_interface.h>

Public Types | |
| enum | Status { Okay , NotFound , OtherError } |
| Result of ReadFile. More... | |
Public Member Functions | |
| void | AllowStatCache (bool allow) |
| Whether stat information can be cached. Only has an effect on Windows. More... | |
| bool | MakeDir (const std::string &path) override |
| Create a directory, returning false on failure. More... | |
| bool | MakeDirs (const std::string &path) |
Create all the parent directories for path; like mkdir -p basename path. More... | |
| Status | ReadFile (const std::string &path, std::string *contents, std::string *err) override |
| Read and store in given string. More... | |
| RealDiskInterface () | |
| int | RemoveFile (const std::string &path) override |
| Remove the file named path. More... | |
| TimeStamp | Stat (const std::string &path, std::string *err) const override |
| stat() a file, returning the mtime, or 0 if missing and -1 on other errors. More... | |
| bool | WriteFile (const std::string &path, const std::string &contents, bool crlf_on_windows) override |
| Create a file, with the specified name and contents If crlf_on_windows is true, will be converted to \r (only on Windows builds of Ninja). More... | |
| virtual | ~RealDiskInterface () |
Implementation of DiskInterface that actually hits the disk.
Definition at line 73 of file disk_interface.h.
|
inherited |
Result of ReadFile.
| Enumerator | |
|---|---|
| Okay | |
| NotFound | |
| OtherError | |
Definition at line 29 of file disk_interface.h.
| RealDiskInterface::RealDiskInterface | ( | ) |
Definition at line 161 of file disk_interface.cc.
|
inlinevirtual |
Definition at line 75 of file disk_interface.h.
| void RealDiskInterface::AllowStatCache | ( | bool | allow | ) |
Whether stat information can be cached. Only has an effect on Windows.
Definition at line 355 of file disk_interface.cc.
|
overridevirtual |
Create a directory, returning false on failure.
Implements DiskInterface.
Definition at line 279 of file disk_interface.cc.
References Error().
|
inherited |
Create all the parent directories for path; like mkdir -p basename path.
Definition at line 140 of file disk_interface.cc.
References Error().
Referenced by Builder::StartEdge().
|
overridevirtual |
Read and store in given string.
On success, return Okay. On error, return another Status and fill |err|.
Implements FileReader.
Definition at line 290 of file disk_interface.cc.
References ReadFile().
|
overridevirtual |
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 300 of file disk_interface.cc.
References Error().
|
overridevirtual |
stat() a file, returning the mtime, or 0 if missing and -1 on other errors.
Implements DiskInterface.
Definition at line 179 of file disk_interface.cc.
References METRIC_RECORD.
Referenced by WriteFakeManifests().
|
overridevirtual |
Create a file, with the specified name and contents If crlf_on_windows is true,
will be converted to \r
(only on Windows builds of Ninja).
Returns true on success, false on failure
Implements DiskInterface.
Definition at line 248 of file disk_interface.cc.
References Error().