---------------------------------------------------------------------------
| 278 | |
| 279 | //--------------------------------------------------------------------------- |
| 280 | std::string extractFilePath(const std::string &name) |
| 281 | { |
| 282 | std::string s(name); |
| 283 | if (isOnlyDirectory(s)) |
| 284 | { |
| 285 | fs::path p(s); |
| 286 | if (isRoot(name)) |
| 287 | return p.string(); |
| 288 | else |
| 289 | return stripTrailingSlash(std::string(p.string())); |
| 290 | } |
| 291 | else |
| 292 | { |
| 293 | cleanFileName(s); |
| 294 | fs::path p(s); |
| 295 | if (isRoot(name)) // CM: needed for "\\\\machine\\" see testFileTools.cpp |
| 296 | return p.string(); |
| 297 | return std::string(p.parent_path().string()); |
| 298 | } |
| 299 | } |
| 300 | |
| 301 | //--------------------------------------------------------------------------- |
| 302 | std::string extractFileName(const std::string &name) |
no test coverage detected