| 451 | ////////////////////////////////////////////////////////////////////////// |
| 452 | |
| 453 | std::string getFileName(const std::string& _path) |
| 454 | { |
| 455 | const std::string path = getGenericPath(_path); |
| 456 | size_t offset = std::string::npos; |
| 457 | |
| 458 | // find last '/' and return the filename |
| 459 | if((offset = path.find_last_of('/')) != std::string::npos) |
| 460 | return ((path[offset + 1] == 0) ? "." : std::string(path, offset + 1)); |
| 461 | |
| 462 | // no '/' found, entire path is a filename |
| 463 | return path; |
| 464 | |
| 465 | } // getFileName |
| 466 | |
| 467 | ////////////////////////////////////////////////////////////////////////// |
| 468 |
no test coverage detected