Blender  V3.3
Public Member Functions | Public Attributes | List of all members
blender::ed::asset::index::AssetLibraryIndex Struct Reference

References the asset library directory. More...

Public Member Functions

 AssetLibraryIndex (const StringRef library_path)
 
uint64_t hash () const
 
StringRefNull get_library_file_path () const
 
void init_indices_base_path ()
 Initializes #AssetLibraryIndex.indices_base_path. More...
 
std::string index_file_path (const BlendFile &asset_file) const
 
void init_unused_index_files ()
 
void mark_as_used (const std::string &filename)
 
int remove_unused_index_files () const
 

Public Attributes

Set< std::string > unused_file_indices
 
std::string indices_base_path
 Absolute path where the indices of library are stored. More...
 
std::string library_path
 

Detailed Description

References the asset library directory.

The AssetLibraryIndex instance is used to keep track of unused file indices. When reading any used indices are removed from the list and when reading is finished the unused indices are removed.

Definition at line 419 of file asset_indexer.cc.

Constructor & Destructor Documentation

◆ AssetLibraryIndex()

blender::ed::asset::index::AssetLibraryIndex::AssetLibraryIndex ( const StringRef  library_path)
inline

Definition at line 437 of file asset_indexer.cc.

Member Function Documentation

◆ get_library_file_path()

StringRefNull blender::ed::asset::index::AssetLibraryIndex::get_library_file_path ( ) const
inline

Definition at line 448 of file asset_indexer.cc.

◆ hash()

uint64_t blender::ed::asset::index::AssetLibraryIndex::hash ( ) const
inline

Definition at line 442 of file asset_indexer.cc.

◆ index_file_path()

std::string blender::ed::asset::index::AssetLibraryIndex::index_file_path ( const BlendFile asset_file) const
inline
Returns
absolute path to the index file of the given asset_file.

{indices_base_path}/{asset-file_hash}_{asset-file-filename}.index.json.

Definition at line 477 of file asset_indexer.cc.

References blender::ed::asset::index::BlendFile::get_filename(), blender::ed::asset::index::BlendFile::hash(), and hex.

◆ init_indices_base_path()

void blender::ed::asset::index::AssetLibraryIndex::init_indices_base_path ( )
inline

Initializes #AssetLibraryIndex.indices_base_path.

BKE_appdir_folder_caches/asset-library-indices/<asset-library-name-hash>/

Definition at line 458 of file asset_indexer.cc.

References BKE_appdir_folder_caches(), BLI_path_append(), FILE_MAX, hash, and hex.

◆ init_unused_index_files()

void blender::ed::asset::index::AssetLibraryIndex::init_unused_index_files ( )
inline

◆ mark_as_used()

void blender::ed::asset::index::AssetLibraryIndex::mark_as_used ( const std::string &  filename)
inline

◆ remove_unused_index_files()

int blender::ed::asset::index::AssetLibraryIndex::remove_unused_index_files ( ) const
inline

Definition at line 512 of file asset_indexer.cc.

References BLI_delete(), CLOG_INFO, and LOG.

Referenced by blender::ed::asset::index::filelist_finished().

Member Data Documentation

◆ indices_base_path

std::string blender::ed::asset::index::AssetLibraryIndex::indices_base_path

Absolute path where the indices of library are stored.

\NOTE: includes trailing directory separator.

Definition at line 432 of file asset_indexer.cc.

◆ library_path

std::string blender::ed::asset::index::AssetLibraryIndex::library_path

Definition at line 434 of file asset_indexer.cc.

◆ unused_file_indices

Set<std::string> blender::ed::asset::index::AssetLibraryIndex::unused_file_indices

Tracks indices that haven't been used yet.

Contains absolute paths to the indices.

Definition at line 425 of file asset_indexer.cc.


The documentation for this struct was generated from the following file: