nw::Erf

struct Erf

Public Functions

Erf() = default
explicit Erf(const std::filesystem::path &path)
Erf(const Erf&) = delete
Erf(Erf &&other) = default
~Erf()
bool add(Resource res, const ByteArray &bytes)

Adds resources from array of bytes.

bool add(const std::filesystem::path &path)

Adds resources from path.

size_t erase(const Resource &res)

Removes resource.

int extract(const std::regex &pattern, const std::filesystem::path &output) const

Extracts assets by regex.

bool merge(const Container *container)

Merges the contents of another container.

bool merge(const Erf &container)

Merges the contents of another container.

bool reload()

Reloads Erf

Note

Erf::working_directory() will not change

bool save() const

Saves Erf to Erf::path()

Note

It’s probably best to call Erf::reload after save.

bool save_as(const std::filesystem::path &path) const

Saves Erf to different path

Note

Current Erf unmodified, to load Erf at new path a new Erf must be constructed.

ResourceData demand(Resource res) const
inline const String &name() const
inline const String &path() const
size_t size() const
inline bool valid() const noexcept
void visit(std::function<void(const Resource&)> callback, std::initializer_list<ResourceType::type> types = {}) const noexcept
Erf &operator=(const Erf&) = delete
Erf &operator=(Erf&&) = default
const std::filesystem::path &working_directory() const

Get container working directory.

Public Members

ErfType type = ErfType::erf

Erf type.

ErfVersion version = ErfVersion::v1_0

Version.

LocString description

Description.