34 #include <boost/archive/binary_iarchive.hpp> 37 #include <boost/filesystem/operations.hpp> 42 template<
class t_
object>
48 HANDLE data_file_handle = ::CreateFile(file_path.c_str(), GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
49 if (INVALID_HANDLE_VALUE == data_file_handle)
52 int data_file_descriptor = _open_osfhandle((
intptr_t)data_file_handle, 0);
53 if (-1 == data_file_descriptor)
55 ::CloseHandle(data_file_handle);
59 const std::unique_ptr<FILE, tools::close_file> data_file_file{_fdopen(data_file_descriptor,
"wb")};
60 if (
nullptr == data_file_file)
63 _close(data_file_descriptor);
68 std::ofstream data_file(data_file_file.get());
75 std::ofstream data_file;
76 data_file.open(file_path , std::ios_base::binary | std::ios_base::out| std::ios::trunc);
89 ::FlushFileBuffers(data_file_handle);
96 template<
class t_
object>
101 std::ifstream data_file;
102 data_file.open( file_path, std::ios_base::binary | std::ios_base::in);
114 boost::filesystem::copy_file(file_path, file_path +
".unportable", boost::filesystem::copy_option::overwrite_if_exists);
116 data_file.open( file_path, std::ios_base::binary | std::ios_base::in);
119 boost::archive::binary_iarchive
a(data_file);
122 return !data_file.fail();
const GenericPointer< typename T::ValueType > T2 T::AllocatorType & a
#define CATCH_ENTRY_L0(lacation, return_val)