template void WriteFile(std::wstring file, std::ios_base::openmode mode, IterT begin, IterT end) { std::copy( begin, end, std::ostreambuf_iterator(std::ofstream(file, mode | std::ofstream::binary))); } template void CreateFile(std::wstring file, IterT begin, IterT end) { WriteFile(file, std::ios_base::trunc, begin, end); } void CopyFile(std::wstring from, std::wstring to) { CreateFile(to, std::istreambuf_iterator(std::ifstream(from, std::ios_base::binary)), std::istreambuf_iterator()); } std::vector ReadFile(std::wstring file) { return std::vector ( std::istreambuf_iterator(std::ifstream(file, std::ios_base::binary)), std::istreambuf_iterator() ); }