Blender V4.3
blender::ed::asset::index::AssetIndexFile Class Reference

Inherits blender::ed::asset::index::AbstractFile.

Public Member Functions

 AssetIndexFile (AssetLibraryIndex &library_index, StringRef index_file_path)
 
 AssetIndexFile (AssetLibraryIndex &library_index, BlendFile &asset_filename)
 
void mark_as_used ()
 
const char * get_file_path () const override
 
bool is_older_than (const BlendFile &asset_file) const
 
bool constains_entries () const
 
std::unique_ptr< AssetIndexread_contents () const
 
bool ensure_parent_path_exists () const
 
void write_contents (AssetIndex &content)
 
- Public Member Functions inherited from blender::ed::asset::index::AbstractFile
virtual ~AbstractFile ()=default
 
bool exists () const
 
size_t get_file_size () const
 

Public Attributes

AssetLibraryIndexlibrary_index
 
const size_t MIN_FILE_SIZE_WITH_ENTRIES = 32
 
std::string filename
 

Detailed Description

Definition at line 517 of file asset_indexer.cc.

Constructor & Destructor Documentation

◆ AssetIndexFile() [1/2]

blender::ed::asset::index::AssetIndexFile::AssetIndexFile ( AssetLibraryIndex & library_index,
StringRef index_file_path )
inline

Definition at line 527 of file asset_indexer.cc.

◆ AssetIndexFile() [2/2]

blender::ed::asset::index::AssetIndexFile::AssetIndexFile ( AssetLibraryIndex & library_index,
BlendFile & asset_filename )
inline

Definition at line 532 of file asset_indexer.cc.

Member Function Documentation

◆ constains_entries()

bool blender::ed::asset::index::AssetIndexFile::constains_entries ( ) const
inline

Check whether the index file contains entries without opening the file.

Definition at line 558 of file asset_indexer.cc.

References blender::ed::asset::index::AbstractFile::get_file_size(), and MIN_FILE_SIZE_WITH_ENTRIES.

Referenced by blender::ed::asset::index::read_index(), and blender::ed::asset::index::AssetLibraryIndex::remove_broken_index_files().

◆ ensure_parent_path_exists()

bool blender::ed::asset::index::AssetIndexFile::ensure_parent_path_exists ( ) const
inline

Definition at line 579 of file asset_indexer.cc.

References BLI_file_ensure_parent_dir_exists(), and get_file_path().

Referenced by write_contents().

◆ get_file_path()

const char * blender::ed::asset::index::AssetIndexFile::get_file_path ( ) const
inlineoverridevirtual

◆ is_older_than()

bool blender::ed::asset::index::AssetIndexFile::is_older_than ( const BlendFile & asset_file) const
inline

Returns whether the index file is older than the given asset file.

Definition at line 550 of file asset_indexer.cc.

References BLI_file_older(), get_file_path(), and blender::ed::asset::index::BlendFile::get_file_path().

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

◆ mark_as_used()

void blender::ed::asset::index::AssetIndexFile::mark_as_used ( )
inline

◆ read_contents()

std::unique_ptr< AssetIndex > blender::ed::asset::index::AssetIndexFile::read_contents ( ) const
inline

◆ write_contents()

void blender::ed::asset::index::AssetIndexFile::write_contents ( AssetIndex & content)
inline

Member Data Documentation

◆ filename

std::string blender::ed::asset::index::AssetIndexFile::filename

Definition at line 525 of file asset_indexer.cc.

Referenced by get_file_path(), and blender::ed::asset::index::read_index().

◆ library_index

AssetLibraryIndex& blender::ed::asset::index::AssetIndexFile::library_index

Definition at line 519 of file asset_indexer.cc.

◆ MIN_FILE_SIZE_WITH_ENTRIES

const size_t blender::ed::asset::index::AssetIndexFile::MIN_FILE_SIZE_WITH_ENTRIES = 32

Asset index files with a size smaller than this attribute would be considered to not contain any entries.

Definition at line 524 of file asset_indexer.cc.

Referenced by constains_entries().


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