----------------------------------------------------------------------------------------------------- Purpose: Strips off file:// off a URL and returns the path. For other kinds of URLs an empty string is returned -----------------------------------------------------------------------------------------------------
| 906 | // Purpose: Strips off file:// off a URL and returns the path. For other kinds of URLs an empty string is returned |
| 907 | // ----------------------------------------------------------------------------------------------------- |
| 908 | std::string Path_UrlToFilePath( const std::string & sFileUrl ) |
| 909 | { |
| 910 | if ( !strnicmp( sFileUrl.c_str(), FILE_URL_PREFIX, strlen( FILE_URL_PREFIX ) ) ) |
| 911 | { |
| 912 | char *pchBuffer = (char *)alloca( sFileUrl.length() ); |
| 913 | V_URLDecodeNoPlusForSpace( pchBuffer, (int)sFileUrl.length(), |
| 914 | sFileUrl.c_str() + strlen( FILE_URL_PREFIX ), (int)( sFileUrl.length() - strlen( FILE_URL_PREFIX ) ) ); |
| 915 | |
| 916 | return Path_FixSlashes( pchBuffer ); |
| 917 | } |
| 918 | else |
| 919 | { |
| 920 | return ""; |
| 921 | } |
| 922 | } |
| 923 | |
| 924 | |
| 925 | // ----------------------------------------------------------------------------------------------------- |
nothing calls this directly
no test coverage detected