|
|
|
@ -50,7 +50,7 @@ class File { |
|
|
|
|
|
|
|
|
|
// Read an entire file to a string. Return true if successful, false
|
|
|
|
|
// otherwise.
|
|
|
|
|
static bool ReadFileToString(const string& name, string* output); |
|
|
|
|
static bool ReadFileToString(const string& name, string* output, bool text_mode = false); |
|
|
|
|
|
|
|
|
|
// Same as above, but crash on failure.
|
|
|
|
|
static void ReadFileToStringOrDie(const string& name, string* output); |
|
|
|
@ -85,6 +85,11 @@ class File { |
|
|
|
|
return ReadFileToString(name, output); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
static bool GetContentsAsText( |
|
|
|
|
const string& name, string* output, bool /*is_default*/) { |
|
|
|
|
return ReadFileToString(name, output, true); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
static bool SetContents( |
|
|
|
|
const string& name, const string& contents, bool /*is_default*/) { |
|
|
|
|
return WriteStringToFile(contents, name); |
|
|
|
|