add and use class PathExtensionless

This commit is contained in:
Garux
2021-01-21 15:15:07 +03:00
parent 7fc079c658
commit 8b204ac054
7 changed files with 27 additions and 21 deletions

View File

@@ -207,6 +207,21 @@ inline MatchFileExtension<Functor> matchFileExtension( const char* extension, co
return MatchFileExtension<Functor>( extension, functor );
}
class PathExtensionless
{
public:
const char* m_path;
PathExtensionless( const char* path ) : m_path( path ){
}
};
/// \brief Writes \p path to \p ostream without .ext part.
template<typename TextOutputStreamType>
TextOutputStreamType& ostream_write( TextOutputStreamType& ostream, const PathExtensionless& path ){
ostream << StringRange( path.m_path, path_get_filename_base_end( path.m_path ) );
return ostream;
}
class PathCleaned
{
public: