Blender V5.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
9
11#include "BLI_string_ref.hh"
12
13namespace blender {
14
15#define RET_OK 0
16#define RET_ERROR 1
17
18struct BlendDataReader;
19struct BlendWriter;
20struct ID;
21struct Image;
22struct Main;
23struct PackedFile;
24struct ReportList;
25struct VFont;
26struct Volume;
27struct bSound;
28
34
45
47
48/* Pack. */
49
52 const char *filepath_rel,
53 const char *basepath);
55 int memlen,
56 const ImplicitSharingInfo *sharing_info = nullptr);
57
61void BKE_packedfile_pack_all(Main *bmain, ReportList *reports, bool verbose);
63
64/* Unpack. */
65
77 const char *ref_file_name,
78 const char *abs_name,
79 const char *local_name,
81 enum ePF_FileStatus how);
82char *BKE_packedfile_unpack(Main *bmain,
83 ReportList *reports,
84 ID *id,
85 const char *orig_file_path,
87 enum ePF_FileStatus how);
89 ReportList *reports,
90 VFont *vfont,
91 enum ePF_FileStatus how);
93 ReportList *reports,
94 bSound *sound,
95 enum ePF_FileStatus how);
97 ReportList *reports,
98 Image *ima,
99 enum ePF_FileStatus how);
101 ReportList *reports,
102 Volume *volume,
103 enum ePF_FileStatus how);
104void BKE_packedfile_unpack_all(Main *bmain, ReportList *reports, enum ePF_FileStatus how);
106
108 const char *ref_file_name,
109 const char *filepath_rel,
110 PackedFile *pf);
111
112/* Free. */
113
115
116/* Info. */
117
122 int bakes = 0;
123
124 int total() const
125 {
126 return this->individual_files + this->bakes;
127 }
128};
129
130PackedFileCount BKE_packedfile_count_all(Main *bmain);
131
140ePF_FileCompare BKE_packedfile_compare_to_file(const char *ref_file_name,
141 const char *filepath_rel,
142 const PackedFile *pf);
143
144/* Read. */
145
146int BKE_packedfile_seek(PackedFile *pf, int offset, int whence);
147void BKE_packedfile_rewind(PackedFile *pf);
148int BKE_packedfile_read(PackedFile *pf, void *data, int size);
149
153bool BKE_packedfile_id_check(const ID *id);
157void BKE_packedfile_id_unpack(Main *bmain, ID *id, ReportList *reports, enum ePF_FileStatus how);
158
159void BKE_packedfile_blend_write(BlendWriter *writer, const PackedFile *pf);
160void BKE_packedfile_blend_read(BlendDataReader *reader, PackedFile **pf_p, StringRefNull filepath);
161
162} // namespace blender
#define INT32_MAX
static DBVT_INLINE btScalar size(const btDbvtVolume &a)
Definition btDbvt.cpp:52
#define pf(_x, _i)
Prefetch 64.
Definition gim_memory.h:48
BMesh Iterators.
void BKE_packedfile_blend_write(BlendWriter *writer, const PackedFile *pf)
int BKE_packedfile_unpack_all_libraries(Main *bmain, ReportList *reports)
__int64 int64_t
Definition BKE_text.h:90
ePF_FileCompare BKE_packedfile_compare_to_file(const char *ref_file_name, const char *filepath_rel, const PackedFile *pf)
int BKE_packedfile_read(PackedFile *pf, void *data, int size)
Definition packedFile.cc:99
PackedFile * BKE_packedfile_duplicate(const PackedFile *pf_src)
bool BKE_packedfile_id_check(const ID *id)
void BKE_packedfile_free(PackedFile *pf)
int BKE_packedfile_seek(PackedFile *pf, int offset, int whence)
Definition packedFile.cc:62
void BKE_packedfile_rewind(PackedFile *pf)
Definition packedFile.cc:94
PackedFile * BKE_packedfile_new(ReportList *reports, const char *filepath_rel, const char *basepath)
void BKE_packedfile_id_unpack(Main *bmain, ID *id, ReportList *reports, enum ePF_FileStatus how)
int BKE_packedfile_unpack_vfont(Main *bmain, ReportList *reports, VFont *vfont, enum ePF_FileStatus how)
PackedFileCount BKE_packedfile_count_all(Main *bmain)
void BKE_packedfile_pack_all_libraries(Main *bmain, ReportList *reports)
void BKE_packedfile_unpack_all(Main *bmain, ReportList *reports, enum ePF_FileStatus how)
int BKE_packedfile_unpack_image(Main *bmain, ReportList *reports, Image *ima, enum ePF_FileStatus how)
BMesh const char void * data
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_volume(Main *bmain, ReportList *reports, Volume *volume, enum ePF_FileStatus how)
void BKE_packedfile_pack_all(Main *bmain, ReportList *reports, bool verbose)
char * BKE_packedfile_unpack(Main *bmain, ReportList *reports, ID *id, const char *orig_file_path, PackedFile *pf, enum ePF_FileStatus how)
constexpr int64_t PACKED_FILE_MAX_SIZE
void BKE_packedfile_blend_read(BlendDataReader *reader, PackedFile **pf_p, StringRefNull filepath)
PackedFile * BKE_packedfile_new_from_memory(const void *mem, int memlen, const ImplicitSharingInfo *sharing_info=nullptr)
int BKE_packedfile_unpack_sound(Main *bmain, ReportList *reports, bSound *sound, enum ePF_FileStatus how)
int BKE_packedfile_write_to_file(ReportList *reports, const char *ref_file_name, const char *filepath_rel, PackedFile *pf)