Boost C++ Libraries

PrevUpHomeNext

Function file_extension

boost::taar::file_extension — The last extension of filename, lowercased and without the dot.

Synopsis

// In header: <boost/taar/core/mime.hpp>


std::string file_extension(std::string_view filename);

Description

Only the final path segment is considered: a.b/c has no extension, archive.tar.gz has gz, and a leading dot (.profile) does not start an extension. Returns an empty string when there is none.


PrevUpHomeNext