Handles asset data management, file operations, and state.
More...
#include <AssetManager.h>
|
void | Initialize () |
| Initialize the asset manager.
|
|
std::vector< AssetItem > | GetDirectoryContents (const std::filesystem::path &directory, bool isGlobal, const AssetBrowserState &state) |
| Get directory contents as asset items.
|
|
bool | ShouldShowFile (const std::filesystem::path &path, const AssetBrowserState &state) |
| Check if a file should be displayed based on filters.
|
|
void | SortAssets (std::vector< AssetItem > &items, const std::string &sortBy, bool ascending) |
| Sort asset items based on criteria.
|
|
std::string | GetMimeType (const std::string &extension) |
| Get MIME type for a file.
|
|
std::string | GetFileCategory (const std::string &extension) |
| Get file category for UI purposes.
|
|
bool | CreateFolder (const std::filesystem::path &parentPath, const std::string &folderName) |
| Create a new folder at the specified location.
|
|
bool | CreateScript (const std::filesystem::path &parentPath, const std::string &scriptName, const std::string &scriptType) |
| Create a new script file.
|
|
bool | DeleteAsset (const std::filesystem::path &assetPath) |
| Delete an asset.
|
|
bool | RenameAsset (const std::filesystem::path &oldPath, const std::string &newName) |
| Rename an asset.
|
|
bool | CanDragAsset (const AssetItem &item) |
| Check if an asset can be dragged.
|
|
std::string | GetDragData (const AssetItem &item) |
| Get drag data for an asset.
|
|
Handles asset data management, file operations, and state.
◆ CanDragAsset()
bool Editor::Assets::AssetManager::CanDragAsset |
( |
const AssetItem & |
item | ) |
|
Check if an asset can be dragged.
- Parameters
-
- Returns
- True if draggable
◆ CreateFolder()
bool Editor::Assets::AssetManager::CreateFolder |
( |
const std::filesystem::path & |
parentPath, |
|
|
const std::string & |
folderName |
|
) |
| |
Create a new folder at the specified location.
- Parameters
-
parentPath | Parent directory |
folderName | Name of the new folder |
- Returns
- True if successful
◆ CreateScript()
bool Editor::Assets::AssetManager::CreateScript |
( |
const std::filesystem::path & |
parentPath, |
|
|
const std::string & |
scriptName, |
|
|
const std::string & |
scriptType |
|
) |
| |
Create a new script file.
- Parameters
-
parentPath | Parent directory |
scriptName | Name of the script |
scriptType | Type of script (C#, JavaScript, etc.) |
- Returns
- True if successful
◆ DeleteAsset()
bool Editor::Assets::AssetManager::DeleteAsset |
( |
const std::filesystem::path & |
assetPath | ) |
|
Delete an asset.
- Parameters
-
assetPath | Path to the asset |
- Returns
- True if successful
◆ GetDirectoryContents()
std::vector< AssetItem > Editor::Assets::AssetManager::GetDirectoryContents |
( |
const std::filesystem::path & |
directory, |
|
|
bool |
isGlobal, |
|
|
const AssetBrowserState & |
state |
|
) |
| |
Get directory contents as asset items.
- Parameters
-
directory | Directory to scan |
isGlobal | Whether these are global assets |
state | Browser state for filtering/sorting |
- Returns
- Vector of asset items
◆ GetDragData()
std::string Editor::Assets::AssetManager::GetDragData |
( |
const AssetItem & |
item | ) |
|
Get drag data for an asset.
- Parameters
-
- Returns
- Drag data string
◆ GetFileCategory()
std::string Editor::Assets::AssetManager::GetFileCategory |
( |
const std::string & |
extension | ) |
|
Get file category for UI purposes.
- Parameters
-
- Returns
- Category string (3D, Image, Audio, etc.)
◆ GetMimeType()
std::string Editor::Assets::AssetManager::GetMimeType |
( |
const std::string & |
extension | ) |
|
Get MIME type for a file.
- Parameters
-
- Returns
- MIME type string
◆ Initialize()
void Editor::Assets::AssetManager::Initialize |
( |
| ) |
|
Initialize the asset manager.
◆ RenameAsset()
bool Editor::Assets::AssetManager::RenameAsset |
( |
const std::filesystem::path & |
oldPath, |
|
|
const std::string & |
newName |
|
) |
| |
Rename an asset.
- Parameters
-
oldPath | Current path |
newName | New name |
- Returns
- True if successful
◆ ShouldShowFile()
bool Editor::Assets::AssetManager::ShouldShowFile |
( |
const std::filesystem::path & |
path, |
|
|
const AssetBrowserState & |
state |
|
) |
| |
Check if a file should be displayed based on filters.
- Parameters
-
path | File path to check |
state | Browser state with filters |
- Returns
- True if file should be shown
◆ SortAssets()
void Editor::Assets::AssetManager::SortAssets |
( |
std::vector< AssetItem > & |
items, |
|
|
const std::string & |
sortBy, |
|
|
bool |
ascending |
|
) |
| |
Sort asset items based on criteria.
- Parameters
-
items | Items to sort |
sortBy | Sort criteria |
ascending | Sort direction |
The documentation for this class was generated from the following files: