MCPcopy Create free account
hub / github.com/TheRealMJP/Shadows / GetFileName

Function GetFileName

Shadows/SampleFramework11/FileIO.cpp:55–65  ·  view source on GitHub ↗

Returns the name of the file given the path (extension included)

Source from the content-addressed store, hash-verified

53
54// Returns the name of the file given the path (extension included)
55std::wstring GetFileName(const wchar* filePath_)
56{
57 Assert_(filePath_);
58
59 std::wstring filePath(filePath_);
60 size_t idx = filePath.rfind(L'\\');
61 if(idx != std::wstring::npos && idx < filePath.length() - 1)
62 return filePath.substr(idx + 1);
63 else
64 return filePath;
65}
66
67// Returns the name of the file given the path, minus the extension
68std::wstring GetFileNameWithoutExtension(const wchar* filePath)

Callers 2

CompileShaderFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected