17#if __has_include("defs.h")
30 asset (
int id_,
const std::filesystem::path& name_ = std::filesystem::path (),
31 bool persist =
false);
40 bool write (
const std::filesystem::path& root_path);
46 std::filesystem::path
name;
56 std::filesystem::path fullpath;
67asset::asset (
int id_,
const std::filesystem::path& name_,
bool persist)
96 return std::filesystem::remove (fullpath);
~asset()
Destructor. Delete asset file if it exists and is not persistent.
Definition asset.h:79
bool write(const std::filesystem::path &root_path)
Write the asset to a folder.
Definition asset.cpp:60
asset(int id_, const std::filesystem::path &name_=std::filesystem::path(), bool persist=false)
Constructor for an asset object.
Definition asset.h:67
std::filesystem::path name
Relative asset name.
Definition asset.h:46
size_t size()
Return size of asset data or 0 if asset could not be loaded.
Definition asset.h:103
const void * data()
Load asset data and return a pointer to it.
Definition asset.h:112
bool remove()
Delete asset file from disk.
Definition asset.h:91