nw::Container
-
struct Container
Base class for all containers.
Subclassed by nw::Directory, nw::Erf, nw::Key, nw::NWSyncManifest, nw::StaticDirectory, nw::Zip, nw::kernel::Resources
Public Functions
-
Container()
-
virtual ~Container()
-
virtual Vector<ResourceDescriptor> all() const = 0
Get all resources.
-
virtual ResourceData demand(Resource res) const = 0
Reads resource data, empty ResourceData if no match.
-
virtual int extract_by_glob(StringView glob, const std::filesystem::path &output) const
Extract elements from a container by glob pattern.
-
virtual int extract(const std::regex &pattern, const std::filesystem::path &output) const = 0
Extract elements from a container by regex.
-
virtual const String &path() const = 0
Path to container, for basic containers, should be canonical.
-
virtual size_t size() const = 0
Determines the size, if applicable, of the container.
-
virtual ResourceDescriptor stat(const Resource &res) const = 0
Get some general data about a resource.
-
virtual bool valid() const noexcept = 0
Return true if loaded, false if not.
-
virtual void visit(std::function<void(const Resource&)> callback, std::initializer_list<ResourceType::type> types = {}) const noexcept = 0
Visits all resources in a container.
-
const std::filesystem::path &working_directory() const
Get container working directory.
-
Container()