UNISTDX_FS_CANONICAL_PATH
using canonical_path = basic_canonical_path< char >

Specialisation of basic_canonical_path for char.

template <class Ch, class Tr = std::char_traits<Ch>, class Alloc = std::allocator<Ch>>
class sys::basic_canonical_path

Canonical path that is always absolute and real.

Ch
character type

Tr
character traits type

Alloc
allocator type

Canonical path is a path that
  • contains no special directories "." and "..",
  • contains only one separator per component,
  • contains no symbolic links.

Base classes
Types
  • using string_type = std::basic_string< Ch, Tr, Alloc >

    String type.

  • using path_type = basic_path< Ch, Tr, Alloc >

    Non-canonical path type.

Methods
  • swap(basic_canonical_path & rhs) -> void

    Swap with rhs.

  • is_relative_to(const basic_canonical_path & root) -> bool

    Returns true, if this canonical path is relative to directory root.

  • dirname() const -> basic_canonical_path

    Returns all path components except the last.

  • basename() const -> path_type

    Returns the last path component.

  • operator=(const basic_canonical_path &) -> basic_canonical_path &

    Copy-assignment.

  • operator=(basic_canonical_path &&) -> basic_canonical_path &

    Move-assignment.

  • basic_canonical_path(const char * rhs)explicit

    Constructor for const char*.

  • basic_canonical_path(path_type && rhs)explicit

    Move-constructor for path.

  • basic_canonical_path(const path_type & rhs)explicit

    Copy-constructor for path.

  • basic_canonical_path(const string_type & rhs)explicit

    Copy-constructor for string.

  • basic_canonical_path(string_type && rhs)explicit

    Move-constructor for string.

  • basic_canonical_path(const basic_canonical_path & rhs)

    Copy-constructor.

  • basic_canonical_path(basic_canonical_path && rhs)

    Move-constructor.

  • template <class A, class B>
    basic_canonical_path(A && dir, B && filename)

    Construct path from directory dir and file filename.

  • basic_canonical_path()
Friends
  • std::hash< basic_canonical_path >
template <class Ch, class Tr, class Alloc>
struct std::hash< sys::basic_canonical_path< Ch, Tr, Alloc > >

Specialisation of std::hash for sys::basic_canonical_path.

Base classes
  • public std::hash< std::basic_string< Ch, Tr, Alloc > >
Types
  • using argument_type = sys::basic_canonical_path< Ch, Tr, Alloc >

    Hash function argument type.

  • using result_type = size_t

    Hash function return value type.

Methods
template <class Ch, class Tr, class Alloc>
make_canonical(std::basic_string< Ch, Tr, Alloc > && rhs) -> std::unique_ptr< char[]>

Make path rhs canonical.

bad_call

make_canonical(const char * rhs) -> std::unique_ptr< char[]>

Make path rhs canonical.

bad_call

workdir() -> sys::canonical_path

Get canonical path to the working directory of the calling process.

template <class T>
make_canonical(const path & rhs) -> std::unique_ptr< char[]>

Make path rhs canonical.

bad_call

template <class T>
make_canonical(path && rhs) -> std::unique_ptr< char[]>

Make path rhs canonical.

bad_call

template <class Ch, class Tr, class Alloc>
make_canonical(const std::basic_string< Ch, Tr, Alloc > & rhs) -> std::unique_ptr< char[]>

Make path rhs canonical.

bad_call

template <class Ch, class Tr, class Alloc>
swap(basic_canonical_path< Ch, Tr, Alloc > & lhs, basic_canonical_path< Ch, Tr, Alloc > & rhs) -> void

Overload of std::swap for basic_canonical_path.