Blender
V3.3
|
Public Member Functions | |
AssetIndex (const FileIndexerEntries &indexer_entries) | |
AssetIndex (std::unique_ptr< Value > &value) | |
int | get_version () const |
bool | is_latest_version () const |
int | extract_into (FileIndexerEntries &indexer_entries) const |
Public Attributes | |
const int | UNKNOWN_VERSION = -1 |
std::unique_ptr< Value > | contents |
Static Public Attributes | |
static const int | CURRENT_VERSION = 1 |
Version to store in new index files. More... | |
Instance of this class represents the contents of an asset index file.
Definition at line 536 of file asset_indexer.cc.
|
inline |
Constructor for when creating/updating an asset index file. #AssetIndex.contents are filled from the given indexer_entries
.
Definition at line 564 of file asset_indexer.cc.
References blender::ed::asset::index::ATTRIBUTE_VERSION(), and blender::ed::asset::index::init_value_from_file_indexer_entries().
|
inline |
Constructor when reading an asset index file. #AssetIndex.contents are read from the given value
.
Definition at line 578 of file asset_indexer.cc.
|
inline |
Extract the contents of this index into the given indexer_entries
.
Definition at line 606 of file asset_indexer.cc.
References blender::io::serialize::Value::as_dictionary_value(), and blender::ed::asset::index::init_indexer_entries_from_value().
|
inline |
Definition at line 582 of file asset_indexer.cc.
References blender::io::serialize::Value::as_dictionary_value(), blender::io::serialize::Value::as_int_value(), blender::ed::asset::index::ATTRIBUTE_VERSION(), blender::io::serialize::DictionaryValue::create_lookup(), blender::Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::lookup_ptr(), and blender::io::serialize::PrimitiveValue< T, V >::value().
|
inline |
Definition at line 596 of file asset_indexer.cc.
std::unique_ptr<Value> blender::ed::asset::index::AssetIndex::contents |
blender::io::serialize::Value
representing the contents of an index file.
Value is used over #DictionaryValue as the contents of the index could be corrupted and doesn't represent an object. In case corrupted files are detected the get_version
would return UNKNOWN_VERSION
.
Definition at line 558 of file asset_indexer.cc.
Referenced by blender::ed::asset::index::AssetIndexFile::write_contents().
|
static |
Version to store in new index files.
Versions are written to each index file. When reading the version is checked against CURRENT_VERSION
to make sure we can use the index. Developer should increase CURRENT_VERSION
when changes are made to the structure of the stored index.
Definition at line 544 of file asset_indexer.cc.
Referenced by blender::ed::asset::index::read_index().
const int blender::ed::asset::index::AssetIndex::UNKNOWN_VERSION = -1 |
Version number to use when version couldn't be read from an index file.
Definition at line 549 of file asset_indexer.cc.