diff options
author | Jose <jose@zeroc.com> | 2016-09-17 00:28:00 +0200 |
---|---|---|
committer | Jose <jose@zeroc.com> | 2016-09-17 00:28:00 +0200 |
commit | 47c3b5d2b03d3286cba2a3b4890e57fdd6135132 (patch) | |
tree | 40e05ffec6df92a5b88fdb675d775580f41547c1 /cpp/src/IceUtil/FileUtil.h | |
parent | 3.6.3 version fixes (diff) | |
download | ice-47c3b5d2b03d3286cba2a3b4890e57fdd6135132.tar.bz2 ice-47c3b5d2b03d3286cba2a3b4890e57fdd6135132.tar.xz ice-47c3b5d2b03d3286cba2a3b4890e57fdd6135132.zip |
Fix ICE-4787 - slice compilers and unicode paths
Diffstat (limited to 'cpp/src/IceUtil/FileUtil.h')
-rw-r--r-- | cpp/src/IceUtil/FileUtil.h | 23 |
1 files changed, 18 insertions, 5 deletions
diff --git a/cpp/src/IceUtil/FileUtil.h b/cpp/src/IceUtil/FileUtil.h index 7d5c478834d..2a0542a12d2 100644 --- a/cpp/src/IceUtil/FileUtil.h +++ b/cpp/src/IceUtil/FileUtil.h @@ -104,14 +104,14 @@ public: // file. // FileLock(const std::string&); - + // // The destructor releases the lock and removes the file. // virtual ~FileLock(); - + private: - + #ifdef _WIN32 HANDLE _fd; #else @@ -136,7 +136,7 @@ public: #if defined(_MSC_VER) && (_MSC_VER >= 1900) ifstream(const ifstream&) = delete; -#endif +#endif private: @@ -159,7 +159,7 @@ public: #if defined(_MSC_VER) && (_MSC_VER >= 1900) ofstream(const ofstream&) = delete; -#endif +#endif private: @@ -168,5 +168,18 @@ private: void open(const char*, std::ios_base::openmode mode = std::ios_base::out); }; +// +// Use streamFilename to construct the filename given to std stream classes +// like ifstream and ofstream. +// +#if defined(_WIN32) && !defined(__MINGW32__) +ICE_UTIL_API std::wstring streamFilename(const std::string&); +#else +inline std::string streamFilename(const std::string& filename) +{ + return filename; +} +#endif + } #endif |