diff options
| author | Carl Hetherington <cth@carlh.net> | 2013-11-25 00:28:26 +0000 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2013-11-25 00:28:26 +0000 |
| commit | a9dd3d27bc52f853309885b1be02d6efd2d2af48 (patch) | |
| tree | 34ca2469fff6d71a85edef547d793d58fe7a0df7 /src | |
| parent | ad0ddd25c94730bed174756a21c83a348c45687e (diff) | |
Add fopen_boost; remove a couple of defunct usings.
Diffstat (limited to 'src')
| -rw-r--r-- | src/lib/config.cc | 1 | ||||
| -rw-r--r-- | src/lib/cross.cc | 16 | ||||
| -rw-r--r-- | src/lib/cross.h | 1 | ||||
| -rw-r--r-- | src/tools/dcpomatic.cc | 1 |
4 files changed, 17 insertions, 2 deletions
diff --git a/src/lib/config.cc b/src/lib/config.cc index 4b6455f51..2420ab1b5 100644 --- a/src/lib/config.cc +++ b/src/lib/config.cc @@ -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; diff --git a/src/lib/cross.cc b/src/lib/cross.cc index 41051ee2e..9aa8454c9 100644 --- a/src/lib/cross.cc +++ b/src/lib/cross.cc @@ -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 +} diff --git a/src/lib/cross.h b/src/lib/cross.h index 1fe34edbe..931e7d890 100644 --- a/src/lib/cross.h +++ b/src/lib/cross.h @@ -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); diff --git a/src/tools/dcpomatic.cc b/src/tools/dcpomatic.cc index 1d01e4da8..5d2157922 100644 --- a/src/tools/dcpomatic.cc +++ b/src/tools/dcpomatic.cc @@ -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; |
