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

Function Path_UrlToFilePath

samples/shared/pathtools.cpp:768–780  ·  view source on GitHub ↗

----------------------------------------------------------------------------------------------------- Purpose: Strips off file:// off a URL and returns the path. For other kinds of URLs an empty string is returned -----------------------------------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

766// Purpose: Strips off file:// off a URL and returns the path. For other kinds of URLs an empty string is returned
767// -----------------------------------------------------------------------------------------------------
768std::string Path_UrlToFilePath( const std::string & sFileUrl )
769{
770 if ( !strnicmp( sFileUrl.c_str(), FILE_URL_PREFIX, strlen( FILE_URL_PREFIX ) ) )
771 {
772 std::string sRet = sFileUrl.c_str() + strlen( FILE_URL_PREFIX );
773 sRet = Path_FixSlashes( sRet );
774 return sRet;
775 }
776 else
777 {
778 return "";
779 }
780}
781
782
783// -----------------------------------------------------------------------------------------------------

Callers

nothing calls this directly

Calls 2

strnicmpFunction · 0.70
Path_FixSlashesFunction · 0.70

Tested by

no test coverage detected