Remove a couple of uses of ofstream.
authorCarl Hetherington <cth@carlh.net>
Mon, 25 Nov 2013 00:36:44 +0000 (00:36 +0000)
committerCarl Hetherington <cth@carlh.net>
Mon, 25 Nov 2013 00:36:44 +0000 (00:36 +0000)
src/lib/dcp_video_frame.cc
src/lib/film.cc
src/lib/util.cc

index 25abd6f0df57ee7f9f0304e9713b919052639c00..679a0490e8850955a782e76a0ccd387c96254ba4 100644 (file)
 #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<const Film> 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.
index eab91c7d2b26dc343f8fe7c733cf6a1186ce4fec..a3720c458b1afc8f4dbcf054e7da657de10402f4 100644 (file)
@@ -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;
index 484c4fb9ba012edb895b0c466f484af2028bd2d8..3afd3547fa3e587ac0954c0d76b468a572308169 100644 (file)
@@ -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<dbg::stack_frame>(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