MCPcopy Create free account
hub / github.com/WinMerge/winmerge / FindFileName

Function FindFileName

Src/paths.cpp:101–111  ·  view source on GitHub ↗

* @brief Like shlwapi's PathFindFileName(), but works with both \ and /. * @param [in] Path * @return Filename */

Source from the content-addressed store, hash-verified

99 * @return Filename
100 */
101String 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 /.

Callers 15

TestAgainstRegListFunction · 0.85
TestAgainstRegListMethod · 0.85
SetTitleMethod · 0.85
RunAndGetMessageMethod · 0.85
GetTitleStringMethod · 0.85
WriteVersionOf1Method · 0.85
AddToRecentDocsFunction · 0.85
LoadPluginMethod · 0.85
ParseWinMergeCmdLineMethod · 0.85

Calls 1

tcspbrkFunction · 0.85

Tested by 4

TestAgainstRegListFunction · 0.68
TestAgainstRegListMethod · 0.68
TEST_FFunction · 0.68
SetFileFunction · 0.68