Blender V4.3
BKE_packedFile.hh
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2001-2002 NaN Holding BV. All rights reserved.
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4#pragma once
5
11#include "BLI_string_ref.hh"
12
13#define RET_OK 0
14#define RET_ERROR 1
15
16struct BlendDataReader;
17struct BlendWriter;
18struct ID;
19struct Image;
20struct Main;
21struct PackedFile;
22struct ReportList;
23struct VFont;
24struct Volume;
25struct bSound;
26
32
43
44/* Pack. */
45
48 const char *filepath_rel,
49 const char *basepath);
51 const void *mem, int memlen, const blender::ImplicitSharingInfo *sharing_info = nullptr);
52
56void BKE_packedfile_pack_all(Main *bmain, ReportList *reports, bool verbose);
58
59/* Unpack. */
60
72 const char *ref_file_name,
73 const char *abs_name,
74 const char *local_name,
76 enum ePF_FileStatus how);
77char *BKE_packedfile_unpack(Main *bmain,
78 ReportList *reports,
79 ID *id,
80 const char *orig_file_path,
82 enum ePF_FileStatus how);
84 ReportList *reports,
85 VFont *vfont,
86 enum ePF_FileStatus how);
88 ReportList *reports,
89 bSound *sound,
90 enum ePF_FileStatus how);
92 ReportList *reports,
93 Image *ima,
94 enum ePF_FileStatus how);
96 ReportList *reports,
97 Volume *volume,
98 enum ePF_FileStatus how);
99void BKE_packedfile_unpack_all(Main *bmain, ReportList *reports, enum ePF_FileStatus how);
101
103 const char *ref_file_name,
104 const char *filepath_rel,
105 PackedFile *pf);
106
107/* Free. */
108
110
111/* Info. */
112
117 int bakes = 0;
118
119 int total() const
120 {
121 return this->individual_files + this->bakes;
122 }
123};
124
126
135ePF_FileCompare BKE_packedfile_compare_to_file(const char *ref_file_name,
136 const char *filepath_rel,
137 const PackedFile *pf);
138
139/* Read. */
140
141int BKE_packedfile_seek(PackedFile *pf, int offset, int whence);
143int BKE_packedfile_read(PackedFile *pf, void *data, int size);
144
148bool BKE_packedfile_id_check(const ID *id);
152void BKE_packedfile_id_unpack(Main *bmain, ID *id, ReportList *reports, enum ePF_FileStatus how);
153
156 PackedFile **pf_p,
157 blender::StringRefNull filepath);
int BKE_packedfile_unpack_all_libraries(Main *bmain, ReportList *reports)
ePF_FileCompare
@ PF_CMP_EQUAL
@ PF_CMP_NOFILE
@ PF_CMP_DIFFERS
PackedFile * BKE_packedfile_duplicate(const PackedFile *pf_src)
void BKE_packedfile_free(PackedFile *pf)
PackedFileCount BKE_packedfile_count_all(Main *bmain)
PackedFile * BKE_packedfile_new_from_memory(const void *mem, int memlen, const blender::ImplicitSharingInfo *sharing_info=nullptr)
bool BKE_packedfile_id_check(const ID *id)
int BKE_packedfile_unpack_sound(Main *bmain, ReportList *reports, bSound *sound, enum ePF_FileStatus how)
void BKE_packedfile_unpack_all(Main *bmain, ReportList *reports, enum ePF_FileStatus how)
void BKE_packedfile_pack_all_libraries(Main *bmain, ReportList *reports)
int BKE_packedfile_read(PackedFile *pf, void *data, int size)
Definition packedFile.cc:95
int BKE_packedfile_unpack_image(Main *bmain, ReportList *reports, Image *ima, enum ePF_FileStatus how)
ePF_FileCompare BKE_packedfile_compare_to_file(const char *ref_file_name, const char *filepath_rel, const PackedFile *pf)
char * BKE_packedfile_unpack_to_file(ReportList *reports, const char *ref_file_name, const char *abs_name, const char *local_name, PackedFile *pf, enum ePF_FileStatus how)
int BKE_packedfile_unpack_vfont(Main *bmain, ReportList *reports, VFont *vfont, enum ePF_FileStatus how)
void BKE_packedfile_blend_write(BlendWriter *writer, const PackedFile *pf)
void BKE_packedfile_blend_read(BlendDataReader *reader, PackedFile **pf_p, blender::StringRefNull filepath)
char * BKE_packedfile_unpack(Main *bmain, ReportList *reports, ID *id, const char *orig_file_path, PackedFile *pf, enum ePF_FileStatus how)
void BKE_packedfile_rewind(PackedFile *pf)
Definition packedFile.cc:90
int BKE_packedfile_seek(PackedFile *pf, int offset, int whence)
Definition packedFile.cc:58
PackedFile * BKE_packedfile_new(ReportList *reports, const char *filepath_rel, const char *basepath)
int BKE_packedfile_write_to_file(ReportList *reports, const char *ref_file_name, const char *filepath_rel, PackedFile *pf)
int BKE_packedfile_unpack_volume(Main *bmain, ReportList *reports, Volume *volume, enum ePF_FileStatus how)
ePF_FileStatus
@ PF_USE_ORIGINAL
@ PF_USE_LOCAL
@ PF_ASK
@ PF_KEEP
@ PF_REMOVE
@ PF_WRITE_ORIGINAL
@ PF_WRITE_LOCAL
void BKE_packedfile_pack_all(Main *bmain, ReportList *reports, bool verbose)
void BKE_packedfile_id_unpack(Main *bmain, ID *id, ReportList *reports, enum ePF_FileStatus how)
static int verbose
Definition cineonlib.cc:31
#define pf(_x, _i)
Prefetch 64.
Definition gim_memory.h:48
Definition DNA_ID.h:413