include/llfio/v2.0/path_view.hpp
//! Returns a view of the file extension part of this view
Returns a view of the file extension part of this view
Returns a view of the file extension part of this view
LLFIO_PATH_VIEW_CONSTEXPR path_view_component extension() const noexcept
  {
    auto self = _filename();
    return self._invoke([this](const auto &v) {
      auto dot_idx = v.rfind('.');
      if(_npos == dot_idx || dot_idx == 0 || (dot_idx == 1 && v[dot_idx - 1] == '.'))
      {
        return path_view_component();
      }
      return path_view_component(v.data() + dot_idx, v.size() - dot_idx, zero_termination());
    });
  }
LLFIO_PATH_VIEW_CONSTEXPR path_view_component extension ( ) const noexcept { auto self = _filename ( ) ; return self . _invoke ( [ this ] ( const auto & v ) { auto dot_idx = v . rfind ( ' ' ) ; if ( _npos == dot_idx || dot_idx == 0 || ( dot_idx == 1 && v [ dot_idx - 1 ] == ' ' ) ) { return path_view_component ( ) ; } return path_view_component ( v . data ( ) + dot_idx , v . size ( ) - dot_idx , zero_termination ( ) ) ; } ) ; }
Returns a view of the file extension part of this view
Returns a view of the file extension part of this view