Filesystem paths - Path style support

This commit is contained in:
Emmanuel BENOîT 2018-12-23 18:17:55 +01:00
parent 96d81b9cd3
commit fc3415047f
4 changed files with 114 additions and 82 deletions
include/ebcl/inline

View file

@ -32,6 +32,11 @@ inline T_FSPathStyle& T_FSPathStyle::swap(
return *this;
}
inline M_DEFINE_SWAP( T_FSPathStyle )
{
lhs.swap( rhs );
}
/*----------------------------------------------------------------------------*/
inline constexpr bool T_FSPathStyle::caseSensitive( ) const noexcept
@ -104,21 +109,22 @@ inline constexpr T_FSPathStyle T_FSPathStyle::System( )
/*= T_FSPath =================================================================*/
inline T_FSPath::T_FSPath( ) noexcept
: root_{ } , components_{ } , valid_{ true }
inline T_FSPath::T_FSPath( T_FSPathStyle style ) noexcept
: style_{ style } , root_{ } , components_{ } , valid_{ true }
{ }
/*----------------------------------------------------------------------------*/
inline T_FSPath::T_FSPath(
T_FSPath const& other ) noexcept
: root_{ other.root_ } , components_{ other.components_ } ,
valid_{ other.valid_ }
: style_{ other.style_ } , root_{ other.root_ } ,
components_{ other.components_ } , valid_{ other.valid_ }
{ }
inline T_FSPath& T_FSPath::operator =(
T_FSPath const& other ) noexcept
{
style_ = other.style_;
root_ = other.root_;
components_ = other.components_;
valid_ = other.valid_;
@ -166,6 +172,11 @@ inline bool T_FSPath::isValid( ) const noexcept
return valid_;
}
inline T_FSPathStyle const& T_FSPath::style( ) const noexcept
{
return style_;
}
inline T_String const& T_FSPath::root( ) const noexcept
{
return root_;
@ -188,10 +199,11 @@ inline bool T_FSPath::isAbsolute( ) const noexcept
/*----------------------------------------------------------------------------*/
inline T_String T_FSPath::toString( ) const noexcept
inline T_String T_FSPath::toString(
T_OptPathSeparator separator ) const noexcept
{
T_StringBuilder sb;
appendTo( sb );
appendTo( sb , separator );
return T_String{ std::move( sb ) };
}