---------------------------------------------------------------------------
| 232 | |
| 233 | //--------------------------------------------------------------------------- |
| 234 | bool renameFile(const std::string &source, const std::string &target) |
| 235 | { |
| 236 | //checks are inserted here, because rename may throw... |
| 237 | std::string s(source), t(target); |
| 238 | cleanFileName(s); |
| 239 | cleanFileName(t); |
| 240 | if (!fileExists(s)) return false; |
| 241 | if (fileExists(t)) return false; |
| 242 | std::string dir = extractFilePath(t); |
| 243 | createDirectory(dir); |
| 244 | //BvG: if target is on a different drive, source will also be deleted |
| 245 | rename(fs::path(s), fs::path(t)); |
| 246 | return fileExists(t); |
| 247 | } |
| 248 | |
| 249 | //--------------------------------------------------------------------------- |
| 250 | std::string upOneLevel(const std::string &name) |
nothing calls this directly
no test coverage detected