Death::IO::FileSystem::Directory class

Handles directory traversal, should be used as iterator.

Constructors, destructors, conversion operators

Directory() noexcept
Directory(Containers::StringView path, EnumerationOptions options = EnumerationOptions::None)
~Directory()
Directory(const Directory& other)
Directory(Directory&& other) noexcept

Public functions

auto operator=(const Directory& other) -> Directory&
auto operator=(Directory&& other) -> Directory& noexcept
auto operator*() const & -> Containers::StringView noexcept
auto operator++() -> Directory&
auto operator++(int) -> Proxy
auto operator==(const Directory& other) const -> bool
auto operator!=(const Directory& other) const -> bool
auto begin() -> Directory noexcept
auto end() -> Directory noexcept
auto TryGetEntryInfo(EntryInfo& info) const -> bool
Retrieves properties of the current entry.
auto HasError() const -> bool noexcept
Returns.

Function documentation

bool Death::IO::FileSystem::Directory::TryGetEntryInfo(EntryInfo& info) const

Retrieves properties of the current entry.

On Windows, the properties come with the enumeration itself, so no additional file system access is needed. On other platforms, the entry is queried without following symbolic links, a link is followed only to tell whether it points to a directory. Returns false and leaves info at its defaults if there is no current entry or the properties are not available on the platform.

bool Death::IO::FileSystem::Directory::HasError() const noexcept

Returns.

true if the directory could not be opened or the enumeration failed

The enumeration stops in both cases, the same way as at the end of the directory, so this distinguishes a failure from an empty or fully enumerated directory. All copies of the iterator share the state.