* @brief Like shlwapi's PathFindFileName(), but works with both \ and /. * @param [in] Path * @return Filename */
| 99 | * @return Filename |
| 100 | */ |
| 101 | String FindFileName(const String& path) |
| 102 | { |
| 103 | const tchar_t *filename = path.c_str(); |
| 104 | while (const tchar_t *slash = tc::tcspbrk(filename, _T("\\/"))) |
| 105 | { |
| 106 | if (*(slash + 1) == '\0') |
| 107 | break; |
| 108 | filename = slash + 1; |
| 109 | } |
| 110 | return filename; |
| 111 | } |
| 112 | |
| 113 | /** |
| 114 | * @brief Like shlwapi's PathFindFileName(), but works with both \ and /. |