returns just the filename from the provided full or relative path. */
| 113 | |
| 114 | /** returns just the filename from the provided full or relative path. */ |
| 115 | std::string Path_StripDirectory( const std::string & sPath, char slash ) |
| 116 | { |
| 117 | if( slash == 0 ) |
| 118 | slash = Path_GetSlash(); |
| 119 | |
| 120 | std::string::size_type n = sPath.find_last_of( slash ); |
| 121 | if( n == std::string::npos ) |
| 122 | return sPath; |
| 123 | else |
| 124 | return std::string( sPath.begin() + n + 1, sPath.end() ); |
| 125 | } |
| 126 | |
| 127 | /** returns just the filename with no extension of the provided filename. |
| 128 | * If there is a path the path is left intact. */ |
no test coverage detected