summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorElliott Hughes <enh@google.com>2015-02-03 20:39:30 +0000
committerAndroid Git Automerger <android-git-automerger@android.com>2015-02-03 20:39:30 +0000
commita803b7697fd4e5285c3670ddc73c600a4f3c2d81 (patch)
tree33ddb2a0a320e1928cd7c589810684c6e7a983e7 /include
parent4acfa5a4812dad747986ab40b311de1fa3741dc2 (diff)
parent813d0ac13614b6199f407762f679afc9f439be7e (diff)
downloadsystem_core-a803b7697fd4e5285c3670ddc73c600a4f3c2d81.zip
system_core-a803b7697fd4e5285c3670ddc73c600a4f3c2d81.tar.gz
system_core-a803b7697fd4e5285c3670ddc73c600a4f3c2d81.tar.bz2
am 813d0ac1: am 6974ba4e: Merge "Add Google-style ReadFileToString and WriteStringToFile."
* commit '813d0ac13614b6199f407762f679afc9f439be7e': Add Google-style ReadFileToString and WriteStringToFile.
Diffstat (limited to 'include')
-rw-r--r--include/utils/file.h29
1 files changed, 29 insertions, 0 deletions
diff --git a/include/utils/file.h b/include/utils/file.h
new file mode 100644
index 0000000..108cabc
--- /dev/null
+++ b/include/utils/file.h
@@ -0,0 +1,29 @@
+/*
+ * Copyright (C) 2015 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef UTILS_FILE_H
+#define UTILS_FILE_H
+
+#include <string>
+
+namespace android {
+
+bool ReadFileToString(const std::string& path, std::string* content);
+bool WriteStringToFile(const std::string& content, const std::string& path);
+
+} // namespace android
+
+#endif