46 Path(
const std::string& path)
62 namespace StreamFlags {
82 virtual void read(
void*,
size_t) {}
83 virtual void write(
const void*,
size_t) {}
85 virtual size_t get_size(
void)
const {
return 0; }
92 const size_t size = this->
get_size();
94 str.resize(size + 1,
' ');
95 this->
read(&str[0], size);
106 virtual void close();
107 virtual void read(
void* buf,
size_t n);
108 virtual void write(
const void* buf,
size_t n);
110 virtual size_t get_size(
void)
const;
118 virtual const char*
what() const noexcept {
119 return buffer.c_str();
127 std::vector<std::shared_ptr<Eng3D::IO::Asset::Base>>
assets;
142 std::vector<std::string>
get_paths(
void)
const;
PackageException(const std::string &_buffer)
virtual const char * what() const noexcept
std::vector< std::shared_ptr< Eng3D::IO::Asset::Base > > get_multiple(const Eng3D::IO::Path &path)
Obtains multiple assets iff they share a common path (useful for concating files that might clash,...
void recursive_filesystem_walk(Eng3D::IO::Package &package, const std::string &root, const std::string ¤t)
~PackageManager()=default
std::vector< Package > packages
std::vector< std::shared_ptr< Eng3D::IO::Asset::Base > > get_multiple_prefix(const Eng3D::IO::Path &path)
Obtains all assets starting with a given prefix.
std::vector< std::string > get_paths(void) const
Obtain all the paths that are currently under the management of a package, that is return the absolut...
std::shared_ptr< Eng3D::IO::Asset::Base > get_unique(const Eng3D::IO::Path &path)
Obtaining an unique asset means the "first-found" policy applies.
Implements the I/O functions for interacting with assets, please note that this is however outdated b...
virtual void write(const void *, size_t)
virtual size_t get_size(void) const
virtual void seek(Eng3D::IO::SeekType, int)
std::string get_abs_path() const
Get the abs path object in a safe manner, such as that the access does not occur on null pointers....
virtual void read(void *, size_t)
std::string read_all(void)
Read the entire file into a string.
A "file" version of the base asset, mostly to identify an asset on a physical disk.
virtual void write(const void *buf, size_t n)
virtual void seek(Eng3D::IO::SeekType type, int offset)
virtual void read(void *buf, size_t n)
virtual size_t get_size(void) const
A package containing a set of assets.
std::vector< std::shared_ptr< Eng3D::IO::Asset::Base > > user_assets
std::vector< std::shared_ptr< Eng3D::IO::Asset::Base > > assets
std::string user_abs_path
The path class abstracts away most of the burden from handling system-dependant filesystem paths.
Path(const std::string &path)