class final
#include <bsa/fo4.hpp>
archive Represents the FO4 revision of the ba2 format.
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.
Doxygen only
- auto doxygen_read() -> format protected
- void doxygen_write(format a_format, bool a_strings) const protected
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_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 archive.
-
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 givena_key
.
Reading
-
auto read(std::
filesystem:: path a_path) -> format - Reads the contents of the source.
-
auto read(std::
span<const std:: byte> a_src, copy_ type a_copy = copy_type:: deep) -> format - Reads the contents of the source.
Writing
-
void write(std::
filesystem:: path a_path, format a_format, bool a_strings = true) const - Writes the contents of the object to the destination.
- void write(binary_io::any_ostream& a_dst, format a_format, bool a_strings = true) const
- Writes the contents of the object to the destination.
Typedef documentation
using bsa:: fo4:: archive:: const_index = index_t<const mapped_ type>
#include <bsa/detail/common.hpp>
using bsa:: fo4:: archive:: const_iterator = typename container_type::const_iterator
#include <bsa/detail/common.hpp>
using bsa:: fo4:: archive:: index = index_t<mapped_ type>
#include <bsa/detail/common.hpp>
using bsa:: fo4:: archive:: iterator = typename container_type::iterator
#include <bsa/detail/common.hpp>
using bsa:: fo4:: archive:: key_compare = typename container_type::key_compare
#include <bsa/detail/common.hpp>
using bsa:: fo4:: archive:: key_type = typename T::key
#include <bsa/detail/common.hpp>
using bsa:: fo4:: archive:: mapped_type = file
#include <bsa/detail/common.hpp>
using bsa:: fo4:: archive:: value_type = std:: pair<const key_ type, mapped_ type>
#include <bsa/detail/common.hpp>
Function documentation
bool bsa:: fo4:: archive:: empty() const noexcept
#include <bsa/detail/common.hpp>
Checks if the container is empty.
std:: size_t bsa:: fo4:: archive:: size() const noexcept
#include <bsa/detail/common.hpp>
Returns the number of elements in the container.
format bsa:: fo4:: archive:: doxygen_read() protected
Returns | The format of the archive that was read. |
---|
void bsa:: fo4:: archive:: doxygen_write(format a_format,
bool a_strings) const protected
Parameters | |
---|---|
a_format | The format to write the archive in. |
a_strings | Controls whether the string table is written or not. |
iterator bsa:: fo4:: archive:: begin() noexcept
#include <bsa/detail/common.hpp>
Obtains an interator to the beginning of the container.
const_ iterator bsa:: fo4:: archive:: begin() const noexcept
#include <bsa/detail/common.hpp>
Obtains an interator to the beginning of the container.
const_ iterator bsa:: fo4:: archive:: cbegin() const noexcept
#include <bsa/detail/common.hpp>
Obtains an interator to the beginning of the container.
const_ iterator bsa:: fo4:: archive:: cend() const noexcept
#include <bsa/detail/common.hpp>
Obtains an iterator to the end of the container.
iterator bsa:: fo4:: archive:: end() noexcept
#include <bsa/detail/common.hpp>
Obtains an iterator to the end of the container.
const_ iterator bsa:: fo4:: archive:: end() const noexcept
#include <bsa/detail/common.hpp>
Obtains an iterator to the end of the container.
iterator bsa:: fo4:: archive:: find(const key_ type& a_key) noexcept
#include <bsa/detail/common.hpp>
Finds a value_type
with the given key within the container.
const_ iterator bsa:: fo4:: archive:: find(const key_ type& a_key) const noexcept
#include <bsa/detail/common.hpp>
Finds a value_type
with the given key within the container.
index bsa:: fo4:: archive:: operator[](const key_ type& a_key) noexcept
#include <bsa/detail/common.hpp>
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:: fo4:: archive:: operator[](const key_ type& a_key) const noexcept
#include <bsa/detail/common.hpp>
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:: fo4:: archive:: erase(const key_ type& a_key) noexcept
#include <bsa/detail/common.hpp>
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:: fo4:: archive:: insert(key_ type a_key,
mapped_ type a_value) noexcept
#include <bsa/detail/common.hpp>
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. |
format bsa:: fo4:: archive:: read(std:: filesystem:: path a_path)
Reads the contents of the source.
Parameters | |
---|---|
a_path | The path to the given archive on the native filesystem. |
Returns | The format of the archive that was read. |
Exceptions | |
binary_io::buffer_exhausted | Thrown when reads index out of bounds. |
bsa:: |
Thrown when archive parsing errors are encountered. |
std:: |
Thrown when filesystem errors are encountered. |
format bsa:: fo4:: archive:: read(std:: span<const std:: byte> a_src,
copy_ type a_copy = copy_type:: deep)
Reads the contents of the source.
Parameters | |
---|---|
a_src | The source to read from. |
a_copy | The method to use when copying data from a_src . |
Returns | The format of the archive that was read. |
Exceptions | |
binary_io::buffer_exhausted | Thrown when reads index out of bounds. |
bsa:: |
Thrown when archive parsing errors are encountered. |
void bsa:: fo4:: archive:: write(std:: filesystem:: path a_path,
format a_format,
bool a_strings = true) const
Writes the contents of the object to the destination.
Parameters | |
---|---|
a_path | The path to write the archive to on the native filesystem. |
a_format | The format to write the archive in. |
a_strings | Controls whether the string table is written or not. |
Exceptions | |
std:: |
Thrown when filesystem errors are encountered. |
binary_io::buffer_exhausted | Thrown when the output buffer is exhausted. |
void bsa:: fo4:: archive:: write(binary_io::any_ostream& a_dst,
format a_format,
bool a_strings = true) const
Writes the contents of the object to the destination.
Parameters | |
---|---|
a_dst | The stream to write the archive to. |
a_format | The format to write the archive in. |
a_strings | Controls whether the string table is written or not. |
Exceptions | |
std:: |
Thrown when filesystem errors are encountered. |
binary_io::buffer_exhausted | Thrown when the output buffer is exhausted. |