Add Activ libs and includes (gcc123)
This commit is contained in:
1 parent
4b718994be
commit
7086753a10
10971 files changed
+2291714
No files matched your search
@@ -0,0 +1,48 @@
|
||||
// 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 ACTIV_BOOST_FILESYSTEM_STRING_FILE_HPP
|
||||
#define ACTIV_BOOST_FILESYSTEM_STRING_FILE_HPP
|
||||
|
||||
#include <cstddef>
|
||||
#include <string>
|
||||
#include <ios>
|
||||
#include <ActivBoost/filesystem/path.hpp>
|
||||
#include <ActivBoost/filesystem/fstream.hpp>
|
||||
#include <ActivBoost/filesystem/operations.hpp>
|
||||
|
||||
#include <ActivBoost/filesystem/detail/header.hpp> // must be the last #include
|
||||
|
||||
namespace Boost {
|
||||
namespace filesystem {
|
||||
|
||||
inline void save_string_file(path const& p, std::string const& str)
|
||||
{
|
||||
filesystem::ofstream file;
|
||||
file.exceptions(std::ios_base::failbit | std::ios_base::badbit);
|
||||
file.open(p, std::ios_base::binary);
|
||||
file.write(str.c_str(), str.size());
|
||||
}
|
||||
|
||||
inline void load_string_file(path const& p, std::string& str)
|
||||
{
|
||||
filesystem::ifstream file;
|
||||
file.exceptions(std::ios_base::failbit | std::ios_base::badbit);
|
||||
file.open(p, std::ios_base::binary);
|
||||
std::size_t sz = static_cast< std::size_t >(filesystem::file_size(p));
|
||||
str.resize(sz, '\0');
|
||||
file.read(&str[0], sz);
|
||||
}
|
||||
|
||||
} // namespace filesystem
|
||||
} // namespace Boost
|
||||
|
||||
#include <ActivBoost/filesystem/detail/footer.hpp>
|
||||
|
||||
#endif // ACTIV_BOOST_FILESYSTEM_STRING_FILE_HPP
|
||||
Reference in new issue
Block a user