MCPcopy Create free account
hub / github.com/ValveSoftware/openvr / Path_StripFilename

Function Path_StripFilename

samples/shared/pathtools.cpp:102–112  ·  view source on GitHub ↗

Returns the specified path without its filename */

Source from the content-addressed store, hash-verified

100
101/** Returns the specified path without its filename */
102std::string Path_StripFilename( const std::string & sPath, char slash )
103{
104 if( slash == 0 )
105 slash = Path_GetSlash();
106
107 std::string::size_type n = sPath.find_last_of( slash );
108 if( n == std::string::npos )
109 return sPath;
110 else
111 return std::string( sPath.begin(), sPath.begin() + n );
112}
113
114/** returns just the filename from the provided full or relative path. */
115std::string Path_StripDirectory( const std::string & sPath, char slash )

Callers 8

CreateAllShadersMethod · 0.50
SetupTexturemapsMethod · 0.50
BInitMethod · 0.50
SetupTexturemapsMethod · 0.50
CreateAllShadersMethod · 0.50
SetupTexturemapsMethod · 0.50

Calls 2

beginMethod · 0.80
Path_GetSlashFunction · 0.70

Tested by

no test coverage detected