Blender V5.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
11
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 <cstddef>
18
19#include "BLI_enum_flags.hh"
20#include "BLI_function_ref.hh"
21#include "BLI_string_ref.hh"
22
23namespace blender {
24
25struct ID;
26struct Main;
27struct ReportList;
28
29/* -------------------------------------------------------------------- */
32
100
101struct BPathForeachPathData;
102
116 char *path_dst,
117 size_t path_dst_maxncpy,
118 const char *path_src);
119
123
126
128
129 /* 'Private' data, caller don't need to set those. */
130
136
139
144
159};
160
163
166
168
169/* -------------------------------------------------------------------- */
172
173/* TODO: Investigate using macros around those calls to check a bit better about actual
174 * strings/buffers length (e,g, with static asserts). */
175
184 char *path,
185 size_t path_maxncpy);
186
192void BKE_bpath_foreach_path_readonly_process(BPathForeachPathData *bpath_data, const char *path);
193
200 const char *abs_filepath,
201 blender::FunctionRef<void(blender::StringRef frame_filepath)> callback);
202
213 char *path_dir,
214 size_t path_dir_maxncpy,
215 char *path_file,
216 size_t path_file_maxncpy);
217
228
230
231/* -------------------------------------------------------------------- */
234
236void BKE_bpath_missing_files_check(Main *bmain, ReportList *reports);
237
240 int count_total = 0;
243};
244
245void BKE_bpath_summary_report(const BPathSummary &summary, ReportList *reports);
246
261 const char *searchpath,
262 ReportList *reports,
263 bool find_all,
264 BPathSummary *r_summary = nullptr);
265
268 const char *basedir_src,
269 const char *basedir_dst,
270 ReportList *reports,
271 BPathSummary *r_summary = nullptr);
272
275 const char *basedir,
276 ReportList *reports,
277 BPathSummary *r_summary = nullptr);
278
281 const char *basedir,
282 ReportList *reports,
283 BPathSummary *r_summary = nullptr);
284
291
299void BKE_bpath_list_restore(Main *bmain, eBPathForeachFlag flag, void *path_list_handle);
300
307void BKE_bpath_list_free(void *path_list_handle);
308
310
311} // namespace blender
#define ENUM_OPERATORS(_enum_type)
BMesh Iterators.
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:235
bool BKE_bpath_foreach_path_allocated_process(BPathForeachPathData *bpath_data, char **path)
Definition bpath.cc:266
bool(*)(BPathForeachPathData *bpath_data, char *path_dst, size_t path_dst_maxncpy, const char *path_src) BPathForeachPathFunctionCallback
Definition BKE_bpath.hh:115
void BKE_bpath_foreach_path_main(BPathForeachPathData *bpath_data)
Definition bpath.cc:121
void BKE_bpath_relative_rebase(Main *bmain, const char *basedir_src, const char *basedir_dst, ReportList *reports, BPathSummary *r_summary=nullptr)
Definition bpath.cc:568
void BKE_bpath_missing_files_find(Main *bmain, const char *searchpath, ReportList *reports, bool find_all, BPathSummary *r_summary=nullptr)
Definition bpath.cc:492
void BKE_bpath_relative_convert(Main *bmain, const char *basedir, ReportList *reports, BPathSummary *r_summary=nullptr)
Definition bpath.cc:711
void BKE_bpath_summary_report(const BPathSummary &summary, ReportList *reports)
Definition bpath.cc:61
void BKE_bpath_foreach_path_id(BPathForeachPathData *bpath_data, ID *id)
Definition bpath.cc:77
void BKE_bpath_foreach_path_readonly_process(BPathForeachPathData *bpath_data, const char *path)
Definition bpath.cc:161
eBPathForeachFlag
Definition BKE_bpath.hh:39
@ BKE_BPATH_FOREACH_PATH_EXPAND_TOKENS
Definition BKE_bpath.hh:87
@ BKE_BPATH_FOREACH_PATH_EXPAND_CACHES
Definition BKE_bpath.hh:97
@ BKE_BPATH_FOREACH_PATH_SKIP_PACKED
Definition BKE_bpath.hh:49
@ BKE_BPATH_FOREACH_PATH_SKIP_MULTIFILE
Definition BKE_bpath.hh:76
@ BKE_BPATH_TRAVERSE_SKIP_WEAK_REFERENCES
Definition BKE_bpath.hh:62
@ BKE_BPATH_FOREACH_PATH_EXPAND_SEQUENCES
Definition BKE_bpath.hh:92
@ BKE_BPATH_FOREACH_PATH_ABSOLUTE
Definition BKE_bpath.hh:45
@ BKE_BPATH_FOREACH_PATH_RELOAD_EDITED
Definition BKE_bpath.hh:81
@ BKE_BPATH_FOREACH_PATH_RESOLVE_TOKEN
Definition BKE_bpath.hh:54
@ BKE_BPATH_FOREACH_PATH_SKIP_LINKED
Definition BKE_bpath.hh:47
void BKE_bpath_sequence_filepaths_foreach(const char *abs_filepath, blender::FunctionRef< void(blender::StringRef frame_filepath)> callback)
void BKE_bpath_list_restore(Main *bmain, eBPathForeachFlag flag, void *path_list_handle)
Definition bpath.cc:799
void BKE_bpath_list_free(void *path_list_handle)
Definition bpath.cc:811
bool BKE_bpath_foreach_path_fixed_process(BPathForeachPathData *bpath_data, char *path, size_t path_maxncpy)
Definition bpath.cc:130
void * BKE_bpath_list_backup(Main *bmain, eBPathForeachFlag flag)
Definition bpath.cc:785
void BKE_bpath_absolute_convert(Main *bmain, const char *basedir, ReportList *reports, BPathSummary *r_summary=nullptr)
Definition bpath.cc:720
void BKE_bpath_missing_files_check(Main *bmain, ReportList *reports)
Definition bpath.cc:334
BPathForeachPathFunctionCallback callback_function
Definition BKE_bpath.hh:124