9#ifndef GEMMI_OFSTREAM_HPP_
10#define GEMMI_OFSTREAM_HPP_
14#elif defined(_WIN32) && defined(__has_include)
15# if __has_include(<filesystem>)
31#elif defined(_WIN32) && defined(__cpp_lib_filesystem)
33 ptr->open(std::filesystem::path(
wfilename));
47 keeper_.reset(
new std::ofstream);
55 std::ostream&
ref() {
return *ptr_; }
58 std::unique_ptr<std::ofstream> keeper_;
68 keeper_.reset(
new std::ifstream);
76 std::istream&
ref() {
return *ptr_; }
79 std::unique_ptr<std::ifstream> keeper_;
void open_stream_from_utf8_path(T &ptr, const std::string &filename)
std::wstring UTF8_to_wchar(const char *in)
GEMMI_COLD void sys_fail(const std::string &msg)
Ifstream(const std::string &filename, std::istream *dash=nullptr)
std::istream * operator->()
Ofstream(const std::string &filename, std::ostream *dash=nullptr)
std::ostream * operator->()