Blender V5.3
blender::asset_system::AssetCatalogTree Class Reference

#include <AS_asset_catalog_tree.hh>

Public Member Functions

void insert_item (const AssetCatalog &catalog, std::optional< StringRef > skip_prefix=std::nullopt)
void foreach_item (ItemIterFn callback) const
void foreach_root_item (ItemIterFn callback) const
bool is_empty () const
const AssetCatalogTreeItem * find_item (const AssetCatalogPath &path) const
const AssetCatalogTreeItem * find_root_item (const AssetCatalogPath &path) const

Detailed Description

Definition at line 86 of file AS_asset_catalog_tree.hh.

Member Function Documentation

◆ find_item()

◆ find_root_item()

const AssetCatalogTreeItem * blender::asset_system::AssetCatalogTree::find_root_item ( const AssetCatalogPath & path) const

◆ foreach_item()

void blender::asset_system::AssetCatalogTree::foreach_item ( AssetCatalogTreeItem::ItemIterFn callback) const

◆ foreach_root_item()

void blender::asset_system::AssetCatalogTree::foreach_root_item ( ItemIterFn callback) const

◆ insert_item()

void blender::asset_system::AssetCatalogTree::insert_item ( const AssetCatalog & catalog,
std::optional< StringRef > skip_prefix = std::nullopt )

Ensure an item representing catalog is in the tree, adding it if necessary.

Parameters
skip_prefixIf set and the catalog path starts with this prefix path, the prefix path will be stripped, and the catalog will be inserted into the tree as if it started after this prefix. For example if the path of catalog is "Lorem ipsum/dolor/sit", and skip_prefix is set to "Lorem ipsum/dolor", then the catalog will be inserted as if the path was "sit". Catalogs whose path do not start with the prefix will be unaffected.

Definition at line 86 of file asset_catalog_tree.cc.

References blender::asset_system::AssetCatalogTreeItem::AssetCatalogTreeItem(), BLI_assert_msg, blender::BLI_uuid_is_nil(), blender::asset_system::AssetCatalog::catalog_id, ELEM, blender::asset_system::AssetCatalog::flags, blender::asset_system::AssetCatalog::Flags::has_unsaved_changes, blender::asset_system::AssetCatalog::Flags::is_first_loaded, blender::asset_system::AssetCatalogPath::iterate_components(), blender::asset_system::AssetCatalog::path, blender::asset_system::AssetCatalogPath::SEPARATOR, blender::asset_system::AssetCatalog::simple_name, blender::blender::StringRefBase::size(), and blender::asset_system::AssetCatalogPath::str().

Referenced by blender::asset_system::tests::TEST_F(), and blender::asset_system::tests::TEST_F().

◆ is_empty()


The documentation for this class was generated from the following files: