diff options
| author | Carl Hetherington <cth@carlh.net> | 2013-11-25 00:36:44 +0000 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2013-11-25 00:36:44 +0000 |
| commit | 9e1343fb30df204811e80bfd1387574b9d383a09 (patch) | |
| tree | 49283ebc8d3129b6889965aafa8e4672082f49b2 /src/lib | |
| parent | a9dd3d27bc52f853309885b1be02d6efd2d2af48 (diff) | |
Remove a couple of uses of ofstream.
Diffstat (limited to 'src/lib')
| -rw-r--r-- | src/lib/dcp_video_frame.cc | 5 | ||||
| -rw-r--r-- | src/lib/film.cc | 1 | ||||
| -rw-r--r-- | src/lib/util.cc | 8 |
3 files changed, 8 insertions, 6 deletions
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<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. 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<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 |
