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

Function Path_GetExtension

samples/shared/pathtools.cpp:148–164  ·  view source on GitHub ↗

returns just extension of the provided filename (if any). */

Source from the content-addressed store, hash-verified

146
147/** returns just extension of the provided filename (if any). */
148std::string Path_GetExtension( const std::string & sPath )
149{
150 for ( std::string::const_reverse_iterator i = sPath.rbegin(); i != sPath.rend(); i++ )
151 {
152 if ( *i == '.' )
153 {
154 return std::string( i.base(), sPath.end() );
155 }
156
157 // if we find a slash there is no extension
158 if ( *i == '\\' || *i == '/' )
159 break;
160 }
161
162 // we didn't find an extension
163 return "";
164}
165
166bool Path_IsAbsolute( const std::string & sPath )
167{

Callers

nothing calls this directly

Calls 1

endMethod · 0.80

Tested by

no test coverage detected