@@ -45,6 +45,11 @@ Term::Private::OutputFileHandler& Term::Private::out = reinterpret_cast<Term::Pr
4545
4646//
4747
48+ #ifdef _WIN32
49+ #pragma warning( push )
50+ #pragma warning( disable : 4297)
51+ #endif
52+
4853Term::Private::FileHandler::FileHandler (std::recursive_mutex& mutex, const std::string& file, const std::string& mode) noexcept
4954try : m_mutex(mutex)
5055{
@@ -90,6 +95,30 @@ catch(...)
9095 ExceptionHandler (ExceptionDestination::StdErr);
9196}
9297
98+ Term::Private::OutputFileHandler::OutputFileHandler (std::recursive_mutex& io_mutex) noexcept
99+ try : FileHandler(io_mutex, m_file, " w" )
100+ {
101+ // noop
102+ }
103+ catch (...)
104+ {
105+ ExceptionHandler (ExceptionDestination::StdErr);
106+ }
107+
108+ Term::Private::InputFileHandler::InputFileHandler (std::recursive_mutex& io_mutex) noexcept
109+ try : FileHandler(io_mutex, m_file, " r" )
110+ {
111+ // noop
112+ }
113+ catch (...)
114+ {
115+ ExceptionHandler (ExceptionDestination::StdErr);
116+ }
117+
118+ #ifdef _WIN32
119+ #pragma warning( pop )
120+ #endif
121+
93122bool Term::Private::FileHandler::null () const noexcept { return m_null; }
94123
95124std::FILE* Term::Private::FileHandler::file () const noexcept { return m_file; }
@@ -159,26 +188,6 @@ void Term::Private::FileHandler::flush() { Term::Private::Errno().check_if(0 !=
159188void Term::Private::FileHandler::lockIO () { m_mutex.lock (); }
160189void Term::Private::FileHandler::unlockIO () { m_mutex.unlock (); }
161190
162- Term::Private::OutputFileHandler::OutputFileHandler (std::recursive_mutex& io_mutex) noexcept
163- try : FileHandler(io_mutex, m_file, " w" )
164- {
165- // noop
166- }
167- catch (...)
168- {
169- ExceptionHandler (ExceptionDestination::StdErr);
170- }
171-
172- Term::Private::InputFileHandler::InputFileHandler (std::recursive_mutex& io_mutex) noexcept
173- try : FileHandler(io_mutex, m_file, " r" )
174- {
175- // noop
176- }
177- catch (...)
178- {
179- ExceptionHandler (ExceptionDestination::StdErr);
180- }
181-
182191std::string Term::Private::ask (const std::string& str)
183192{
184193 Term::Private::out.write (str);
0 commit comments