Blender V5.0
blender::bke::id_hash Namespace Reference

Classes

struct  ValidDeepHashes
struct  DeepHashErrors
struct  CachedFileHash

Typedefs

using IDHashResult = std::variant<ValidDeepHashes, DeepHashErrors>

Functions

IDHashResult compute_linked_id_deep_hashes (const Main &bmain, Span< const ID * > root_ids)
std::string id_hash_to_hex (const IDHash &hash)
static std::optional< Vector< char > > read_file (const StringRefNull path)
static std::optional< XXH128_hash_t > compute_file_hash_with_file_read (const StringRefNull path)
static std::optional< XXH128_hash_t > compute_file_hash_with_memory_map (const StringRefNull path)
static std::optional< XXH128_hash_t > compute_file_hash (const StringRefNull path)
static std::optional< XXH128_hash_t > get_source_file_hash (const ID &id, DeepHashErrors &r_errors)
static std::optional< XXH128_hash_t > get_id_shallow_hash (const ID &id, DeepHashErrors &r_errors)
static void compute_deep_hash_recursive (const Main &bmain, const ID &id, Set< const ID * > &current_stack, Map< const ID *, IDHash > &r_hashes, DeepHashErrors &r_errors)

Typedef Documentation

◆ IDHashResult

Definition at line 37 of file BKE_id_hash.hh.

Function Documentation

◆ compute_deep_hash_recursive()

◆ compute_file_hash()

std::optional< XXH128_hash_t > blender::bke::id_hash::compute_file_hash ( const StringRefNull path)
static

◆ compute_file_hash_with_file_read()

std::optional< XXH128_hash_t > blender::bke::id_hash::compute_file_hash_with_file_read ( const StringRefNull path)
static

Definition at line 44 of file id_hash.cc.

References read_file().

Referenced by compute_file_hash().

◆ compute_file_hash_with_memory_map()

std::optional< XXH128_hash_t > blender::bke::id_hash::compute_file_hash_with_memory_map ( const StringRefNull path)
static

◆ compute_linked_id_deep_hashes()

IDHashResult blender::bke::id_hash::compute_linked_id_deep_hashes ( const Main & bmain,
Span< const ID * > root_ids )

Compute a hash of the given IDs, including all their dependencies. This needs access to the original .blend files that the linked data-blocks come from to be able to compute their hash.

Definition at line 233 of file id_hash.cc.

References BLI_assert, compute_deep_hash_recursive(), ID_IS_LINKED, blender::Span< T >::is_empty(), VectorSet< Key, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::is_empty(), blender::bke::id_hash::DeepHashErrors::missing_files, and blender::bke::id_hash::DeepHashErrors::updated_files.

Referenced by pack_linked_ids().

◆ get_id_shallow_hash()

std::optional< XXH128_hash_t > blender::bke::id_hash::get_id_shallow_hash ( const ID & id,
DeepHashErrors & r_errors )
static

◆ get_source_file_hash()

◆ id_hash_to_hex()

std::string blender::bke::id_hash::id_hash_to_hex ( const IDHash & hash)

Utility to convert the hash into a readable string.

Definition at line 257 of file id_hash.cc.

References hash.

◆ read_file()

std::optional< Vector< char > > blender::bke::id_hash::read_file ( const StringRefNull path)
static