/usr/include/boost/filesystem
NameSizeModeActions
detail/-0755rm
config.hpp39510644editdlrm
convenience.hpp15410644editdlrm
directory.hpp271340644editdlrm
exception.hpp33470644editdlrm
file_status.hpp85690644editdlrm
fstream.hpp72290644editdlrm
operations.hpp215430644editdlrm
path.hpp407330644editdlrm
path_traits.hpp103990644editdlrm
string_file.hpp11640644editdlrm
Edit: /usr/include/boost/filesystem/string_file.hpp (1164B)
// filesystem/string_file.hpp --------------------------------------------------------// // Copyright Beman Dawes 2015 // Distributed under the Boost Software License, Version 1.0. // See http://www.boost.org/LICENSE_1_0.txt // Library home page: http://www.boost.org/libs/filesystem #ifndef BOOST_FILESYSTEM_STRING_FILE_HPP #define BOOST_FILESYSTEM_STRING_FILE_HPP #include #include #include namespace boost { namespace filesystem { inline void save_string_file(const path& p, const std::string& str) { filesystem::ofstream file; file.exceptions(std::ofstream::failbit | std::ofstream::badbit); file.open(p, std::ios_base::binary); file.write(str.c_str(), str.size()); } inline void load_string_file(const path& p, std::string& str) { filesystem::ifstream file; file.exceptions(std::ifstream::failbit | std::ifstream::badbit); file.open(p, std::ios_base::binary); std::size_t sz = static_cast(filesystem::file_size(p)); str.resize(sz, '\0'); file.read(&str[0], sz); } } // namespace filesystem } // namespace boost #endif // include guard