returns just the filename with no extension of the provided filename. * If there is a path the path is left intact. */
| 168 | /** returns just the filename with no extension of the provided filename. |
| 169 | * If there is a path the path is left intact. */ |
| 170 | std::string Path_StripExtension( const std::string & sPath ) |
| 171 | { |
| 172 | for( std::string::const_reverse_iterator i = sPath.rbegin(); i != sPath.rend(); i++ ) |
| 173 | { |
| 174 | if( *i == '.' ) |
| 175 | { |
| 176 | return std::string( sPath.begin(), i.base() - 1 ); |
| 177 | } |
| 178 | |
| 179 | // if we find a slash there is no extension |
| 180 | if( *i == '\\' || *i == '/' ) |
| 181 | break; |
| 182 | } |
| 183 | |
| 184 | // we didn't find an extension |
| 185 | return sPath; |
| 186 | } |
| 187 | |
| 188 | /** returns just extension of the provided filename (if any). */ |
| 189 | std::string Path_GetExtension( const std::string & sPath ) |
no test coverage detected