bsa::tes4::directory class final

Represents a directory within the TES4 virtual filesystem.

Base classes

template<class T, bool RECURSE>
class bsa::components::hashmap<file>
Establishes a basic mapping between a key and its associated files.

Capacity

auto empty() const -> bool noexcept
Checks if the container is empty.
auto size() const -> std::size_t noexcept
Returns the number of elements in the container.

Iterators

auto begin() -> iterator noexcept
Obtains an interator to the beginning of the container.
auto begin() const -> const_iterator noexcept
Obtains an interator to the beginning of the container.
auto cbegin() const -> const_iterator noexcept
Obtains an interator to the beginning of the container.
auto cend() const -> const_iterator noexcept
Obtains an iterator to the end of the container.
auto end() -> iterator noexcept
Obtains an iterator to the end of the container.
auto end() const -> const_iterator noexcept
Obtains an iterator to the end of the container.

Lookup

auto find(const key_type& a_key) -> iterator noexcept
Finds a value_type with the given key within the container.
auto find(const key_type& a_key) const -> const_iterator noexcept
Finds a value_type with the given key within the container.
auto operator[](const key_type& a_key) -> index noexcept
Obtains a proxy to the underlying mapped_type. The validity of the proxy depends on the presence of the key within the container.
auto operator[](const key_type& a_key) const -> const_index noexcept
Obtains a proxy to the underlying mapped_type. The validity of the proxy depends on the presence of the key within the container.

Member types

using const_index = index_t<const mapped_type>
using const_iterator = typename container_type::const_iterator
using index = index_t<mapped_type>
using iterator = typename container_type::iterator
using key = components::key<hashing::hash, hashing::hash_directory_in_place>
The key used to indentify a directory.
using key_compare = typename container_type::key_compare
using key_type = typename T::key
using mapped_type = file
using value_type = std::pair<const key_type, mapped_type>

Modifiers

void clear() noexcept
Clears the contents of the directory.
auto erase(const key_type& a_key) -> bool noexcept
Erases any element with the given key from the container.
auto insert(key_type a_key, mapped_type a_value) -> std::pair<iterator, bool> noexcept
Inserts a_value into the container with the given a_key.

Typedef documentation

using bsa::tes4::directory::const_index = index_t<const mapped_type>

using bsa::tes4::directory::const_iterator = typename container_type::const_iterator

using bsa::tes4::directory::index = index_t<mapped_type>

using bsa::tes4::directory::iterator = typename container_type::iterator

using bsa::tes4::directory::key_compare = typename container_type::key_compare

using bsa::tes4::directory::key_type = typename T::key

using bsa::tes4::directory::mapped_type = file

using bsa::tes4::directory::value_type = std::pair<const key_type, mapped_type>

Function documentation

bool bsa::tes4::directory::empty() const noexcept

Checks if the container is empty.

std::size_t bsa::tes4::directory::size() const noexcept

Returns the number of elements in the container.

iterator bsa::tes4::directory::begin() noexcept

Obtains an interator to the beginning of the container.

const_iterator bsa::tes4::directory::begin() const noexcept

Obtains an interator to the beginning of the container.

const_iterator bsa::tes4::directory::cbegin() const noexcept

Obtains an interator to the beginning of the container.

const_iterator bsa::tes4::directory::cend() const noexcept

Obtains an iterator to the end of the container.

iterator bsa::tes4::directory::end() noexcept

Obtains an iterator to the end of the container.

const_iterator bsa::tes4::directory::end() const noexcept

Obtains an iterator to the end of the container.

iterator bsa::tes4::directory::find(const key_type& a_key) noexcept

Finds a value_type with the given key within the container.

const_iterator bsa::tes4::directory::find(const key_type& a_key) const noexcept

Finds a value_type with the given key within the container.

index bsa::tes4::directory::operator[](const key_type& a_key) noexcept

Obtains a proxy to the underlying mapped_type. The validity of the proxy depends on the presence of the key within the container.

const_index bsa::tes4::directory::operator[](const key_type& a_key) const noexcept

Obtains a proxy to the underlying mapped_type. The validity of the proxy depends on the presence of the key within the container.

bool bsa::tes4::directory::erase(const key_type& a_key) noexcept

Erases any element with the given key from the container.

Returns Returns true if the element was successfully deleted, false otherwise.

std::pair<iterator, bool> bsa::tes4::directory::insert(key_type a_key, mapped_type a_value) noexcept

Inserts a_value into the container with the given a_key.

Parameters
a_key The key of the value_type.
a_value The value of the value_type.
Returns Returns an iterator to the position at which the given value_type was inserted, and a bool to indicate if the insertion was successful.