MCPcopy Create free account
hub / github.com/TheRealMJP/BakingLab / GetDirectoryFromFilePath

Function GetDirectoryFromFilePath

SampleFramework11/v1.02/FileIO.cpp:42–52  ·  view source on GitHub ↗

Returns the directory containing a file

Source from the content-addressed store, hash-verified

40
41// Returns the directory containing a file
42std::wstring GetDirectoryFromFilePath(const wchar* filePath_)
43{
44 Assert_(filePath_);
45
46 std::wstring filePath(filePath_);
47 size_t idx = filePath.rfind(L'\\');
48 if(idx != std::wstring::npos)
49 return filePath.substr(0, idx + 1);
50 else
51 return std::wstring(L"");
52}
53
54// Returns the name of the file given the path (extension included)
55std::wstring GetFileName(const wchar* filePath_)

Callers 2

CreateFromSDKMeshFileMethod · 0.85
CreateWithAssimpMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected