Manages asset metadata and provides functionality for adding, removing, and querying assets.
More...
#include <asset_storage.h>
|
struct | meta |
| Metadata information for an asset including its location. More...
|
|
|
using | database_t = std::map<hpp::uuid, meta> |
| Type definition for the asset database.
|
|
|
auto | get_database () const -> const database_t & |
| Gets the entire asset database.
|
|
void | set_database (const database_t &rhs) |
| Sets the asset database.
|
|
void | remove_all () |
| Removes all assets from the database.
|
|
auto | add_asset (const std::string &location, const asset_meta &meta, bool override) -> hpp::uuid |
| Adds an asset to the database.
|
|
auto | get_uuid (const std::string &location) const -> const hpp::uuid & |
| Gets the UUID of an asset based on its location.
|
|
auto | get_metadata (const hpp::uuid &id) const -> const meta & |
| Gets the metadata of an asset based on its UUID.
|
|
void | rename_asset (const std::string &key, const std::string &new_key) |
| Renames an asset.
|
|
void | remove_asset (const std::string &key) |
| Removes an asset from the database.
|
|
|
static auto | generate_id (const fs::path &p) -> hpp::uuid |
| Generates a UUID based on the file path.
|
|
Manages asset metadata and provides functionality for adding, removing, and querying assets.
Definition at line 139 of file asset_storage.h.
◆ database_t
◆ add_asset()
auto unravel::asset_database::add_asset |
( |
const std::string & | location, |
|
|
const asset_meta & | meta, |
|
|
bool | override ) -> hpp::uuid
|
|
inline |
Adds an asset to the database.
- Parameters
-
location | The location of the asset. |
meta | The metadata of the asset. |
- Returns
- The UUID of the added asset.
Definition at line 201 of file asset_storage.h.
◆ generate_id()
static auto unravel::asset_database::generate_id |
( |
const fs::path & | p | ) |
-> hpp::uuid
|
|
inlinestatic |
Generates a UUID based on the file path.
- Parameters
-
- Returns
- The generated UUID.
Definition at line 162 of file asset_storage.h.
◆ get_database()
auto unravel::asset_database::get_database |
( |
| ) |
const -> const database_t&
|
|
inline |
Gets the entire asset database.
- Returns
- A constant reference to the asset database.
Definition at line 171 of file asset_storage.h.
◆ get_metadata()
auto unravel::asset_database::get_metadata |
( |
const hpp::uuid & | id | ) |
const -> const meta&
|
|
inline |
Gets the metadata of an asset based on its UUID.
- Parameters
-
- Returns
- The metadata of the asset.
Definition at line 255 of file asset_storage.h.
◆ get_uuid()
auto unravel::asset_database::get_uuid |
( |
const std::string & | location | ) |
const -> const hpp::uuid&
|
|
inline |
Gets the UUID of an asset based on its location.
- Parameters
-
location | The location of the asset. |
- Returns
- The UUID of the asset.
Definition at line 232 of file asset_storage.h.
◆ remove_all()
void unravel::asset_database::remove_all |
( |
| ) |
|
|
inline |
◆ remove_asset()
void unravel::asset_database::remove_asset |
( |
const std::string & | key | ) |
|
|
inline |
Removes an asset from the database.
- Parameters
-
key | The key of the asset to remove. |
Definition at line 294 of file asset_storage.h.
◆ rename_asset()
void unravel::asset_database::rename_asset |
( |
const std::string & | key, |
|
|
const std::string & | new_key ) |
|
inline |
Renames an asset.
- Parameters
-
key | The current key of the asset. |
new_key | The new key for the asset. |
Definition at line 274 of file asset_storage.h.
◆ set_database()
void unravel::asset_database::set_database |
( |
const database_t & | rhs | ) |
|
|
inline |
Sets the asset database.
- Parameters
-
rhs | The asset database to set. |
Definition at line 180 of file asset_storage.h.
The documentation for this class was generated from the following file:
- C:/Workspace/github/UnravelEngine/UnravelEngine/engine/engine/assets/asset_storage.h