| 383 | |
| 384 | |
| 385 | std::string getFilename(const std::string& path) |
| 386 | { |
| 387 | #ifdef _WIN32 |
| 388 | std::string pathsep("\\/"); |
| 389 | #else |
| 390 | char pathsep = Utils::dirSeparator; |
| 391 | #endif |
| 392 | |
| 393 | std::string::size_type pos = path.find_last_of(pathsep); |
| 394 | if (pos == std::string::npos) |
| 395 | return path; |
| 396 | return path.substr(pos + 1); |
| 397 | } |
| 398 | |
| 399 | |
| 400 | // Get the directory part of a filename. |
no outgoing calls