Blender V4.3
BKE_bpath.hh
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2023 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
12/* TODO: Make this module handle a bit more safely string length, instead of assuming buffers are
13 * FILE_MAX length etc. */
14
15#pragma once
16
17#include "BLI_utildefines.h"
18
19struct ID;
20struct Main;
21struct ReportList;
22
27 /* Flags controlling the behavior of the generic BPath API. */
40 /* Skip weak reference paths. Those paths are typically 'nice to have' extra information, but are
41 * not used as actual source of data by the current .blend file.
42 *
43 * NOTE: Currently this only concerns the weak reference to a library file stored in
44 * `ID::library_weak_reference`. */
46
61};
63
65
79 char *path_dst,
80 size_t path_dst_maxncpy,
81 const char *path_src);
82
86
89
90 void *user_data;
91
92 /* 'Private' data, caller don't need to set those. */
93
96 const char *absolute_base_path;
97
100
105};
106
109
112
118/* TODO: Investigate using macros around those calls to check a bit better about actual
119 * strings/buffers length (e,g, with static asserts). */
120
129 char *path,
130 size_t path_maxncpy);
131
142 char *path_dir,
143 size_t path_dir_maxncpy,
144 char *path_file,
145 size_t path_file_maxncpy);
146
157
164void BKE_bpath_missing_files_check(Main *bmain, ReportList *reports);
165
168 int count_total = 0;
171};
172
173void BKE_bpath_summary_report(const BPathSummary &summary, ReportList *reports);
174
189 const char *searchpath,
190 ReportList *reports,
191 bool find_all);
192
195 const char *basedir_src,
196 const char *basedir_dst,
197 ReportList *reports,
198 BPathSummary *r_summary = nullptr);
199
202 const char *basedir,
203 ReportList *reports,
204 BPathSummary *r_summary = nullptr);
205
208 const char *basedir,
209 ReportList *reports,
210 BPathSummary *r_summary = nullptr);
211
218
226void BKE_bpath_list_restore(Main *bmain, eBPathForeachFlag flag, void *path_list_handle);
227
234void BKE_bpath_list_free(void *path_list_handle);
235
void BKE_bpath_relative_convert(Main *bmain, const char *basedir, ReportList *reports, BPathSummary *r_summary=nullptr)
Definition bpath.cc:615
bool BKE_bpath_foreach_path_dirfile_fixed_process(BPathForeachPathData *bpath_data, char *path_dir, size_t path_dir_maxncpy, char *path_file, size_t path_file_maxncpy)
Definition bpath.cc:154
void * BKE_bpath_list_backup(Main *bmain, eBPathForeachFlag flag)
Definition bpath.cc:689
void BKE_bpath_absolute_convert(Main *bmain, const char *basedir, ReportList *reports, BPathSummary *r_summary=nullptr)
Definition bpath.cc:624
bool(*)(BPathForeachPathData *bpath_data, char *path_dst, size_t path_dst_maxncpy, const char *path_src) BPathForeachPathFunctionCallback
Definition BKE_bpath.hh:78
void BKE_bpath_summary_report(const BPathSummary &summary, ReportList *reports)
Definition bpath.cc:57
bool BKE_bpath_foreach_path_fixed_process(BPathForeachPathData *bpath_data, char *path, size_t path_maxncpy)
Definition bpath.cc:123
void BKE_bpath_missing_files_find(Main *bmain, const char *searchpath, ReportList *reports, bool find_all)
Definition bpath.cc:404
void BKE_bpath_foreach_path_id(BPathForeachPathData *bpath_data, ID *id)
Definition bpath.cc:73
void BKE_bpath_list_restore(Main *bmain, eBPathForeachFlag flag, void *path_list_handle)
Definition bpath.cc:703
void BKE_bpath_relative_rebase(Main *bmain, const char *basedir_src, const char *basedir_dst, ReportList *reports, BPathSummary *r_summary=nullptr)
Definition bpath.cc:475
eBPathForeachFlag
Definition BKE_bpath.hh:26
@ BKE_BPATH_TRAVERSE_SKIP_WEAK_REFERENCES
Definition BKE_bpath.hh:45
@ BKE_BPATH_FOREACH_PATH_SKIP_LINKED
Definition BKE_bpath.hh:35
@ BKE_BPATH_FOREACH_PATH_ABSOLUTE
Definition BKE_bpath.hh:33
@ BKE_BPATH_FOREACH_PATH_SKIP_PACKED
Definition BKE_bpath.hh:37
@ BKE_BPATH_FOREACH_PATH_SKIP_MULTIFILE
Definition BKE_bpath.hh:55
@ BKE_BPATH_FOREACH_PATH_RESOLVE_TOKEN
Definition BKE_bpath.hh:39
@ BKE_BPATH_FOREACH_PATH_RELOAD_EDITED
Definition BKE_bpath.hh:60
void BKE_bpath_list_free(void *path_list_handle)
Definition bpath.cc:715
void BKE_bpath_missing_files_check(Main *bmain, ReportList *reports)
Definition bpath.cc:253
bool BKE_bpath_foreach_path_allocated_process(BPathForeachPathData *bpath_data, char **path)
Definition bpath.cc:185
void BKE_bpath_foreach_path_main(BPathForeachPathData *bpath_data)
Definition bpath.cc:114
#define ENUM_OPERATORS(_type, _max)
const char * absolute_base_path
Definition BKE_bpath.hh:96
eBPathForeachFlag flag
Definition BKE_bpath.hh:88
BPathForeachPathFunctionCallback callback_function
Definition BKE_bpath.hh:87
Definition DNA_ID.h:413
uint8_t flag
Definition wm_window.cc:138