UNISTDX_FS_DIRECTORY_ENTRY
using inode_type = ::ino_t

Alias to ino_t system type.

using dirent_type = struct ::dirent

Alias to dirent system type.

class sys::directory_entry

Directory entry. A wrapper around dirent system type.

Base classes
  • public dirent_type
Methods
  • operator=(const directory_entry & rhs) -> directory_entry &

    Copy-assignment.

  • operator<(const directory_entry & rhs) const -> bool

    Compare entry file names.

  • operator!=(const directory_entry & rhs) const -> bool

    Compare entry file names.

  • operator==(const directory_entry & rhs) const -> bool

    Compare entry file names.

  • is_hidden() const -> bool

    Returns true, if the file is hidden (starts with a ".").

  • is_parent_dir() const -> bool

    Returns true, if entry refers to the parent directory "..".

  • is_working_dir() const -> bool

    Returns true, if entry refers to the current directory ".".

  • has_type() const -> bool

    Returns true, if entry has file type.

  • type() const -> file_type

    Get entry file type. Directory entry may not have file type set. Always check with has_type.

  • inode() const -> inode_type

    Get entry inode number.

  • name() const -> const char *

    Get entry file name.

  • ~directory_entry()
  • directory_entry(directory_entry &&)

    Move-constructor.

  • directory_entry(const directory_entry &)

    Copy-constructor.

  • directory_entry()
Friends
  • operator<<

    Print entry file name.

get_file_type(const path & dirname, const directory_entry & entry) -> file_type

Reliably get file type of a directory entry.

dirname
directory where entry is located

entry
directory entry

Falls back to file_status if directory entry itself does not have valid file type.