|
Ninja
|
#include <stdint.h>#include <string>

Go to the source code of this file.
Functions | |
| bool | CanonicalizePath (string *path, string *err) |
| Canonicalize a path like "foo/../bar.h" into just "bar.h". | |
| void | Error (const char *msg,...) |
| Log an error message. | |
| void | Fatal (const char *msg,...) |
| Log a fatal message and exit. | |
| int64_t | GetTimeMillis () |
| Get the current time as relative to some epoch. | |
| int | MakeDir (const string &path) |
| Create a directory (mode 0777 on Unix). | |
| int | ReadFile (const string &path, string *contents, string *err) |
| Read a file to a string. | |
| void | SetCloseOnExec (int fd) |
| Mark a file descriptor to not be inherited on exec()s. | |
| void | Warning (const char *msg,...) |
| Log a warning message. | |
| bool CanonicalizePath | ( | string * | path, |
| string * | err | ||
| ) |
Canonicalize a path like "foo/../bar.h" into just "bar.h".
Definition at line 68 of file util.cc.
References Fatal().
Referenced by Edge::LoadDepFile(), ManifestParser::ParseDefaults(), ManifestParser::ParseEdge(), and TEST().
| void Error | ( | const char * | msg, |
| ... | |||
| ) |
Log an error message.
Definition at line 59 of file util.cc.
Referenced by Cleaner::CleanRule(), Cleaner::CleanRules(), Cleaner::CleanTarget(), Cleaner::CleanTargets(), main(), RealDiskInterface::MakeDir(), RealDiskInterface::RemoveFile(), and RealDiskInterface::Stat().
| void Fatal | ( | const char * | msg, |
| ... | |||
| ) |
Log a fatal message and exit.
Definition at line 40 of file util.cc.
Referenced by CanonicalizePath(), and main().
| int64_t GetTimeMillis | ( | ) |
Get the current time as relative to some epoch.
Epoch varies between platforms; only useful for measuring elapsed time.
Definition at line 177 of file util.cc.
Referenced by BuildStatus::BuildEdgeFinished(), BuildStatus::BuildEdgeStarted(), and main().
| int MakeDir | ( | const string & | path | ) |
| int ReadFile | ( | const string & | path, |
| string * | contents, | ||
| string * | err | ||
| ) |
Read a file to a string.
Returns -errno and fills in err on error.
Definition at line 140 of file util.cc.
Referenced by main(), and Subprocess::OnPipeReady().
| void SetCloseOnExec | ( | int | fd | ) |
Mark a file descriptor to not be inherited on exec()s.
Definition at line 162 of file util.cc.
Referenced by BuildLog::OpenForWrite().
| void Warning | ( | const char * | msg, |
| ... | |||
| ) |
1.7.5.1