From: Carl Hetherington Date: Mon, 25 Nov 2013 00:36:44 +0000 (+0000) Subject: Remove a couple of uses of ofstream. X-Git-Tag: v2.0.48~1108^2~15^2~30 X-Git-Url: https://main.carlh.net/gitweb/?p=dcpomatic.git;a=commitdiff_plain;h=9e1343fb30df204811e80bfd1387574b9d383a09 Remove a couple of uses of ofstream. --- diff --git a/src/lib/dcp_video_frame.cc b/src/lib/dcp_video_frame.cc index 25abd6f0d..679a0490e 100644 --- a/src/lib/dcp_video_frame.cc +++ b/src/lib/dcp_video_frame.cc @@ -59,12 +59,12 @@ #include "scaler.h" #include "image.h" #include "log.h" +#include "cross.h" #include "i18n.h" using std::string; using std::stringstream; -using std::ofstream; using std::cout; using boost::shared_ptr; using boost::lexical_cast; @@ -379,8 +379,9 @@ void EncodedData::write_info (shared_ptr film, int frame, Eyes eyes, libdcp::FrameInfo fin) const { boost::filesystem::path const info = film->info_path (frame, eyes); - ofstream h (info.string().c_str()); + FILE* h = fopen_boost (info, "w"); fin.write (h); + fclose (h); } /** Send this data to a socket. diff --git a/src/lib/film.cc b/src/lib/film.cc index eab91c7d2..a3720c458 100644 --- a/src/lib/film.cc +++ b/src/lib/film.cc @@ -65,7 +65,6 @@ using std::pair; using std::map; using std::vector; using std::ifstream; -using std::ofstream; using std::setfill; using std::min; using std::make_pair; diff --git a/src/lib/util.cc b/src/lib/util.cc index 484c4fb9b..3afd3547f 100644 --- a/src/lib/util.cc +++ b/src/lib/util.cc @@ -89,7 +89,6 @@ using std::multimap; using std::istream; using std::numeric_limits; using std::pair; -using std::ofstream; using std::cout; using boost::shared_ptr; using boost::thread; @@ -260,8 +259,11 @@ seconds (struct timeval t) LONG WINAPI exception_handler(struct _EXCEPTION_POINTERS *) { dbg::stack s; - ofstream f (backtrace_file.string().c_str()); - std::copy(s.begin(), s.end(), std::ostream_iterator(f, "\n")); + FILE* f = fopen_boost (backtrace_file, "w"); + for (dbg::stack_frame::const_iterator i = s.begin(); i != s.end(); ++i) { + fprintf (f, "%p %s %d %s", i->instruction, i->function.c_str(), i->line, i->module.c_str()); + } + fclose (f); return EXCEPTION_CONTINUE_SEARCH; } #endif