Returns the specified path without its filename */
| 100 | |
| 101 | /** Returns the specified path without its filename */ |
| 102 | std::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. */ |
| 115 | std::string Path_StripDirectory( const std::string & sPath, char slash ) |
no test coverage detected