Blender V4.3
blender::asset_system::AssetCatalog Class Reference

#include <AS_asset_catalog.hh>

Classes

struct  Flags
 

Public Member Functions

 AssetCatalog ()=delete
 
 AssetCatalog (CatalogID catalog_id, const AssetCatalogPath &path, const std::string &simple_name)
 
void simple_name_refresh ()
 

Static Public Member Functions

static std::unique_ptr< AssetCatalogfrom_path (const AssetCatalogPath &path)
 

Public Attributes

const CatalogID catalog_id
 
AssetCatalogPath path
 
std::string simple_name
 
struct blender::asset_system::AssetCatalog::Flags flags
 

Static Protected Member Functions

static std::string sensible_simple_name_for_path (const AssetCatalogPath &path)
 

Detailed Description

Asset Catalog definition, containing a symbolic ID and a path that points to a node in the catalog hierarchy.

Warning
The asset system may reload catalogs, invalidating pointers. Thus it's not recommended to store pointers to asset catalogs. Store the CatalogID instead and do a lookup when needed.

Definition at line 287 of file AS_asset_catalog.hh.

Constructor & Destructor Documentation

◆ AssetCatalog() [1/2]

blender::asset_system::AssetCatalog::AssetCatalog ( )
delete

◆ AssetCatalog() [2/2]

blender::asset_system::AssetCatalog::AssetCatalog ( CatalogID catalog_id,
const AssetCatalogPath & path,
const std::string & simple_name )

Definition at line 676 of file asset_system/intern/asset_catalog.cc.

Member Function Documentation

◆ from_path()

std::unique_ptr< AssetCatalog > blender::asset_system::AssetCatalog::from_path ( const AssetCatalogPath & path)
static

Create a new Catalog with the given path, auto-generating a sensible catalog simple-name.

NOTE: the given path will be cleaned up (trailing spaces removed, etc.), so the returned AssetCatalog's path differ from the given one.

Definition at line 683 of file asset_system/intern/asset_catalog.cc.

References BLI_uuid_generate_random(), blender::asset_system::AssetCatalogPath::cleanup(), path, sensible_simple_name_for_path(), and simple_name.

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

◆ sensible_simple_name_for_path()

std::string blender::asset_system::AssetCatalog::sensible_simple_name_for_path ( const AssetCatalogPath & path)
staticprotected

Generate a sensible catalog ID for the given path.

Definition at line 697 of file asset_system/intern/asset_catalog.cc.

References MAX_NAME, path, blender::asset_system::AssetCatalogPath::SEPARATOR, and blender::asset_system::AssetCatalogPath::str().

Referenced by from_path(), and simple_name_refresh().

◆ simple_name_refresh()

void blender::asset_system::AssetCatalog::simple_name_refresh ( )

Make a new simple name for the catalog, based on its path.

Definition at line 692 of file asset_system/intern/asset_catalog.cc.

References path, sensible_simple_name_for_path(), and simple_name.

Referenced by blender::asset_system::AssetCatalogService::update_catalog_path().

Member Data Documentation

◆ catalog_id

const CatalogID blender::asset_system::AssetCatalog::catalog_id

◆ flags

◆ path

◆ simple_name

std::string blender::asset_system::AssetCatalog::simple_name

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