aboutsummaryrefslogtreecommitdiff
path: root/src/google/protobuf/testing/file.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/google/protobuf/testing/file.h')
-rw-r--r--src/google/protobuf/testing/file.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/google/protobuf/testing/file.h b/src/google/protobuf/testing/file.h
index 2f63f80e..45989967 100644
--- a/src/google/protobuf/testing/file.h
+++ b/src/google/protobuf/testing/file.h
@@ -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);