]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/seastar/src/util/file.cc
import quincy beta 17.1.0
[ceph.git] / ceph / src / seastar / src / util / file.cc
index 79cb26adbf425a7e1e0133d414521051887561d9..a98bc1b52fba3153e8aa22f04f620b455c071ee3 100644 (file)
@@ -201,4 +201,20 @@ future<> recursive_remove_directory(fs::path path) noexcept {
     });
 }
 
+namespace util {
+
+future<std::vector<temporary_buffer<char>>> read_entire_file(std::filesystem::path path) {
+    return with_file_input_stream(path, [] (input_stream<char>& in) {
+        return read_entire_stream(in);
+    });
+}
+
+future<sstring> read_entire_file_contiguous(std::filesystem::path path) {
+    return with_file_input_stream(path, [] (input_stream<char>& in) {
+        return read_entire_stream_contiguous(in);
+    });
+}
+
+} // namespace util
+
 } //namespace seastar