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