Add fopen_boost; remove a couple of defunct usings.
authorCarl Hetherington <cth@carlh.net>
Mon, 25 Nov 2013 00:28:26 +0000 (00:28 +0000)
committerCarl Hetherington <cth@carlh.net>
Mon, 25 Nov 2013 00:28:26 +0000 (00:28 +0000)
src/lib/config.cc
src/lib/cross.cc
src/lib/cross.h
src/tools/dcpomatic.cc

index 4b6455f51412ed378633f487217918676cbe156c..2420ab1b5ef6eb637a073db9dbf3a10dc9a34e2f 100644 (file)
@@ -41,7 +41,6 @@
 using std::vector;
 using std::ifstream;
 using std::string;
-using std::ofstream;
 using std::list;
 using std::max;
 using std::exception;
index 41051ee2edf3f9fcacc8d0e59e11d1ba8cd0a745..9aa8454c989444dd04532a4b9ef995c36c279b20 100644 (file)
@@ -269,3 +269,19 @@ openssl_path ()
 #endif
 
 }
+
+/* Apparently there is no way to create an ofstream using a UTF-8
+   filename under Windows.  We are hence reduced to using fopen
+   with this wrapper.
+*/
+FILE *
+fopen_boost (boost::filesystem::path p, string t)
+{
+#ifdef DCPOMATIC_WINDOWS
+        wstring w (t.begin(), t.end());
+       /* c_str() here should give a UTF-16 string */
+        return _wfopen (p.c_str(), w.c_str ());
+#else
+        return fopen (p.c_str(), t.c_str ());
+#endif
+}
index 1fe34edbe0760d9e86f00c47a6689c61acf073a0..931e7d8900792612f5781fc44b0b44f494c6cf09 100644 (file)
@@ -33,3 +33,4 @@ extern boost::filesystem::path openssl_path ();
 #ifdef DCPOMATIC_OSX
 extern boost::filesystem::path app_contents ();
 #endif
+extern FILE * fopen_boost (boost::filesystem::path, std::string);
index 1d01e4da8bf8b3fcead99504b9f7e8f2e311fedc..5d21579223647f04d68170a89bfe5246d7c23b75 100644 (file)
@@ -62,7 +62,6 @@ using std::map;
 using std::make_pair;
 using std::list;
 using std::exception;
-using std::ofstream;
 using boost::shared_ptr;
 using boost::dynamic_pointer_cast;