diff options
author | Adam Ierymenko <adam.ierymenko@gmail.com> | 2017-11-07 14:44:46 -0800 |
---|---|---|
committer | Adam Ierymenko <adam.ierymenko@gmail.com> | 2017-11-07 14:44:46 -0800 |
commit | 1613f42d0082cf6438ad0c62d89405ab82625f98 (patch) | |
tree | bc46b11bc909b28de54252e1691a58380b28bae9 /osdep | |
parent | 7fc9094d8ea1c2d28d003c499016f0755b73063d (diff) | |
download | infinitytier-1613f42d0082cf6438ad0c62d89405ab82625f98.tar.gz infinitytier-1613f42d0082cf6438ad0c62d89405ab82625f98.zip |
Re-integrate in-filesystem DB into new controller DB structure.
Diffstat (limited to 'osdep')
-rw-r--r-- | osdep/OSUtils.hpp | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/osdep/OSUtils.hpp b/osdep/OSUtils.hpp index fd1b31d9..274b48df 100644 --- a/osdep/OSUtils.hpp +++ b/osdep/OSUtils.hpp @@ -101,7 +101,6 @@ public: * @return True if delete was successful */ static inline bool rm(const char *path) - throw() { #ifdef __WINDOWS__ return (DeleteFileA(path) != FALSE); @@ -109,7 +108,7 @@ public: return (unlink(path) == 0); #endif } - static inline bool rm(const std::string &path) throw() { return rm(path.c_str()); } + static inline bool rm(const std::string &path) { return rm(path.c_str()); } static inline bool mkdir(const char *path) { @@ -123,7 +122,17 @@ public: return true; #endif } - static inline bool mkdir(const std::string &path) throw() { return OSUtils::mkdir(path.c_str()); } + static inline bool mkdir(const std::string &path) { return OSUtils::mkdir(path.c_str()); } + + static inline bool rename(const char *o,const char *n) + { +#ifdef __WINDOWS__ + DeleteFileA(n); + return (::rename(o,n) == 0); +#else + return (::rename(o,n) == 0); +#endif + } /** * List a directory's contents |