T_FSPathStyle - Most methods made constexpr
This commit is contained in:
parent
af1648dcb4
commit
96d81b9cd3
3 changed files with 54 additions and 42 deletions
include/ebcl/inline
|
@ -11,7 +11,7 @@ namespace ebcl {
|
|||
|
||||
/*= T_FSPathStyle ============================================================*/
|
||||
|
||||
inline T_FSPathStyle::T_FSPathStyle(
|
||||
inline constexpr T_FSPathStyle::T_FSPathStyle(
|
||||
bool cs ,
|
||||
bool hdl ,
|
||||
T_Flags< E_FSPathSeparator > ps ) noexcept
|
||||
|
@ -34,34 +34,34 @@ inline T_FSPathStyle& T_FSPathStyle::swap(
|
|||
|
||||
/*----------------------------------------------------------------------------*/
|
||||
|
||||
inline bool T_FSPathStyle::caseSensitive( ) const noexcept
|
||||
inline constexpr bool T_FSPathStyle::caseSensitive( ) const noexcept
|
||||
{
|
||||
return caseSensitive_;
|
||||
}
|
||||
|
||||
inline T_FSPathStyle& T_FSPathStyle::caseSensitive( bool cs ) noexcept
|
||||
inline constexpr T_FSPathStyle& T_FSPathStyle::caseSensitive( bool cs ) noexcept
|
||||
{
|
||||
caseSensitive_ = cs;
|
||||
return *this;
|
||||
}
|
||||
|
||||
inline bool T_FSPathStyle::hasDriveLetter( ) const noexcept
|
||||
inline constexpr bool T_FSPathStyle::hasDriveLetter( ) const noexcept
|
||||
{
|
||||
return hasDriveLetter_;
|
||||
}
|
||||
|
||||
inline T_FSPathStyle& T_FSPathStyle::hasDriveLetter( bool hdl ) noexcept
|
||||
inline constexpr T_FSPathStyle& T_FSPathStyle::hasDriveLetter( bool hdl ) noexcept
|
||||
{
|
||||
hasDriveLetter_ = hdl;
|
||||
return *this;
|
||||
}
|
||||
|
||||
inline T_Flags< E_FSPathSeparator > T_FSPathStyle::pathSeparators( ) const noexcept
|
||||
inline constexpr T_Flags< E_FSPathSeparator > T_FSPathStyle::pathSeparators( ) const noexcept
|
||||
{
|
||||
return pathSeparators_;
|
||||
}
|
||||
|
||||
inline T_FSPathStyle& T_FSPathStyle::pathSeparator(
|
||||
inline constexpr T_FSPathStyle& T_FSPathStyle::pathSeparator(
|
||||
T_Flags< E_FSPathSeparator > ps ) noexcept
|
||||
{
|
||||
assert( ps );
|
||||
|
@ -71,19 +71,28 @@ inline T_FSPathStyle& T_FSPathStyle::pathSeparator(
|
|||
|
||||
/*----------------------------------------------------------------------------*/
|
||||
|
||||
inline T_FSPathStyle T_FSPathStyle::Unix( )
|
||||
inline constexpr bool T_FSPathStyle::isSeparator(
|
||||
const T_Character chr ) const noexcept
|
||||
{
|
||||
return ( ( pathSeparators_ & E_FSPathSeparator::SLASH ) && chr == '/' )
|
||||
|| ( ( pathSeparators_ & E_FSPathSeparator::SLASH ) && chr == '\\' );
|
||||
}
|
||||
|
||||
/*----------------------------------------------------------------------------*/
|
||||
|
||||
inline constexpr T_FSPathStyle T_FSPathStyle::Unix( )
|
||||
{
|
||||
return T_FSPathStyle{ true , false ,
|
||||
T_Flags< E_FSPathSeparator >{ E_FSPathSeparator::SLASH } };
|
||||
}
|
||||
|
||||
inline T_FSPathStyle T_FSPathStyle::Windows( )
|
||||
inline constexpr T_FSPathStyle T_FSPathStyle::Windows( )
|
||||
{
|
||||
return T_FSPathStyle{ false , true ,
|
||||
T_Flags< E_FSPathSeparator >{ E_FSPathSeparator::BACKSLASH } };
|
||||
}
|
||||
|
||||
inline T_FSPathStyle T_FSPathStyle::System( )
|
||||
inline constexpr T_FSPathStyle T_FSPathStyle::System( )
|
||||
{
|
||||
#ifdef _WIN32
|
||||
return T_FSPathStyle::Windows( );
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue