diff options
author | Matthew Newhook <matthew@zeroc.com> | 2009-08-07 18:01:43 +0800 |
---|---|---|
committer | Matthew Newhook <matthew@zeroc.com> | 2009-08-07 18:01:43 +0800 |
commit | 5c9e6e5d3d1873ea232bf05ed2f6be8d290c8583 (patch) | |
tree | 66b739dff9ee9cbdc113a158c30ef80ae84ac218 /cpp/src/IcePatch2/OS.cpp | |
parent | Revert "Changes for bug 3962 and 4714" (diff) | |
download | ice-5c9e6e5d3d1873ea232bf05ed2f6be8d290c8583.tar.bz2 ice-5c9e6e5d3d1873ea232bf05ed2f6be8d290c8583.tar.xz ice-5c9e6e5d3d1873ea232bf05ed2f6be8d290c8583.zip |
merged in both of Jose's 4071 fixes.
Diffstat (limited to 'cpp/src/IcePatch2/OS.cpp')
-rw-r--r-- | cpp/src/IcePatch2/OS.cpp | 35 |
1 files changed, 18 insertions, 17 deletions
diff --git a/cpp/src/IcePatch2/OS.cpp b/cpp/src/IcePatch2/OS.cpp index 61decba5332..dc6b6e2c2f8 100644 --- a/cpp/src/IcePatch2/OS.cpp +++ b/cpp/src/IcePatch2/OS.cpp @@ -13,59 +13,60 @@ #include <IceUtil/Unicode.h> #include <climits> +#include <sys/stat.h> + #ifdef __BCPLUSPLUS__ # include <dir.h> # include <io.h> #endif using namespace std; -using namespace OS; #ifdef _WIN32 int -OS::osstat(const string& path, structstat* buf) +IceInternal::OS::osstat(const string& path, structstat* buf) { return ::_wstat(IceUtil::stringToWstring(path).c_str(), buf); } int -OS::remove(const string& path) +IceInternal::OS::remove(const string& path) { return ::_wremove(IceUtil::stringToWstring(path).c_str()); } int -OS::rename(const string& from, const string& to) +IceInternal::OS::rename(const string& from, const string& to) { return ::_wrename(IceUtil::stringToWstring(from).c_str(), IceUtil::stringToWstring(to).c_str()); } int -OS::rmdir(const string& path) +IceInternal::OS::rmdir(const string& path) { return ::_wrmdir(IceUtil::stringToWstring(path).c_str()); } int -OS::mkdir(const string& path, int) +IceInternal::OS::mkdir(const string& path, int) { return ::_wmkdir(IceUtil::stringToWstring(path).c_str()); } FILE* -OS::fopen(const string& path, const string& mode) +IceInternal::OS::fopen(const string& path, const string& mode) { return ::_wfopen(IceUtil::stringToWstring(path).c_str(), IceUtil::stringToWstring(mode).c_str()); } int -OS::open(const string& path, int flags) +IceInternal::OS::open(const string& path, int flags) { return ::_wopen(IceUtil::stringToWstring(path).c_str(), flags); } int -OS::getcwd(string& cwd) +IceInternal::OS::getcwd(string& cwd) { wchar_t cwdbuf[_MAX_PATH]; if(_wgetcwd(cwdbuf, _MAX_PATH) == NULL) @@ -79,49 +80,49 @@ OS::getcwd(string& cwd) #else int -OS::osstat(const string& path, structstat* buf) +IceInternal::OS::osstat(const string& path, structstat* buf) { return ::stat(path.c_str(), buf); } int -OS::remove(const string& path) +IceInternal::OS::remove(const string& path) { return ::remove(path.c_str()); } int -OS::rename(const string& from, const string& to) +IceInternal::OS::rename(const string& from, const string& to) { return ::rename(from.c_str(), to.c_str()); } int -OS::rmdir(const string& path) +IceInternal::OS::rmdir(const string& path) { return ::rmdir(path.c_str()); } int -OS::mkdir(const string& path, int perm) +IceInternal::OS::mkdir(const string& path, int perm) { return ::mkdir(path.c_str(), perm); } FILE* -OS::fopen(const string& path, const string& mode) +IceInternal::OS::fopen(const string& path, const string& mode) { return ::fopen(path.c_str(), mode.c_str()); } int -OS::open(const string& path, int flags) +IceInternal::OS::open(const string& path, int flags) { return ::open(path.c_str(), flags); } int -OS::getcwd(string& cwd) +IceInternal::OS::getcwd(string& cwd) { char cwdbuf[PATH_MAX]; if(::getcwd(cwdbuf, PATH_MAX) == NULL) |