| 261 | } |
| 262 | |
| 263 | std::string upMultipleLevels(const std::string &name, unsigned int nrOfLevels) |
| 264 | { |
| 265 | if (isRoot(name)) |
| 266 | return name; |
| 267 | |
| 268 | std::string s(name); |
| 269 | if (isOnlyDirectory(name)) |
| 270 | s = stripTrailingSlash(s); |
| 271 | |
| 272 | fs::path p(s); |
| 273 | if (nrOfLevels == 1) |
| 274 | return p.parent_path().string(); |
| 275 | else |
| 276 | return upMultipleLevels(p.parent_path().string(), nrOfLevels - 1); |
| 277 | } |
| 278 | |
| 279 | //--------------------------------------------------------------------------- |
| 280 | std::string extractFilePath(const std::string &name) |
nothing calls this directly
no test coverage detected