28AssetWeakReference::AssetWeakReference()
29 : asset_library_type(0), asset_library_identifier(nullptr), relative_asset_identifier(nullptr)
34 : asset_library_type(other.asset_library_type),
35 asset_library_identifier(
BLI_strdup_null(other.asset_library_identifier)),
36 relative_asset_identifier(
BLI_strdup_null(other.relative_asset_identifier))
41 : asset_library_type(other.asset_library_type),
42 asset_library_identifier(other.asset_library_identifier),
43 relative_asset_identifier(other.relative_asset_identifier)
45 other.asset_library_type = 0;
46 other.asset_library_identifier =
nullptr;
47 other.relative_asset_identifier =
nullptr;
50AssetWeakReference::~AssetWeakReference()
61 std::destroy_at(
this);
71 std::destroy_at(
this);
78 if (a.asset_library_type !=
b.asset_library_type) {
83 const char *b_lib_idenfifier =
b.asset_library_identifier ?
b.asset_library_identifier :
"";
87 const char *a_asset_idenfifier = a.relative_asset_identifier ? a.relative_asset_identifier :
"";
88 const char *b_asset_idenfifier =
b.relative_asset_identifier ?
b.relative_asset_identifier :
"";
96 const StringRef library_relative_identifier)
102 if (!name.is_empty()) {
103 weak_ref.asset_library_identifier =
BLI_strdupn(name.c_str(), name.size());
106 weak_ref.relative_asset_identifier =
BLI_strdupn(library_relative_identifier.
data(),
107 library_relative_identifier.
size());
128 MEM_delete(catalog_path->path);
136 ListBase duplicated_list = {
nullptr};
145 return duplicated_list;
167 const char *catalog_path)
BLI_INLINE bool BLI_listbase_is_empty(const struct ListBase *lb)
#define LISTBASE_FOREACH(type, var, list)
void BLI_freelinkN(struct ListBase *listbase, void *vlink) ATTR_NONNULL(1)
#define LISTBASE_FOREACH_MUTABLE(type, var, list)
void BLI_addtail(struct ListBase *listbase, void *vlink) ATTR_NONNULL(1)
void * BLI_findstring_ptr(const struct ListBase *listbase, const char *id, int offset) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
int BLI_path_cmp_normalized(const char *p1, const char *p2) ATTR_NONNULL(1
char * BLI_strdup(const char *str) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1) ATTR_MALLOC
char * BLI_strdupn(const char *str, size_t len) ATTR_MALLOC ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
char * BLI_strdup_null(const char *str) ATTR_WARN_UNUSED_RESULT ATTR_MALLOC
#define BLO_write_struct(writer, struct_name, data_ptr)
void BLO_read_string(BlendDataReader *reader, char **ptr_p)
void BLO_write_string(BlendWriter *writer, const char *data_ptr)
#define BLO_read_struct_list(reader, struct_name, list)
struct AssetWeakReference AssetWeakReference
Read Guarded memory(de)allocation.
void BKE_asset_catalog_path_list_free(ListBase &catalog_path_list)
void BKE_asset_weak_reference_read(BlendDataReader *reader, AssetWeakReference *weak_ref)
ListBase BKE_asset_catalog_path_list_duplicate(const ListBase &catalog_path_list)
void BKE_asset_weak_reference_write(BlendWriter *writer, const AssetWeakReference *weak_ref)
void BKE_asset_catalog_path_list_blend_write(BlendWriter *writer, const ListBase &catalog_path_list)
bool BKE_asset_catalog_path_list_has_path(const ListBase &catalog_path_list, const char *catalog_path)
void BKE_asset_catalog_path_list_blend_read_data(BlendDataReader *reader, ListBase &catalog_path_list)
bool operator==(const AssetWeakReference &a, const AssetWeakReference &b)
void BKE_asset_catalog_path_list_add_path(ListBase &catalog_path_list, const char *catalog_path)
constexpr int64_t size() const
constexpr const char * data() const
eAssetLibraryType library_type() const
StringRefNull name() const
local_group_size(16, 16) .push_constant(Type b
const char * relative_asset_identifier
const char * asset_library_identifier