|
Blender V4.3
|
#include "BLI_compiler_attrs.h"#include "BLI_compiler_compat.h"#include "BLI_utildefines.h"#include "BLI_utildefines_variadic.h"Go to the source code of this file.
Macros | |
Current & Parent Directory Defines/Macros | |
| #define | FILENAME_PARENT ".." |
| #define | FILENAME_CURRENT "." |
| #define | FILENAME_IS_PARENT(_n) (((_n)[0] == '.') && ((_n)[1] == '.') && ((_n)[2] == '\0')) |
| #define | FILENAME_IS_CURRENT(_n) (((_n)[0] == '.') && ((_n)[1] == '\0')) |
| #define | FILENAME_IS_CURRPAR(_n) (((_n)[0] == '.') && (((_n)[1] == '\0') || (((_n)[1] == '.') && ((_n)[2] == '\0')))) |
Functions | |
Path Parent Operations | |
| bool | BLI_path_parent_dir (char *path) ATTR_NONNULL(1) |
| bool | BLI_path_parent_dir_until_exists (char *path) ATTR_NONNULL(1) |
| const char * | BLI_path_parent_dir_end (const char *path, size_t path_len) ATTR_NONNULL(1) ATTR_WARN_UNUSED_RESULT |
Path Make Safe / Sanitize | |
| bool | BLI_path_make_safe_filename_ex (char *filename, bool allow_tokens) ATTR_NONNULL(1) |
| bool | BLI_path_make_safe_filename (char *filename) ATTR_NONNULL(1) |
| bool | BLI_path_make_safe (char *path) ATTR_NONNULL(1) |
| void | BLI_path_to_display_name (char *display_name, int display_name_maxncpy, const char *name) ATTR_NONNULL(1 |
Path Normalize | |
| int | BLI_path_normalize (char *path) ATTR_NONNULL(1) |
| int | BLI_path_normalize_native (char *path) ATTR_NONNULL(1) |
| int | BLI_path_normalize_dir (char *dir, size_t dir_maxncpy) ATTR_NONNULL(1) |
Path Canonicalize | |
| int | BLI_path_canonicalize_native (char *path, int path_maxncpy) |
Path FileName Manipulation | |
| bool | BLI_path_filename_ensure (char *filepath, size_t filepath_maxncpy, const char *filename) ATTR_NONNULL(1 |
| bool bool | BLI_path_suffix (char *path, size_t path_maxncpy, const char *suffix, const char *sep) ATTR_NONNULL(1 |
Path Slash Utilities | |
| const char * | BLI_path_slash_find (const char *path) ATTR_NONNULL(1) ATTR_WARN_UNUSED_RESULT |
| const char * | BLI_path_slash_rfind (const char *path) ATTR_NONNULL(1) ATTR_WARN_UNUSED_RESULT |
| int | BLI_path_slash_ensure_ex (char *path, size_t path_maxncpy, const size_t path_len) ATTR_NONNULL(1) |
| int | BLI_path_slash_ensure (char *path, size_t path_maxncpy) ATTR_NONNULL(1) |
| void | BLI_path_slash_rstrip (char *path) ATTR_NONNULL(1) |
| const char * | BLI_path_slash_skip (const char *path) ATTR_NONNULL(1) ATTR_WARN_UNUSED_RESULT |
| void | BLI_path_slash_native (char *path) ATTR_NONNULL(1) |
Path Directory/FileName Split | |
| void | BLI_path_split_dir_file (const char *filepath, char *dir, size_t dir_maxncpy, char *file, size_t file_maxncpy) ATTR_NONNULL(1 |
| void void | BLI_path_split_dir_part (const char *filepath, char *dir, size_t dir_maxncpy) ATTR_NONNULL(1 |
| void void void | BLI_path_split_file_part (const char *filepath, char *file, size_t file_maxncpy) ATTR_NONNULL(1 |
| void void void const char * | BLI_path_basename (const char *path) ATTR_NONNULL(1) ATTR_WARN_UNUSED_RESULT |
Path Filtering Utilities | |
| bool | BLI_path_has_hidden_component (const char *path) ATTR_NONNULL(1) ATTR_WARN_UNUSED_RESULT |
Path Append | |
| size_t | BLI_path_append (char *__restrict dst, size_t dst_maxncpy, const char *__restrict file) ATTR_NONNULL(1 |
| size_t size_t | BLI_path_append_dir (char *__restrict dst, size_t dst_maxncpy, const char *__restrict dir) ATTR_NONNULL(1 |
Path File Extensions | |
| const char * | BLI_path_extension_or_end (const char *filepath) ATTR_NONNULL(1) ATTR_WARN_UNUSED_RESULT ATTR_RETURNS_NONNULL |
| const char * | BLI_path_extension (const char *filepath) ATTR_NONNULL(1) ATTR_WARN_UNUSED_RESULT |
| bool | BLI_path_extension_check (const char *path, const char *ext) ATTR_NONNULL(1 |
| bool | BLI_path_extension_check_n (const char *path,...) ATTR_NONNULL(1) ATTR_SENTINEL(0) |
| bool | BLI_path_extension_check_array (const char *path, const char **ext_array) ATTR_NONNULL(1 |
| bool | BLI_path_extension_check_glob (const char *path, const char *ext_fnmatch) ATTR_NONNULL(1 |
| bool | BLI_path_extension_glob_validate (char *ext_fnmatch) ATTR_NONNULL(1) |
| bool | BLI_path_extension_replace (char *path, size_t path_maxncpy, const char *ext) ATTR_NONNULL(1 |
| bool bool | BLI_path_extension_strip (char *path) ATTR_NONNULL(1) |
| bool | BLI_path_extension_ensure (char *path, size_t path_maxncpy, const char *ext) ATTR_NONNULL(1 |
Program Specific Path Functions | |
| bool | BLI_path_program_search (char *program_filepath, size_t program_filepath_maxncpy, const char *program_name) ATTR_NONNULL(1 |
Blender Specific Frame Sequence Encode/Decode | |
| void | BLI_path_sequence_encode (char *path, size_t path_maxncpy, const char *head, const char *tail, unsigned short numlen, int pic) |
| int | BLI_path_sequence_decode (const char *path, char *head, size_t head_maxncpy, char *tail, size_t tail_maxncpy, unsigned short *r_digits_len) |
Blender Specific Frame Number Apply/Strip | |
| bool | BLI_path_frame (char *path, size_t path_maxncpy, int frame, int digits) ATTR_NONNULL(1) |
| bool | BLI_path_frame_range (char *path, size_t path_maxncpy, int sta, int end, int digits) ATTR_NONNULL(1) |
| bool | BLI_path_frame_get (const char *path, int *r_frame, int *r_digits_len) ATTR_NONNULL(1 |
| bool void | BLI_path_frame_strip (char *path, char *r_ext, size_t ext_maxncpy) ATTR_NONNULL(1 |
| bool void bool | BLI_path_frame_check_chars (const char *path) ATTR_NONNULL(1) ATTR_WARN_UNUSED_RESULT |
Current Working Directory Specific Paths | |
| bool | BLI_path_is_abs_from_cwd (const char *path) ATTR_NONNULL(1) ATTR_WARN_UNUSED_RESULT |
| bool | BLI_path_abs_from_cwd (char *path, size_t path_maxncpy) ATTR_NONNULL(1) |
OS Level Wrappers | |
TODO: move these to a different module, they are not path functions. | |
| void | BLI_setenv (const char *env, const char *val) ATTR_NONNULL(1) |
| void | BLI_setenv_if_new (const char *env, const char *val) ATTR_NONNULL(1) |
| const char * | BLI_getenv (const char *env) ATTR_NONNULL(1) ATTR_WARN_UNUSED_RESULT |
Path Comparison / Contains | |
| #define | BLI_path_cmp strcmp |
| #define | BLI_path_ncmp strncmp |
| int | BLI_path_cmp_normalized (const char *p1, const char *p2) ATTR_NONNULL(1 |
| bool | BLI_path_contains (const char *container_path, const char *containee_path) ATTR_NONNULL(1 |
Blender Specific File Relative Paths | |
| #define | FILE_MAXDIR 768 |
| #define | FILE_MAXFILE 256 |
| #define | FILE_MAX 1024 |
| bool | BLI_path_abs (char path[FILE_MAX], const char *basepath) ATTR_NONNULL(1 |
| bool void | BLI_path_rel (char path[FILE_MAX], const char *basepath) ATTR_NONNULL(1) |
| bool | BLI_path_is_rel (const char *path) ATTR_NONNULL(1) ATTR_WARN_UNUSED_RESULT |
Native Slash Defines & Checks | |
| #define | SEP '/' |
| #define | ALTSEP '\\' |
| #define | SEP_STR "/" |
| #define | ALTSEP_STR "\\" |
| BLI_INLINE bool | BLI_path_slash_is_native_compat (const char ch) |
Path Queries | |
| bool | ATTR_WARN_UNUSED_RESULT |
| bool | BLI_path_name_at_index (const char *__restrict path, int index, int *__restrict r_offset, int *__restrict r_len) ATTR_NONNULL(1 |
| bool | BLI_path_is_unc (const char *path) ATTR_NONNULL(1) ATTR_WARN_UNUSED_RESULT |
| bool | BLI_path_is_win32_drive (const char *path) |
| bool | BLI_path_is_win32_drive_only (const char *path) |
| bool | BLI_path_is_win32_drive_with_slash (const char *path) |
| #define _BLI_PATH_JOIN_ARGS_1 char *__restrict dst, size_t dst_maxncpy, const char *a |
Definition at line 370 of file BLI_path_utils.hh.
| #define _BLI_PATH_JOIN_ARGS_10 _BLI_PATH_JOIN_ARGS_9, const char *j |
Definition at line 379 of file BLI_path_utils.hh.
| #define _BLI_PATH_JOIN_ARGS_2 _BLI_PATH_JOIN_ARGS_1, const char *b |
Definition at line 371 of file BLI_path_utils.hh.
| #define _BLI_PATH_JOIN_ARGS_3 _BLI_PATH_JOIN_ARGS_2, const char *c |
Definition at line 372 of file BLI_path_utils.hh.
| #define _BLI_PATH_JOIN_ARGS_4 _BLI_PATH_JOIN_ARGS_3, const char *d |
Definition at line 373 of file BLI_path_utils.hh.
| #define _BLI_PATH_JOIN_ARGS_5 _BLI_PATH_JOIN_ARGS_4, const char *e |
Definition at line 374 of file BLI_path_utils.hh.
| #define _BLI_PATH_JOIN_ARGS_6 _BLI_PATH_JOIN_ARGS_5, const char *f |
Definition at line 375 of file BLI_path_utils.hh.
| #define _BLI_PATH_JOIN_ARGS_7 _BLI_PATH_JOIN_ARGS_6, const char *g |
Definition at line 376 of file BLI_path_utils.hh.
| #define _BLI_PATH_JOIN_ARGS_8 _BLI_PATH_JOIN_ARGS_7, const char *h |
Definition at line 377 of file BLI_path_utils.hh.
| #define _BLI_PATH_JOIN_ARGS_9 _BLI_PATH_JOIN_ARGS_8, const char *i |
Definition at line 378 of file BLI_path_utils.hh.
| #define ALTSEP '\\' |
Definition at line 718 of file BLI_path_utils.hh.
Referenced by BLI_path_canonicalize_native(), BLI_path_extension_or_end(), BLI_path_slash_is_native_compat(), BLI_path_slash_native(), current_relpath_append(), and blender::asset_system::tests::TEST_F().
| #define ALTSEP_STR "\\" |
Definition at line 720 of file BLI_path_utils.hh.
Referenced by blender::asset_system::AssetLibraryService::normalize_asset_weak_reference_relative_asset_identifier(), and blender::asset_system::AssetLibraryService::rfind_blendfile_extension().
| #define BLI_path_cmp strcmp |
Definition at line 527 of file BLI_path_utils.hh.
Referenced by BKE_image_load_exists_in_lib(), BKE_movieclip_file_add_exists_ex(), BKE_preferences_extension_repo_add(), BKE_sound_new_file_exists_ex(), BKE_vfont_load_exists_ex(), blf_font_new_impl(), blf_search_by_filepath(), BLF_unload(), BLI_path_cmp_normalized(), blo_find_main(), BLO_write_file_impl(), direct_link_library(), filelist_readjob_list_dir(), folderlist_clear_next(), folderlist_pushdir(), fsmenu_get_active_indices(), blender::ed::outliner::lib_relocate(), python_script_error_jump(), surface_duplicateOutputExists(), blender::asset_system::tests::TEST_F(), blender::asset_system::tests::TEST_F(), blender::asset_system::tests::TEST_F(), blender::asset_system::tests::TEST_F(), text_jump_to_file_at_point_internal(), wm_file_write_check_with_report_on_failure(), wm_history_file_update(), wm_lib_relocate_exec_do(), and wm_link_append_exec().
| #define BLI_path_join | ( | ... | ) | VA_NARGS_CALL_OVERLOAD(_BLI_path_join_, __VA_ARGS__) |
Join multiple strings into a path, ensuring only a single path separator between each, and trailing slash is kept.
| path | The first patch which has special treatment, allowing // prefix which is kept intact unlike double-slashes which are stripped from the bounds of all other paths passed in. Passing in the following paths all result in the same output (//a/b/c):
|
SEP_STR as the last path argument, duplicate slashes will be cleaned up. Definition at line 368 of file BLI_path_utils.hh.
Referenced by blender::asset_system::asset_definition_default_file_path_from_dir(), autocomplete_directory(), blender::ed::object::bake_simulation::bake_directory_has_data(), blender::ed::object::bake_simulation::bake_geometry_nodes_startjob(), MANTA::bakeData(), MANTA::bakeGuiding(), MANTA::bakeMesh(), MANTA::bakeNoise(), MANTA::bakeParticles(), BKE_appdir_app_template_has_userpref(), BKE_appdir_app_template_id_search(), BKE_appdir_folder_caches(), BKE_appdir_folder_documents(), BKE_appdir_program_python_search(), BKE_blendfile_userdef_write_all(), BKE_bpath_foreach_path_dirfile_fixed_process(), BKE_image_get_tile_info(), BKE_image_save_options_init(), BKE_memfile_undo_encode(), BKE_modifier_path_init(), BKE_preferences_asset_library_default_add(), BKE_preferences_extension_repo_dirpath_get(), BKE_preferences_extension_repo_user_dirpath_get(), BKE_ptcache_disk_cache_rename(), BKE_ptcache_id_clear(), BlendfileLoadingBaseTest::blendfile_load(), blf_load_font_default(), BLI_path_abs_from_cwd(), BPY_python_start(), blender::io::hydra::cache_or_get_image_file(), blender::seq::check_media_missing(), blender::ed::object::collection_exporter_export(), colormanagement_init(), blender::io::usd::copy_asset_to_directory(), blender::io::usd::copy_single_file(), blender::io::usd::copy_tiled_textures(), blender::io::usd::copy_udim_asset_to_directory(), blender::io::usd::create_temp_path_for_usdz_export(), draw_seq_text_get_source(), dynamicPaint_bakeImageSequence(), ED_file_read_bookmarks(), ED_fsmenu_entry_set_name(), ED_fsmenu_entry_set_path(), blender::io::usd::export_endjob_usdz_cleanup(), blender::io::usd::export_in_memory_texture(), blender::io::usd::export_packed_texture(), blender::io::usd::export_texture(), MANTA::exportLiquidScript(), MANTA::exportSmokeScript(), file_draw_check_exists(), file_expand_directory(), file_filename_enter_handle(), file_sfile_to_operator_ex(), fileentry_uiname(), filelist_file_get_full_path(), filelist_readjob_list_dir(), blender::asset_system::AssetCatalogService::find_suitable_cdf_path_for_writing(), fluid_bake_startjob(), Freestyle_Init(), blender::bke::bake::BakePath::from_single_root(), fsmenu_read_system(), fsmenu_write_file_and_refresh_or_report_error(), fsmenu_xdg_insert_entry(), fsmenu_xdg_user_dirs_parse(), blender::asset_system::AssetRepresentation::full_path(), blender::bke::bake::get_default_modifier_bake_directory(), blender::bke::bake::get_default_node_bake_directory(), blender::io::usd::get_image_cache_file(), get_index_dir(), blender::bke::bake::get_node_bake_path(), blender::seq::get_path_from_seq(), get_path_local_ex(), get_proxy_filepath(), blender::ui::string_search::get_recent_searches_file_path(), blender::nodes::node_composite_file_output_cc::FileOutputOperation::get_single_layer_image_base_path(), get_tc_filepath(), blender::io::usd::get_tex_image_asset_filepath(), blender::io::usd::get_tex_image_asset_filepath(), blender::compositor::DebugInfo::graphviz(), blender::io::usd::image_cache_file_path(), image_foreach_path(), image_sequence_get_frame_ranges(), load_data_init_from_operator(), blender::tests::ChangeWorkingDirectoryTest::make_pseudo_unique_temp_filename(), make_temp_filepath(), material_copybuffer_filepath_get(), missing_files_find__recursive(), blender::io::obj::MTLParser::MTLParser(), new_folder_path(), open_exec(), blender::ed::outliner::outliner_copybuffer_filepath_get(), path_destination_ensure_filename(), blender::io::path_reference(), blender::ed::io::paths_from_operator_properties(), blender::io::usd::perform_usdz_conversion(), pose_copybuffer_filepath_get(), blender::bke::bake::DiskBlobReader::read(), renamebutton_cb(), render_result_exr_file_cache_path(), SEQ_add_image_init_alpha_mode(), SEQ_add_reload_new_file(), seq_disk_cache_get_dir(), seq_disk_cache_get_project_dir(), seq_disk_cache_handle_versioning(), seq_doversion_250_sound_proxy_update_cb(), seq_open_anim_file(), seq_proxy_get_custom_file_filepath(), seq_proxy_index_dir_set(), seq_proxy_multiview_context_invalid(), seq_render_image_strip(), sequencer_add_movie_multiple_strips(), sequencer_add_sound_multiple_strips(), sequencer_change_path_invoke(), sequencer_copybuffer_filepath_get(), blender::ed::asset::set_filepath_for_asset_lib(), blender::io::usd::UsdUsdzExportTest::SetUp(), sig_handle_crash(), blender::io::usd::temp_textures_dir(), blender::seq::thumbnail_cache_invalidate_strip(), blender::bke::bake::unpack_bake_to_disk(), unpack_generate_paths(), unpack_menu(), blender::io::hydra::USDSceneDelegate::USDSceneDelegate(), view3d_copybuffer_filepath_get(), wm_autosave_delete(), wm_autosave_location(), wm_block_splash_create(), wm_block_splash_image(), WM_exit_ex(), WM_file_recover_last_session(), wm_history_file_read(), wm_history_file_write(), wm_homefile_read_ex(), wm_homefile_write_exec(), wm_init_splash_show_on_startup_check(), wm_lib_relocate_exec_do(), wm_link_append_exec(), wm_platform_support_check_approval(), workspace_config_file_read(), workspace_system_file_read(), blender::io::usd::world_material_to_dome_light(), blender::bke::bake::DiskBlobWriter::write(), blender::bke::bake::DiskBlobWriter::write_as_stream(), and DocumentImporter::writeImage().
| #define BLI_path_ncmp strncmp |
Definition at line 528 of file BLI_path_utils.hh.
Referenced by BKE_autoexec_match(), fsmenu_insert_entry(), get_proxy_filepath(), IMB_thumb_delete(), IMB_thumb_manage(), missing_files_find__recursive(), and thumb_create_ex().
| #define FILE_MAX 1024 |
Definition at line 657 of file BLI_path_utils.hh.
Referenced by absolute_convert_foreach_path_cb(), appdir_app_template_directories(), blender::io::obj::append_frame_to_filename(), arg_handle_python_file_run(), blender::ed::asset::asset_bundle_install_exec(), blender::bke::asset_root_path_for_save(), blender::bke::asset_weak_reference_for_user_library(), autocomplete_directory(), autocomplete_file(), blender::ed::object::bake_simulation::bake_directory_has_data(), blender::ed::object::bake_simulation::bake_geometry_nodes_startjob(), blender::ed::object::bake_simulation::bake_simulation_get_path_users(), blender::ed::object::bake_targets_output_external(), MANTA::bakeData(), MANTA::bakeGuiding(), MANTA::bakeMesh(), MANTA::bakeNoise(), MANTA::bakeParticles(), BKE_appdir_app_template_has_userpref(), BKE_appdir_folder_id(), BKE_appdir_folder_id_user_notest(), BKE_appdir_resource_path_id_with_version(), BKE_blendfile_append(), BKE_blendfile_userdef_write_all(), BKE_bpath_foreach_path_allocated_process(), BKE_bpath_foreach_path_dirfile_fixed_process(), BKE_bpath_foreach_path_fixed_process(), BKE_cachefile_eval(), BKE_cachefile_filepath_get(), BKE_image_get_tile_info(), BKE_image_load_exists_in_lib(), BKE_image_load_in_lib(), BKE_image_memorypack(), BKE_image_packfiles(), BKE_image_render_write(), BKE_image_set_filepath_from_tile_number(), BKE_image_signal(), BKE_image_user_file_path_ex(), BKE_memfile_undo_encode(), BKE_movieclip_file_add(), BKE_movieclip_file_add_exists_ex(), BKE_movieclip_filepath_for_frame(), BKE_packedfile_compare_to_file(), BKE_packedfile_new(), BKE_packedfile_unpack(), BKE_packedfile_unpack_to_file(), BKE_packedfile_write_to_file(), BKE_scene_multiview_filepath_get(), BKE_scene_multiview_view_filepath_get(), BKE_scene_undo_depsgraphs_restore(), BKE_sound_new_file(), BKE_sound_new_file_exists_ex(), BKE_text_file_modified_check(), BKE_text_file_modified_ignore(), BKE_text_load_ex(), BKE_text_reload(), BKE_vfont_load_exists_ex(), BKE_volume_load(), BlendfileLoadingBaseTest::blendfile_load(), blf_load_font_default(), BLI_change_working_dir(), BLI_dir_create_recursive(), BLI_expand_tilde(), BLI_file_ensure_parent_dir_exists(), BLI_file_is_writable(), BLI_path_abs(), BLI_path_rel(), blo_find_main(), BLO_write_file_impl(), block_create__close_file_dialog(), block_create_save_file_overwrite_dialog(), bpy_lib_write(), BPY_python_start(), blender::ed::sculpt_paint::brush_asset_load_preview_exec(), build_pict_list_from_image_sequence(), blender::gpu::cache_dir_get(), blender::io::hydra::cache_or_get_image_file(), cachefile_layer_add_exec(), cachefile_layer_open_invoke(), cachefile_open_exec(), cachefile_open_invoke(), blender::seq::check_media_missing(), blender::seq::check_sound_media_missing(), clip_drop_copy(), blender::ed::object::collection_exporter_export(), colormanagement_init(), console_drop_path_copy(), blender::io::usd::copy_asset_to_directory(), copy_material_exec(), blender::io::usd::copy_single_file(), blender::io::usd::copy_tiled_textures(), blender::io::usd::copy_udim_asset_to_directory(), blender::io::alembic::create_archive(), blender::io::usd::create_temp_path_for_usdz_export(), customdata_external_filename(), CustomData_external_read(), CustomData_external_write(), detect_clip_source(), do_history(), do_makepicstring(), do_versions_nodetree_multi_file_output_format_2_62_1(), do_write_image_or_movie(), blender::nodes::draw_common_bake_settings(), draw_seq_in_view(), draw_seq_text_get_overlay_string(), draw_seq_text_overlay(), drop_import_file_copy(), dynamicPaint_bakeImageSequence(), dynamicPaint_outputSurfaceImage(), ED_file_path_button(), ED_file_read_bookmarks(), ED_fileselect_ensure_default_filepath(), ED_image_filesel_detect_sequences(), blender::nodes::node_composite_file_output_cc::FileOutputOperation::execute_multi_layer(), blender::nodes::node_composite_file_output_cc::FileOutputOperation::execute_single_layer(), blender::nodes::node_composite_file_output_cc::FileOutputOperation::execute_single_layer_multi_view_exr(), blender::io::usd::export_endjob_usdz_cleanup(), blender::io::obj::export_frame(), blender::io::stl::export_frame(), blender::io::usd::export_in_memory_texture(), blender::io::usd::export_packed_texture(), blender::io::usd::export_texture(), blender::io::obj::exporter_main(), MANTA::exportLiquidScript(), MANTA::exportSmokeScript(), file_browse_exec(), file_browse_invoke(), file_directory_new_exec(), file_draw_check_exists(), file_draw_tooltip_custom_func(), file_execute(), file_external_operation_exec(), file_filename_enter_handle(), file_handler_import_operator_create_ptr(), blender::bke::bake::file_name_to_frame(), file_operator_to_sfile(), FILE_OT_directory_new(), FILE_OT_external_operation(), FILE_OT_filepath_drop(), file_select_do(), file_select_match(), file_sfile_to_operator(), file_sfile_to_operator_ex(), filelist_readjob_list_dir(), filepath_drop_exec(), blender::ed::io::filesel_drop_import_invoke(), fileselect_ensure_updated_file_params(), fluid_bake_startjob(), fluid_validatepaths(), font_open_exec(), blender::bke::bake::frame_to_file_name(), Freestyle_Init(), blender::bke::bake::BakePath::from_single_root(), fsmenu_read_system(), fsmenu_write_file(), fsmenu_write_file_and_refresh_or_report_error(), fsmenu_xdg_user_dirs_parse(), blender::asset_system::AssetRepresentation::full_path(), blender::io::usd::get_absolute_path(), blender::bke::bake::get_blend_file_name(), blender::bke::bake::get_default_modifier_bake_directory(), blender::bke::bake::get_default_node_bake_directory(), get_drag_path(), blender::ed::asset::index::BlendFile::get_filename(), blender::io::usd::get_image_cache_file(), blender::io::obj::get_image_filepath(), blender::io::usd::get_in_memory_texture_filename(), blender::bke::bake::get_modifier_bake_path(), blender::bke::bake::get_node_bake_path(), get_path_environment_ex(), blender::seq::get_path_from_seq(), get_path_local_ex(), get_path_system_ex(), get_path_user_ex(), get_proxy_filepath(), blender::ui::string_search::get_recent_searches_file_path(), blender::io::usd::get_relative_path(), get_sequence_filepath(), blender::nodes::node_composite_file_output_cc::FileOutputOperation::get_single_layer_image_base_path(), blender::io::usd::get_tex_image_asset_filepath(), blender::io::usd::get_tex_image_asset_filepath(), blender::io::usd::get_tex_image_asset_filepath(), get_thumb_dir(), get_udim_tiles(), Freestyle::StringUtils::getPathName(), blender::compositor::DebugInfo::graphviz(), handle_load_file(), icon_preview_imbuf_from_brush(), image_abs_path(), blender::io::usd::image_cache_file_path(), image_file_browse_exec(), image_file_browse_invoke(), image_foreach_path(), image_init_color_management(), image_replace_exec(), image_save_sequence_exec(), image_save_single(), image_sequence_get_frame_ranges(), image_update_views_format(), IMB_anim_index_rebuild_context(), IMB_anim_open_index(), IMB_anim_open_proxy(), IMB_anim_proxy_get_existing(), IMB_thumb_delete(), IMB_thumb_makedirs(), IMB_thumb_manage(), IMB_thumb_read(), blender::io::usd::import_asset(), blender::io::ply::import_mesh(), blender::io::ply::importer_main(), blender::io::stl::importer_main(), index_dir_set(), blender::ed::asset::index::AssetLibraryIndex::init_indices_base_path(), lib_id_library_local_paths_callback(), lib_id_load_custom_preview_exec(), blender::ed::outliner::lib_relocate(), load_image_single(), load_movie_single(), Freestyle::Controller::LoadMesh(), blender::tests::ChangeWorkingDirectoryTest::make_pseudo_unique_temp_filename(), make_temp_filepath(), meshcache_do(), missing_files_find__recursive(), missing_files_find_foreach_path_cb(), movieclip_build_proxy_ibuf(), movieclip_calc_length(), movieclip_load_sequence_file(), movieclip_open_anim_file(), blender::io::obj::MTLParser::MTLParser(), blender::io::obj::MTLWriter::MTLWriter(), blender::ed::object::multires_external_save_exec(), blender::ed::object::multires_external_save_invoke(), blender::ed::outliner::namebutton_fn(), new_folder_path(), blender::ed::object::OBJECT_OT_bake(), open_anim_file_multiview(), open_exec(), open_invoke(), open_invoke(), blender::ed::outliner::outliner_id_copy_exec(), blender::ed::outliner::outliner_id_paste_exec(), PAINT_OT_image_from_view(), blender::io::usd::parent_dir_exists_on_file_system(), paste_material_exec(), blender::ed::io::paths_from_operator_properties(), blender::io::usd::perform_usdz_conversion(), playanim_toscreen_ex(), pose_paste_exec(), preferences_extension_repo_add_exec(), preferences_extension_repo_remove_exec(), preferences_extension_repo_remove_invoke(), prefetch_read_file_to_memory(), blender::io::usd::process_usdz_textures(), proxy_thread_next_frame(), python_script_exec(), RE_RenderAnim(), RE_RenderFrame(), blender::bke::bake::DiskBlobReader::read(), blender::io::grease_pencil::SVGImporter::read(), recursive_operation(), relative_convert_foreach_path_cb(), relative_rebase_foreach_path_cb(), renamebutton_cb(), render_result_exr_file_cache_path(), rigidbody_world_export_exec(), RNA_api_image(), RNA_api_scene(), RNA_api_scene_render(), rna_def_depsgraph(), rna_def_fluid_domain_settings(), RNA_def_main(), RNA_def_main_movieclips(), RNA_def_main_sounds(), RNA_def_main_texts(), rna_def_render_result(), run_pyfile_exec(), save_set_filepath(), scene_undo_depsgraph_gen_key(), screen_opengl_render_anim_step(), screen_opengl_render_write(), screenshot_exec(), screenshot_invoke(), SCRIPT_OT_python_file_run(), SEQ_add_image_init_alpha_mode(), SEQ_add_image_strip(), SEQ_add_movie_strip(), SEQ_add_reload_new_file(), seq_disk_cache_add_file_to_list(), seq_disk_cache_delete_invalid_files(), seq_disk_cache_get_dir(), seq_disk_cache_get_files(), seq_disk_cache_get_project_dir(), seq_disk_cache_handle_versioning(), seq_disk_cache_read_file(), seq_disk_cache_write_file(), seq_doversion_250_sound_proxy_update_cb(), SEQ_effect_text_font_load(), seq_open_anim_file(), seq_proxy_get_custom_file_filepath(), seq_proxy_index_dir_set(), seq_proxy_multiview_context_invalid(), seq_render_image_strip(), seq_render_image_strip_view(), sequence_guess_offset(), sequencer_add_movie_multiple_strips(), sequencer_add_sound_multiple_strips(), sequencer_change_path_exec(), sequencer_change_path_invoke(), sequencer_clipboard_copy_exec(), sequencer_clipboard_paste_exec(), sequencer_drop_copy(), sequencer_export_subtitles_exec(), sequencer_generic_invoke_path__internal(), sequencer_image_seq_reserve_frames(), blender::ed::asset::set_filepath_for_asset_lib(), blender::io::usd::UsdUsdzExportTest::SetUp(), blender::tests::FileOpsTest::SetUp(), sig_handle_crash(), sound_mixdown_exec(), blender::bke::tests::TEST(), blender::bke::tests::TEST(), blender::io::obj::TEST(), blender::io::obj::TEST(), blender::io::obj::TEST(), blender::tests::TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), test_env_path(), blender::io::usd::TEST_F(), blender::tests::TEST_F(), text_jump_to_file_at_point_exec(), text_open_exec(), TEXT_OT_jump_to_file_at_point(), text_save_as_exec(), texture_paint_image_from_view_exec(), thumb_create_ex(), blender::seq::thumbnail_cache_invalidate_strip(), thumbpathname_from_uri(), txt_write_file(), ui_but_menu_add_path_operators(), ui_popup_context_menu_for_button(), ui_tooltip_from_clip(), ui_tooltip_from_image(), uiTemplateMovieclipInformation(), uiTemplateRecentFiles_tooltip_func(), blender::bke::bake::unpack_bake_to_disk(), unpack_generate_paths(), blender::bke::bake::unpack_geometry_nodes_bake(), unpack_menu(), uri_from_filename(), blender::io::usd::USD_path_abs(), blender::io::hydra::USDSceneDelegate::USDSceneDelegate(), user_frame_to_cache_frame(), view3d_copybuffer_exec(), VIEW3D_OT_camera_background_image_add(), view3d_pastebuffer_exec(), blender::ed::object::volume_import_exec(), wm_autosave_delete(), wm_autosave_location(), WM_autosave_write(), wm_autosave_write_try(), wm_block_splash_create(), wm_block_splash_image(), WM_exit_ex(), WM_file_autoexec_init(), WM_file_recover_last_session(), wm_file_write_check_with_report_on_failure(), wm_filepath_default(), wm_history_file_read(), wm_history_file_write(), wm_homefile_read_ex(), wm_homefile_read_exec(), wm_homefile_write_exec(), wm_homefile_write_invoke(), wm_init_splash_show_on_startup_check(), wm_lib_relocate_exec_do(), wm_link_append_exec(), wm_link_append_invoke(), wm_open_mainfile__open(), wm_open_mainfile_check(), wm_open_mainfile_get_description(), WM_operator_drop_load_path(), WM_operator_filesel_ensure_ext_imtype(), WM_operator_properties_filesel(), WM_OT_drop_import_file(), WM_OT_read_homefile(), wm_platform_support_check_approval(), wm_read_factory_settings_invoke(), wm_recover_auto_save_exec(), wm_recover_auto_save_invoke(), wm_revert_mainfile_exec(), wm_save_as_mainfile_exec(), wm_save_mainfile_check(), wm_userpref_read_invoke(), workspace_add_invoke(), workspace_append_activate_exec(), workspace_config_file_read(), WORKSPACE_OT_append_activate(), workspace_system_file_read(), blender::io::usd::world_material_to_dome_light(), blender::bke::bake::DiskBlobWriter::write(), blender::bke::bake::DiskBlobWriter::write_as_stream(), write_crash_blend(), blender::io::obj::MTLWriter::write_materials(), write_result(), and DocumentImporter::writeImage().
| #define FILE_MAXDIR 768 |
These values need to be hard-coded in structs, DNA does not recognize defines (also defined in DNA_space_types.h).
.blend file paths, where FILE_MAX assumed to be the limit of all paths passes into these functions.Some parts of the API which use FILE_MAX which aren't specifically handling blend file paths, in most cases these can be updated to use PATH_MAX or a platform specific limit.
Definition at line 655 of file BLI_path_utils.hh.
Referenced by AS_asset_library_find_suitable_root_path_from_path(), BKE_appdir_folder_default(), BKE_appdir_folder_documents(), BKE_appdir_font_folder_default(), BKE_image_get_tile_info(), BKE_image_tile_filepath_exists(), BKE_main_merge(), BKE_preferences_asset_library_default_add(), bli_builddir(), BLI_dir_free_space(), BLI_file_alias_target(), BLI_file_alias_target(), BLI_file_attributes(), blender::io::hydra::cache_or_get_image_file(), do_versions_nodetree_multi_file_output_format_2_62_1(), ED_sequencer_select_sequence_single(), FILE_OT_select_bookmark(), filelist_cache_previews_push(), filelist_readjob_list_dir(), fluid_validatepaths(), folderlist_popdir(), fsmenu_read_bookmarks(), fsmenu_read_system(), fsmenu_xdg_insert_entry(), fsmenu_xdg_user_dirs_parse(), get_index_dir(), get_proxy_filepath(), get_tc_filepath(), image_foreach_path(), image_sequence_get_frame_ranges(), blender::io::usd::import_asset(), lib_id_library_local_paths_callback(), blender::ed::outliner::lib_relocate(), blender::io::obj::MTLParser::MTLParser(), relative_rebase_foreach_path_cb(), render_result_exr_file_cache_path(), seq_disk_cache_add_file_to_list(), sequencer_select_set_active(), blender::io::usd::temp_textures_dir(), ui_but_menu_add_path_operators(), ui_popup_context_menu_for_button(), unpack_generate_paths(), unpack_menu(), wm_lib_relocate_exec_do(), wm_link_append_exec(), and blender::io::obj::OBJWriter::write_mtllib_name().
| #define FILE_MAXFILE 256 |
Definition at line 656 of file BLI_path_utils.hh.
Referenced by blender::bke::asset_blendfile_path_for_save(), BKE_image_get_tile_info(), BKE_studiolight_create(), BKE_studiolight_find(), BKE_vfont_load(), blender::io::usd::copy_tiled_textures(), do_versions_nodetree_multi_file_output_format_2_62_1(), ED_fsmenu_entry_set_name(), ED_fsmenu_entry_set_path(), file_directory_new_exec(), file_draw_string(), file_panel_execution_buttons_draw(), filelist_readjob_recursive_dir_add_items(), filenum_newname(), fsmenu_read_bookmarks(), fsmenu_read_system(), blender::io::usd::get_asset_base_name(), blender::bke::FileHandlerType::get_default_filename(), get_index_dir(), get_proxy_filepath(), get_tc_filepath(), image_foreach_path(), lib_id_library_local_paths_callback(), new_folder_path(), blender::io::obj::OBJParser::parse(), preferences_asset_library_add_exec(), relative_rebase_foreach_path_cb(), render_result_exr_file_cache_path(), seq_disk_cache_get_file_path(), seq_proxy_index_dir_set(), studiolight_add_file(), ui_but_menu_add_path_operators(), blender::io::hydra::USDSceneDelegate::USDSceneDelegate(), wm_filepath_default(), wm_save_as_mainfile_exec(), and blender::io::obj::OBJWriter::write_mtllib_name().
| #define FILENAME_CURRENT "." |
Definition at line 779 of file BLI_path_utils.hh.
Referenced by bli_builddir().
| #define FILENAME_IS_CURRENT | ( | _n | ) | (((_n)[0] == '.') && ((_n)[1] == '\0')) |
Definition at line 783 of file BLI_path_utils.hh.
Referenced by bli_builddir(), compare_direntry_generic(), and direntry_cmp().
| #define FILENAME_IS_CURRPAR | ( | _n | ) | (((_n)[0] == '.') && (((_n)[1] == '\0') || (((_n)[1] == '.') && ((_n)[2] == '\0')))) |
Definition at line 784 of file BLI_path_utils.hh.
Referenced by autocomplete_directory(), BKE_appdir_app_templates(), bli_builddir(), file_box_select_modal(), file_draw_list(), filelist_get_details_column_string(), filelist_readjob_list_dir(), filelist_readjob_should_recurse_into_entry(), is_filtered_file_type(), missing_files_find__recursive(), recursive_operation_impl(), and seq_disk_cache_get_files().
| #define FILENAME_IS_PARENT | ( | _n | ) | (((_n)[0] == '.') && ((_n)[1] == '.') && ((_n)[2] == '\0')) |
Definition at line 782 of file BLI_path_utils.hh.
Referenced by bli_builddir(), compare_direntry_generic(), direntry_cmp(), file_execute(), file_select_do(), filelist_geticon_ex(), and filelist_geticon_image_ex().
| #define FILENAME_PARENT ".." |
Definition at line 778 of file BLI_path_utils.hh.
Referenced by bli_builddir(), and filelist_readjob_list_lib_navigate_to_parent_entry_create().
| #define SEP '/' |
Definition at line 717 of file BLI_path_utils.hh.
Referenced by blender::bke::asset_blendfile_path_for_save(), blender::bke::asset_root_path_for_save(), blender::bke::asset_write_in_library(), bli_builddir(), BLI_path_canonicalize_native(), BLI_path_extension_or_end(), BLI_path_join_array(), BLI_path_slash_ensure_ex(), BLI_path_slash_is_native_compat(), BLI_path_slash_native(), bpy_text_filepath_get(), current_relpath_append(), file_expand_directory(), fsmenu_insert_entry(), path_normalize_impl(), blender::asset_system::AssetLibraryService::resolve_asset_weak_reference_to_exploded_path(), strbuf_append_path(), blender::tests::TEST(), blender::asset_system::tests::TEST_F(), and blender::asset_system::tests::TEST_F().
| #define SEP_STR "/" |
Definition at line 719 of file BLI_path_utils.hh.
| BLI_INLINE size_t _BLI_path_join_10 | ( | _BLI_PATH_JOIN_ARGS_8 | ) |
Definition at line 427 of file BLI_path_utils.hh.
References ARRAY_SIZE, b, BLI_path_join_array(), and e.
| BLI_INLINE size_t _BLI_path_join_11 | ( | _BLI_PATH_JOIN_ARGS_9 | ) |
Definition at line 432 of file BLI_path_utils.hh.
References ARRAY_SIZE, b, BLI_path_join_array(), and e.
| BLI_INLINE size_t _BLI_path_join_12 | ( | _BLI_PATH_JOIN_ARGS_10 | ) |
Definition at line 437 of file BLI_path_utils.hh.
References ARRAY_SIZE, b, BLI_path_join_array(), and e.
| BLI_INLINE size_t _BLI_path_join_3 | ( | _BLI_PATH_JOIN_ARGS_1 | ) |
Definition at line 392 of file BLI_path_utils.hh.
References ARRAY_SIZE, and BLI_path_join_array().
| BLI_INLINE size_t _BLI_path_join_4 | ( | _BLI_PATH_JOIN_ARGS_2 | ) |
Definition at line 397 of file BLI_path_utils.hh.
References ARRAY_SIZE, b, and BLI_path_join_array().
| BLI_INLINE size_t _BLI_path_join_5 | ( | _BLI_PATH_JOIN_ARGS_3 | ) |
Definition at line 402 of file BLI_path_utils.hh.
References ARRAY_SIZE, b, and BLI_path_join_array().
| BLI_INLINE size_t _BLI_path_join_6 | ( | _BLI_PATH_JOIN_ARGS_4 | ) |
Definition at line 407 of file BLI_path_utils.hh.
References ARRAY_SIZE, b, and BLI_path_join_array().
| BLI_INLINE size_t _BLI_path_join_7 | ( | _BLI_PATH_JOIN_ARGS_5 | ) |
Definition at line 412 of file BLI_path_utils.hh.
References ARRAY_SIZE, b, BLI_path_join_array(), and e.
| BLI_INLINE size_t _BLI_path_join_8 | ( | _BLI_PATH_JOIN_ARGS_6 | ) |
Definition at line 417 of file BLI_path_utils.hh.
References ARRAY_SIZE, b, BLI_path_join_array(), and e.
| BLI_INLINE size_t _BLI_path_join_9 | ( | _BLI_PATH_JOIN_ARGS_7 | ) |
Definition at line 422 of file BLI_path_utils.hh.
References ARRAY_SIZE, b, BLI_path_join_array(), and e.
| const char * BLI_getenv | ( | const char * | env | ) |
Get an environment variable, result has to be used immediately.
On windows #getenv gets its variables from a static copy of the environment variables taken at process start-up, causing it to not pick up on environment variables created during runtime. This function uses an alternative method to get environment variables that does pick up on runtime environment variables. The result will be UTF-8 encoded.
Definition at line 1368 of file path_utils.cc.
References alloc_utf16_from_8(), alloc_utf_8_from_16(), ARRAY_SIZE, free(), NULL, and result.
Referenced by BKE_appdir_folder_home(), BLI_current_working_dir(), BLI_path_program_search(), BLI_setenv_if_new(), BLI_temp_directory_path_get(), BLT_lang_init(), BPY_python_start(), colormanagement_init(), fsmenu_read_system(), get_thumb_dir(), GHOST_WindowWin32::GHOST_WindowWin32(), imb_init_dds(), test_env_path(), and wm_block_splash_create().
| bool BLI_path_abs | ( | char | path[FILE_MAX], |
| const char * | basepath ) |
If path begins with "//", strips that and replaces it with basepath directory.
| path | The path to convert. |
| basepath | The directory to base relative paths with. |
Referenced by absolute_convert_foreach_path_cb(), add_ibuf_for_tile(), blender::ed::object::bake_simulation::bake_simulation_get_path_users(), BKE_bpath_foreach_path_allocated_process(), BKE_bpath_foreach_path_dirfile_fixed_process(), BKE_bpath_foreach_path_fixed_process(), BKE_cachefile_filepath_get(), BKE_image_load_exists_in_lib(), BKE_image_save_options_init(), BKE_image_signal(), BKE_image_user_file_path_ex(), BKE_library_filepath_set(), BKE_movieclip_file_add(), BKE_movieclip_file_add_exists_ex(), BKE_movieclip_filepath_for_frame(), BKE_packedfile_compare_to_file(), BKE_packedfile_new(), BKE_packedfile_unpack_to_file(), BKE_packedfile_write_to_file(), BKE_sound_new_file(), BKE_sound_new_file_exists_ex(), BKE_text_file_modified_check(), BKE_text_file_modified_ignore(), BKE_text_load_ex(), BKE_text_reload(), BKE_vfont_load_exists_ex(), blo_find_main(), bookmark_select_exec(), bpy_lib_load(), bpy_lib_write(), blender::seq::check_media_missing(), blender::seq::check_sound_media_missing(), blender::ed::object::collection_exporter_export(), customdata_external_filename(), detect_clip_source(), direct_link_library(), do_makepicstring(), dynamicPaint_outputSurfaceImage(), file_browse_exec(), file_directory_enter_handle(), file_execute(), file_expand_directory(), file_filename_enter_handle(), file_operator_to_sfile(), file_parent_exec(), file_select_do(), filelist_readjob_recursive_dir_add_items(), filelist_setdir(), fileselect_ensure_updated_file_params(), fluid_bake_startjob(), fluid_validatepaths(), blender::io::usd::get_absolute_path(), get_drag_path(), blender::bke::bake::get_modifier_bake_path(), blender::bke::bake::get_node_bake_path(), blender::seq::get_path_from_seq(), get_proxy_filepath(), get_sequence_filepath(), icon_preview_imbuf_from_brush(), image_abs_path(), image_file_browse_exec(), image_file_browse_invoke(), image_save_options_from_op(), image_update_views_format(), blender::io::usd::import_asset(), blender::io::usd::import_startjob(), lib_id_library_local_paths_callback(), meshcache_do(), movieclip_open_anim_file(), blender::ed::outliner::namebutton_fn(), open_invoke(), open_invoke(), blender::io::path_reference(), proxy_dir_get(), ptcache_path(), blender::io::grease_pencil::SVGImporter::read(), relative_rebase_foreach_path_cb(), render_result_exr_file_cache_path(), screenshot_exec(), SEQ_add_image_init_alpha_mode(), SEQ_add_image_strip(), SEQ_add_movie_strip(), SEQ_add_reload_new_file(), seq_doversion_250_sound_proxy_update_cb(), SEQ_effect_text_font_load(), seq_open_anim_file(), seq_proxy_get_custom_file_filepath(), seq_proxy_get_filepath(), seq_proxy_multiview_context_invalid(), seq_render_image_strip(), sequencer_generic_invoke_path__internal(), sound_mixdown_exec(), blender::seq::thumbnail_cache_invalidate_strip(), txt_write_file(), blender::bke::bake::unpack_geometry_nodes_bake(), and blender::io::usd::USD_path_abs().
| bool BLI_path_abs_from_cwd | ( | char * | path, |
| size_t | path_maxncpy ) |
Checks for relative path, expanding them relative to the current working directory.
Definition at line 1217 of file path_utils.cc.
References BLI_current_working_dir(), BLI_path_is_abs_from_cwd(), BLI_path_join, BLI_string_debug_size_after_nil, PATH_MAX, printf, and STRNCPY.
Referenced by BLI_path_canonicalize_native(), BLI_temp_directory_path_copy_if_valid(), and where_am_i().
| size_t BLI_path_append | ( | char *__restrict | dst, |
| size_t | dst_maxncpy, | ||
| const char *__restrict | file ) |
Append a filename to a dir, ensuring slash separates.
dst. Referenced by file_directory_enter_handle(), blender::ed::asset::index::AssetLibraryIndex::init_indices_base_path(), blender::io::usd::process_usdz_textures(), seq_disk_cache_get_file_path(), and blender::io::usd::world_material_to_dome_light().
| size_t size_t BLI_path_append_dir | ( | char *__restrict | dst, |
| size_t | dst_maxncpy, | ||
| const char *__restrict | dir ) |
A version of BLI_path_append that ensures a trailing slash if there is space in dst.
dst. Referenced by file_execute(), file_select_do(), and blender::io::usd::world_material_to_dome_light().
| void void void const char * BLI_path_basename | ( | const char * | path | ) |
Like Python's os.path.basename()
Definition at line 1778 of file path_utils.cc.
References BLI_path_slash_rfind().
Referenced by blender::ed::asset::asset_bundle_install_exec(), blender::bke::asset_weak_reference_for_essentials(), BKE_image_add_from_imbuf(), BKE_image_ensure_tile_token(), BKE_image_is_filename_tokenized(), BKE_image_load_in_lib(), BKE_movieclip_file_add(), BKE_preferences_extension_remote_to_name(), BKE_sound_new_file(), BKE_text_load_ex(), BKE_volume_load(), blf_font_new_impl(), BLI_path_filename_ensure(), BLI_path_frame_get(), BLI_path_frame_strip(), BLI_path_split_dir_file(), BLI_path_split_dir_part(), BLI_path_split_file_part(), blo_find_main(), blender::io::hydra::cache_or_get_image_file(), cachefile_open_exec(), blender::ed::object::collection_exporter_export(), blender::io::obj::OBJExportRegressionTest::compare_obj_export_to_golden(), blender::io::stl::STLExportTest::compare_to_golden(), blender::io::obj::create_placeholder_image(), blender::io::usd::create_temp_path_for_usdz_export(), ensure_digits(), blender::io::stl::export_frame(), fileentry_uiname(), blender::io::obj::get_image_filepath(), import_file(), blender::io::ply::import_mesh(), blender::io::usd::import_startjob(), blender::io::ply::importer_main(), blender::io::stl::importer_main(), load_data_init_from_operator(), blender::io::obj::load_texture_image(), missing_files_find_foreach_path_cb(), blender::io::obj::OBJParser::parse(), path_destination_ensure_filename(), blender::io::path_reference(), preferences_extension_repo_add_exec(), report_duration(), report_duration(), seq_disk_cache_get_project_dir(), blender::ed::asset::set_filepath_for_asset_lib(), sig_handle_crash(), text_jump_to_file_at_point_external(), uiTemplateImageInfo(), uiTemplateMovieclipInformation(), uiTemplateRecentFiles(), wm_autosave_location(), wm_file_write(), WM_window_title(), and blender::io::obj::MTLWriter::write_header().
Convert path to a canonical representation. This is intended for system paths (passed in as command-line arguments of via scripts) which are valid in that they resolve to a file/directory and but could be CWD relative or contain redundant slashes that cause absolute/relative conversion to fail. (specifically the "//" prefix used by Blender).
Perform the following operations:
Definition at line 388 of file path_utils.cc.
References ALTSEP, BLI_path_abs_from_cwd(), BLI_path_normalize_native(), BLI_path_slash_is_native_compat(), BLI_path_slash_native(), and SEP.
Referenced by arg_handle_python_file_run(), BKE_appdir_program_path_init(), handle_load_file(), wm_open_mainfile__open(), wm_recover_auto_save_exec(), and wm_save_as_mainfile_exec().
| int BLI_path_cmp_normalized | ( | const char * | p1, |
| const char * | p2 ) |
Returns the result of BLI_path_cmp with both paths normalized and slashes made native.
Checking the normalized paths is not a guarantee the paths reference different files. An equivalent to Python's os.path.samefile could be supported for checking if paths point to the same location on the file-system (following symbolic-links).
Referenced by blender::io::usd::UsdExportTest::compare_blender_image_to_usd_image_shader(), blender::io::usd::copy_single_file(), blender::io::usd::copy_tiled_textures(), blender::io::usd::export_in_memory_texture(), blender::ed::sculpt_paint::library_to_library_ref(), blender::ed::object::bake_simulation::PathStringEquality::operator()(), operator==(), blender::io::path_reference_copy(), TEST(), blender::asset_system::tests::TEST_F(), blender::asset_system::tests::TEST_F(), and blender::tests::TEST_F().
| bool BLI_path_contains | ( | const char * | container_path, |
| const char * | containee_path ) |
Return true only if #containee_path is contained in #container_path.
Referenced by BKE_preferences_asset_library_containing_path(), filelist_contains_main(), blender::ed::asset::is_contained_in_selected_asset_library(), blender::io::path_reference(), and TEST().
| const char * BLI_path_extension | ( | const char * | filepath | ) |
Returns a pointer to the last extension (e.g. the position of the last period). Returns NULL if there is no extension.
Definition at line 1649 of file path_utils.cc.
References BLI_path_extension_or_end().
Referenced by BLI_path_extension_strip(), blender::ed::object::collection_exporter_export(), drop_extension_path_poll(), drop_extension_url_poll(), ED_text_is_syntax_highlight_supported(), blender::bke::file_handlers_poll_file_drop(), blender::bke::FileHandlerType::filter_supported_paths(), seq_disk_cache_get_files(), and TEST().
| bool BLI_path_extension_check | ( | const char * | path, |
| const char * | ext ) |
path end with ext (case insensitive). Referenced by BKE_image_is_openexr(), BKE_image_render_write(), BLI_file_alias_target(), BLI_file_attributes(), blo_do_versions_300(), blender::io::usd::create_temp_path_for_usdz_export(), blender::compositor::DebugInfo::delete_operation_exports(), ED_path_extension_type(), blender::io::stl::export_frame(), Freestyle::Controller::InsertStyleModule(), studiolight_add_file(), and thumb_create_ex().
| bool BLI_path_extension_check_array | ( | const char * | path, |
| const char ** | ext_array ) |
path ends with any of the suffixes in ext_array. Referenced by BKE_blendfile_extension_check(), BKE_image_load_in_lib(), do_ensure_image_extension(), ED_path_extension_type(), image_replace_exec(), and studiolight_add_file().
| bool BLI_path_extension_check_glob | ( | const char * | path, |
| const char * | ext_fnmatch ) |
Semicolon separated wildcards, eg: *.zip;*.py;*.exe does path match any of the semicolon-separated glob patterns in #fnmatch.
Referenced by BKE_cachefile_eval(), and filelist_readjob_list_dir().
| bool BLI_path_extension_check_n | ( | const char * | path, |
| ... ) |
Definition at line 1414 of file path_utils.cc.
References path_extension_check_ex(), and ret.
Referenced by BKE_image_alpha_mode_from_extension_ex(), blf_load_datafiles_dir(), ED_path_extension_type(), and blender::io::usd::set_job_filepath().
| bool BLI_path_extension_ensure | ( | char * | path, |
| size_t | path_maxncpy, | ||
| const char * | ext ) |
Strip's trailing '.'s and adds the extension only when needed
Referenced by BKE_cachefile_filepath_get(), do_ensure_image_extension(), blender::io::stl::export_frame(), blender::bke::FileHandlerType::get_default_filename(), make_temp_filepath(), save_set_filepath(), sequencer_export_subtitles_exec(), and wm_save_mainfile_check().
| bool BLI_path_extension_glob_validate | ( | char * | ext_fnmatch | ) |
Does basic validation of the given glob string, to prevent common issues from string truncation.
For now, only forbids last group to be a wildcard-only one, if there are more than one group (i.e. things like *.txt;*.cpp;* are changed to *.txt;*.cpp;)
Definition at line 1477 of file path_utils.cc.
References ELEM.
Referenced by fileselect_ensure_updated_file_params().
| const char * BLI_path_extension_or_end | ( | const char * | filepath | ) |
Returns a pointer to the last extension (e.g. the position of the last period). Returns a pointer to the nil byte when no extension is found.
Definition at line 1612 of file path_utils.cc.
References ALTSEP, BLI_assert, and SEP.
Referenced by BLI_path_extension(), BLI_path_extension_ensure(), BLI_path_extension_replace(), BLI_path_frame_get(), BLI_path_frame_strip(), BLI_path_sequence_decode(), BLI_path_suffix(), blender::io::hydra::cache_image_file(), and WM_window_title().
| bool BLI_path_extension_replace | ( | char * | path, |
| size_t | path_maxncpy, | ||
| const char * | ext ) |
Removes any existing extension on the end of path and appends ext.
Referenced by blender::io::obj::append_frame_to_filename(), blender::io::usd::create_temp_path_for_usdz_export(), do_ensure_image_extension(), ED_fileselect_ensure_default_filepath(), blender::io::obj::MTLWriter::MTLWriter(), sig_handle_crash(), and write_crash_blend().
| bool bool BLI_path_extension_strip | ( | char * | path | ) |
Remove the file extension.
path. Definition at line 1517 of file path_utils.cc.
References BLI_path_extension().
Referenced by blender::io::obj::append_frame_to_filename(), BLI_path_to_display_name(), filelist_readjob_list_dir(), blender::io::ply::import_mesh(), blender::io::ply::importer_main(), blender::io::stl::importer_main(), blender::io::obj::OBJParser::parse(), ptcache_path(), render_result_exr_file_cache_path(), screenshot_invoke(), and blender::ed::object::volume_import_exec().
| bool BLI_path_filename_ensure | ( | char * | filepath, |
| size_t | filepath_maxncpy, | ||
| const char * | filename ) |
Ensure filepath has a file component, adding filename when it's empty or ends with a slash.
filename was appended to filepath. Referenced by wm_filepath_default().
Replaces "#" character sequence in last slash-separated component of path with frame as decimal integer, with leading zeroes as necessary, to make digits.
Definition at line 955 of file path_utils.cc.
References BLI_string_debug_size_after_nil, BLI_string_replace_range(), ensure_digits(), FILENAME_FRAME_CHARS_MAX, path_frame_chars_find_range(), and SNPRINTF.
Referenced by blender::io::obj::append_frame_to_filename(), BKE_cachefile_filepath_get(), do_makepicstring(), dynamicPaint_bakeImageSequence(), get_proxy_filepath(), sequencer_image_seq_reserve_frames(), and TEST().
| bool void bool BLI_path_frame_check_chars | ( | const char * | path | ) |
Check if we have '#' chars, usable for BLI_path_frame, BLI_path_frame_range
Definition at line 1052 of file path_utils.cc.
References path_frame_chars_find_range().
Get the frame from a filename formatted by blender's frame scheme
Referenced by BKE_cachefile_filepath_get(), sequencer_image_seq_get_minmax_frame(), and volume_sequence_frame().
Replaces "#" character sequence in last slash-separated component of path with sta and end as decimal integers, with leading zeroes as necessary, to make digits digits each, with a hyphen in-between.
Definition at line 975 of file path_utils.cc.
References BLI_string_debug_size_after_nil, BLI_string_replace_range(), ensure_digits(), FILENAME_FRAME_CHARS_MAX, path_frame_chars_find_range(), and SNPRINTF.
| bool void BLI_path_frame_strip | ( | char * | path, |
| char * | r_ext, | ||
| size_t | ext_maxncpy ) |
Given a path with digits representing frame numbers, replace the digits with the '#' character and extract the extension. So: /some/path_123.jpeg Becomes: /some/path_### with r_ext set to .jpeg.
Referenced by BKE_cachefile_filepath_get(), and sequencer_image_seq_reserve_frames().
| bool BLI_path_has_hidden_component | ( | const char * | path | ) |
Return true if any path component starts with a dot.
Definition at line 2019 of file path_utils.cc.
References ELEM.
Referenced by filelist_readjob_list_dir(), and TEST().
| bool BLI_path_is_abs_from_cwd | ( | const char * | path | ) |
Checks for a relative path (ignoring Blender's "//") prefix (unlike !BLI_path_is_rel(path)). When false, BLI_path_abs_from_cwd would expand the absolute path.
Definition at line 1201 of file path_utils.cc.
Referenced by BLI_path_abs_from_cwd(), BLO_read_from_file(), BLO_write_file_impl(), blender::tests::TEST(), and TEST().
| bool BLI_path_is_rel | ( | const char * | path | ) |
Does path begin with the special "//" prefix that Blender uses to indicate a path relative to the .blend file.
Definition at line 526 of file path_utils.cc.
Referenced by absolute_convert_foreach_path_cb(), BKE_image_get_ibuf_with_name(), BKE_image_signal(), BKE_image_tile_filepath_exists(), BKE_library_filepath_set(), BKE_packedfile_pack_all_libraries(), BLI_access(), BLI_delete(), BLI_delete_soft(), BLI_delete_soft(), BLI_exists(), BLI_fopen(), BLI_gzopen(), BLI_open(), BLI_path_abs(), BLI_path_cmp_normalized(), BLI_path_rel(), BLO_read_from_file(), BLO_write_file_impl(), current_relpath_append(), blender::nodes::draw_common_bake_settings(), ED_image_filesel_detect_sequences(), file_browse_invoke(), file_expand_directory(), fix_relpaths_library(), blender::bke::bake::get_modifier_bake_path(), blender::bke::bake::get_node_bake_path(), blender::io::usd::get_relative_path(), image_file_browse_exec(), image_replace_invoke(), IMB_isanim(), imb_ispic_read_header_from_filepath(), IMB_loadiffname(), IMB_open_anim(), IMB_saveiff(), IMB_testiffname(), blender::io::usd::import_asset(), lib_id_library_local_paths_callback(), missing_files_find_foreach_path_cb(), blender::io::path_reference(), blender::io::usd::paths_equal(), blender::ed::io::paths_from_operator_properties(), ptcache_path(), relative_convert_foreach_path_cb(), relative_rebase_foreach_path_cb(), render_result_exr_file_cache_path(), blender::io::usd::should_import_asset(), TEST(), and blender::io::usd::USD_path_abs().
| bool BLI_path_is_unc | ( | const char * | path | ) |
Return true if the path is a UNC share.
Definition at line 531 of file path_utils.cc.
Referenced by BLI_path_rel(), BLI_path_unc_prefix_len(), file_expand_directory(), TEST(), and uri_from_filename().
| bool BLI_path_is_win32_drive | ( | const char * | path | ) |
Definition at line 566 of file path_utils.cc.
Referenced by path_normalize_impl(), TEST(), and uri_from_filename().
| bool BLI_path_is_win32_drive_only | ( | const char * | path | ) |
Definition at line 571 of file path_utils.cc.
Referenced by dir_create_recursive(), file_expand_directory(), and TEST().
| bool BLI_path_is_win32_drive_with_slash | ( | const char * | path | ) |
Definition at line 576 of file path_utils.cc.
References ELEM.
Referenced by BLI_path_abs(), and TEST().
| size_t BLI_path_join_array | ( | char *__restrict | dst, |
| const size_t | dst_maxncpy, | ||
| const char * | path_array[], | ||
| const int | path_array_num ) |
See BLI_path_join doc-string.
Referenced by _BLI_path_join_10(), _BLI_path_join_11(), _BLI_path_join_12(), _BLI_path_join_3(), _BLI_path_join_4(), _BLI_path_join_5(), _BLI_path_join_6(), _BLI_path_join_7(), _BLI_path_join_8(), _BLI_path_join_9(), get_path_local_ex(), and test_path().
| bool BLI_path_make_safe | ( | char * | path | ) |
Make given path OS-safe.
Definition at line 492 of file path_utils.cc.
References BLI_path_make_safe_filename(), and BLI_path_slash_find().
Referenced by MANTA::bakeData(), MANTA::bakeGuiding(), MANTA::bakeMesh(), MANTA::bakeNoise(), MANTA::bakeParticles(), BKE_image_save_options_init(), MANTA::exportLiquidScript(), MANTA::exportSmokeScript(), and file_directory_new_exec().
| bool BLI_path_make_safe_filename | ( | char * | filename | ) |
Definition at line 487 of file path_utils.cc.
References BLI_path_make_safe_filename_ex().
Referenced by blender::bke::asset_blendfile_path_for_save(), BLI_path_make_safe(), blender::io::stl::export_frame(), blender::bke::FileHandlerType::get_default_filename(), renamebutton_cb(), seq_disk_cache_get_dir(), and unpack_generate_paths().
| bool BLI_path_make_safe_filename_ex | ( | char * | filename, |
| bool | allow_tokens ) |
Make given name safe to be used in paths.
| allow_tokens | Permit the usage of '<' and '>' characters. This can be leveraged by higher layers to support "virtual filenames" which contain substitution markers delineated between the two characters. |
For now, simply replaces reserved chars (as listed in https://en.wikipedia.org/wiki/Filename#Reserved_characters_and_words ) by underscores ('_').
Definition at line 411 of file path_utils.cc.
References BLI_str_tolower_ascii(), BLI_strdupn(), INVALID_CHARS, INVALID_TOKENS, len, MEM_freeN(), and NULL.
Referenced by BLI_path_make_safe_filename(), and file_filename_enter_handle().
| bool BLI_path_name_at_index | ( | const char *__restrict | path, |
| int | index, | ||
| int *__restrict | r_offset, | ||
| int *__restrict | r_len ) |
Get an element of the path at an index, eg: /some/path/file.txt where an index of:
somepathfile.txtIgnored elements in the path:
/./ except for the beginning of the path where it's used to signify a $PWD relative path. Referenced by fsmenu_entry_generate_name().
| int BLI_path_normalize | ( | char * | path | ) |
Remove redundant characters from path.
The following operations are performed:
//, /./ & ./ (prefix) are stripped. (with the exception of // prefix used for blend-file relative paths)... are resolved so <parent>/../<child>/ resolves to <child>/. Note that the resulting path may begin with .. if it's relative.Details:
.. depends on them being absolute or relative. For absolute paths they are removed (e.g. /../path becomes /path). For relative paths they are kept as it's valid to reference paths above a relative location such as //../parent or ../parent.| path | The path to a file or directory which can be absolute or relative. |
path. Definition at line 367 of file path_utils.cc.
References path_normalize_impl().
Referenced by blender::bke::asset_root_path_for_save(), BKE_preferences_extension_repo_add(), BLI_path_abs(), BLI_path_cmp_normalized(), BLI_path_contains(), BLI_path_normalize_dir(), BLI_path_rel(), blo_find_main(), BLO_write_file_impl(), blender::io::usd::copy_asset_to_directory(), direct_link_library(), blender::io::obj::export_frame(), blender::io::usd::get_absolute_path(), Freestyle::StringUtils::getPathName(), blender::io::usd::import_asset(), lib_id_library_local_paths_callback(), Freestyle::Controller::LoadMesh(), blender::asset_system::utils::normalize_path(), blender::ed::object::bake_simulation::PathStringHash::operator()(), blender::io::path_reference(), relative_rebase_foreach_path_cb(), and blender::io::obj::MTLWriter::write_materials().
| int BLI_path_normalize_dir | ( | char * | dir, |
| size_t | dir_maxncpy ) |
Cleanup file-path ensuring a trailing slash.
dir. Definition at line 377 of file path_utils.cc.
References BLI_path_normalize(), and BLI_path_slash_ensure_ex().
Referenced by bookmark_select_exec(), file_directory_enter_handle(), file_filename_enter_handle(), file_parent_exec(), file_select_do(), filelist_readjob_recursive_dir_add_items(), filelist_setdir(), fileselect_ensure_updated_file_params(), and blender::asset_system::utils::normalize_directory_path().
| int BLI_path_normalize_native | ( | char * | path | ) |
A version of BLI_path_normalize without special handling of // blend file relative prefix.
//path is a valid path which gets normalized to /path.path. Definition at line 372 of file path_utils.cc.
References path_normalize_impl().
Referenced by BKE_main_merge(), BLI_path_canonicalize_native(), file_execute(), get_path_local_ex(), and where_am_i().
| bool BLI_path_parent_dir | ( | char * | path | ) |
Go back one directory.
Replaces path with the path of its parent directory, returning true if it was able to find a parent directory within the path.
On success, the resulting path will always have a trailing slash.
Definition at line 859 of file path_utils.cc.
References BLI_assert, and BLI_path_name_at_index().
Referenced by BKE_preferences_asset_library_path_set(), bli_builddir(), BLI_path_parent_dir_until_exists(), file_execute(), file_parent_exec(), file_select_do(), and open_invoke().
| const char * BLI_path_parent_dir_end | ( | const char * | path, |
| size_t | path_len ) |
In the simple case this is similar to BLI_path_slash_rfind(dirname) however it behaves differently when there are redundant characters:
/test///dir/./file ^ /test/dir/subdir//file ^
path or &path[path_len - 1] are ever returned. Definition at line 832 of file path_utils.cc.
References BLI_path_slash_is_native_compat().
Referenced by dir_create_recursive().
| bool BLI_path_parent_dir_until_exists | ( | char * | path | ) |
Go back until the directory is found.
Strips off nonexistent (or non-accessible) sub-directories from the end of dir, leaving the path of the lowest-level directory that does exist and we can read.
Definition at line 885 of file path_utils.cc.
References BLI_access(), and BLI_path_parent_dir().
Referenced by parent_dir_until_exists_or_default_root().
| bool BLI_path_program_search | ( | char * | program_filepath, |
| size_t | program_filepath_maxncpy, | ||
| const char * | program_name ) |
Search for a binary (executable)
Referenced by BKE_appdir_program_python_search(), and where_am_i().
| bool void BLI_path_rel | ( | char | path[FILE_MAX], |
| const char * | basepath ) |
Replaces path with a relative version (prefixed by "//") such that BLI_path_abs, given the same basepath, will convert it back to its original value.
Definition at line 662 of file path_utils.cc.
References BLI_assert_msg, BLI_path_is_rel(), BLI_path_is_unc(), BLI_path_normalize(), BLI_path_slash_rfind(), BLI_path_unc_prefix_len(), BLI_string_debug_size_after_nil, BLI_string_replace_char(), BLI_strncpy(), BLI_strncpy_rlen(), BLI_strnlen(), BLI_windows_get_default_root_dir(), ELEM, FILE_MAX, STRNCPY, and UNUSED_VARS.
Referenced by blender::bke::asset_weak_reference_for_user_library(), BKE_image_signal(), blender::nodes::draw_common_bake_settings(), draw_seq_in_view(), ED_image_filesel_detect_sequences(), file_browse_exec(), file_sfile_to_operator_ex(), filelist_readjob_recursive_dir_add_items(), fix_relpaths_library(), fluid_validatepaths(), blender::io::usd::get_relative_path(), image_file_browse_exec(), image_save_update_filepath(), lib_id_library_local_paths_callback(), library_link_end(), load_data_init_from_operator(), blender::io::obj::load_image_at_path(), missing_files_find_foreach_path_cb(), blender::ed::object::multires_external_save_exec(), open_exec(), blender::io::path_reference(), blender::ed::io::paths_from_operator_properties(), relative_convert_foreach_path_cb(), relative_rebase_foreach_path_cb(), sequencer_change_path_exec(), blender::ed::object::volume_import_exec(), and WM_operator_drop_load_path().
| int BLI_path_sequence_decode | ( | const char * | path, |
| char * | head, | ||
| size_t | head_maxncpy, | ||
| char * | tail, | ||
| size_t | tail_maxncpy, | ||
| unsigned short * | r_digits_len ) |
Looks for a sequence of decimal digits in path, preceding any filename extension, returning the integer value if found, or 0 if not.
| path | String to scan. |
| head | Optional area to return copy of part of path prior to digits, or before dot if no digits. |
| tail | Optional area to return copy of part of path following digits, or from dot if no digits. |
| r_digits_len | Optional to return number of digits found. |
Definition at line 57 of file path_utils.cc.
References BLI_path_extension_or_end(), BLI_path_slash_rfind(), BLI_string_debug_size, BLI_strncpy(), int, and ret.
Referenced by BKE_image_sequence_guess_offset(), BKE_image_user_file_path_ex(), build_pict_list_from_image_sequence(), filenum_newname(), blender::io::obj::get_image_filepath(), get_sequence_filepath(), image_sequence_get_frame_ranges(), movieclip_calc_length(), put_imbuf_cache(), user_frame_to_cache_frame(), and wm_save_as_mainfile_exec().
| void BLI_path_sequence_encode | ( | char * | path, |
| size_t | path_maxncpy, | ||
| const char * | head, | ||
| const char * | tail, | ||
| unsigned short | numlen, | ||
| int | pic ) |
Returns in area pointed to by path a string of the form <head><pic><tail>, where pic is formatted as numlen digits with leading zeroes.
Definition at line 127 of file path_utils.cc.
References BLI_snprintf(), and BLI_string_debug_size.
Referenced by BKE_image_user_file_path_ex(), build_pict_list_from_image_sequence(), filenum_newname(), blender::io::obj::get_image_filepath(), get_sequence_filepath(), and wm_save_as_mainfile_exec().
| int BLI_path_slash_ensure | ( | char * | path, |
| size_t | path_maxncpy ) |
Appends a slash to path if there isn't one there already.
Definition at line 1940 of file path_utils.cc.
References BLI_path_slash_ensure_ex().
Referenced by blender::bke::asset_weak_reference_for_user_library(), autocomplete_directory(), BKE_blendfile_userdef_from_defaults(), BLI_path_append(), BLI_path_contains(), BLI_temp_directory_path_copy_if_valid(), file_browse_exec(), file_browse_invoke(), file_sfile_to_operator_ex(), filelist_geticon_ex(), filelist_readjob_list_dir(), blender::nodes::node_composite_file_output_cc::FileOutputOperation::get_single_layer_image_base_path(), open_invoke(), blender::io::usd::process_usdz_textures(), ptcache_path(), seq_disk_cache_delete_invalid_files(), seq_disk_cache_get_files(), tempdir_session_create(), blender::asset_system::tests::TEST_F(), and ui_but_menu_add_path_operators().
| int BLI_path_slash_ensure_ex | ( | char * | path, |
| size_t | path_maxncpy, | ||
| const size_t | path_len ) |
Appends a slash to path if there isn't one there already.
| path_len | The length of path. |
Definition at line 1925 of file path_utils.cc.
References BLI_assert, BLI_path_slash_is_native_compat(), BLI_string_debug_size_after_nil, and SEP.
Referenced by BLI_path_append_dir(), BLI_path_normalize_dir(), and BLI_path_slash_ensure().
| const char * BLI_path_slash_find | ( | const char * | path | ) |
Definition at line 1895 of file path_utils.cc.
Referenced by BKE_image_ensure_tile_token_filename_only(), BLI_path_make_safe(), blender::asset_system::AssetCatalogPath::iterate_components(), and TEST().
| BLI_INLINE bool BLI_path_slash_is_native_compat | ( | const char | ch | ) |
Return true if the slash can be used as a separator on this platform.
Definition at line 726 of file BLI_path_utils.hh.
Referenced by bli_builddir(), BLI_dir_create_recursive(), BLI_path_canonicalize_native(), BLI_path_join_array(), BLI_path_parent_dir_end(), BLI_path_slash_ensure_ex(), BLI_path_slash_rstrip(), BLI_path_slash_skip(), dir_create_recursive(), path_has_trailing_slash(), path_len_no_trailing_slash(), path_name_at_index_backward(), path_name_at_index_forward(), and strbuf_append_path().
| void BLI_path_slash_native | ( | char * | path | ) |
Changes to the path separators to the native ones for this OS.
Definition at line 1968 of file path_utils.cc.
References ALTSEP, BLI_path_unc_prefix_len(), BLI_string_replace_char(), BLI_strnlen(), and SEP.
Referenced by blender::bke::asset_root_path_for_save(), BKE_preferences_extension_remote_to_name(), BLI_path_canonicalize_native(), BLI_path_cmp_normalized(), BLI_path_contains(), clean_paths(), blender::io::obj::export_frame(), foreach_path_clean_cb(), blender::asset_system::utils::normalize_path(), blender::ed::object::bake_simulation::PathStringHash::operator()(), blender::asset_system::tests::AssetCatalogTest::save_from_memory_into_existing_asset_lib(), blender::asset_system::tests::TEST_F(), blender::asset_system::tests::TEST_F(), and blender::io::obj::MTLWriter::write_materials().
| const char * BLI_path_slash_rfind | ( | const char * | path | ) |
Definition at line 1910 of file path_utils.cc.
Referenced by BKE_blendfile_library_path_explode(), BLI_path_abs(), BLI_path_basename(), BLI_path_rel(), BLI_path_sequence_decode(), file_browse_exec(), file_browse_invoke(), groupname_to_code(), image_file_browse_invoke(), TEST(), where_am_i(), and wm_open_mainfile_check().
| void BLI_path_slash_rstrip | ( | char * | path | ) |
Removes the last slash and everything after it to the end of path, if there is one.
Definition at line 1945 of file path_utils.cc.
References BLI_path_slash_is_native_compat(), and len.
Referenced by BKE_preferences_extension_repo_add(), BLI_path_cmp_normalized(), file_path_to_ui_path(), blender::ed::object::bake_simulation::PathStringHash::operator()(), path_destination_ensure_filename(), preferences_asset_library_add_exec(), and preferences_extension_repo_add_exec().
| const char * BLI_path_slash_skip | ( | const char * | path | ) |
path only contains slashes). Definition at line 1959 of file path_utils.cc.
References BLI_path_slash_is_native_compat().
Referenced by BLI_path_abs(), and uri_from_filename().
| void BLI_path_split_dir_file | ( | const char * | filepath, |
| char * | dir, | ||
| size_t | dir_maxncpy, | ||
| char * | file, | ||
| size_t | file_maxncpy ) |
Copies directory and file components from filepath into dir and file, e.g. /foo/bar.txt to /foo/ and bar.txt
Referenced by BKE_bpath_foreach_path_dirfile_fixed_process(), BKE_image_get_tile_info(), clip_drop_copy(), do_versions_nodetree_multi_file_output_format_2_62_1(), file_directory_enter_handle(), file_execute(), file_operator_to_sfile(), file_sfile_filepath_set(), fileselect_ensure_updated_file_params(), get_index_dir(), get_proxy_filepath(), blender::ed::outliner::lib_relocate(), blender::io::usd::perform_usdz_conversion(), render_result_exr_file_cache_path(), SEQ_add_movie_strip(), seq_disk_cache_add_file_to_list(), sequencer_drop_copy(), TEST(), ui_but_menu_add_path_operators(), unpack_generate_paths(), and blender::io::obj::OBJWriter::write_mtllib_name().
| void void BLI_path_split_dir_part | ( | const char * | filepath, |
| char * | dir, | ||
| size_t | dir_maxncpy ) |
Copies the parent directory part of filepath into dir, max length dir_maxncpy.
Referenced by AS_asset_library_find_suitable_root_path_from_path(), autocomplete_directory(), BKE_appdir_program_path_init(), BKE_image_tile_filepath_exists(), BKE_main_merge(), BLI_file_ensure_parent_dir_exists(), BLI_file_is_writable(), BLO_write_file_impl(), cachefile_layer_open_invoke(), cachefile_open_invoke(), blender::io::obj::OBJExportRegressionTest::compare_obj_export_to_golden(), drop_import_file_copy(), blender::io::usd::export_endjob_usdz_cleanup(), blender::io::obj::export_frame(), blender::io::usd::export_texture(), file_draw_tooltip_custom_func(), file_handler_import_operator_create_ptr(), file_sfile_filepath_set(), fileselect_initialize_params_common(), blender::asset_system::AssetCatalogService::find_suitable_cdf_path_for_writing(), blender::io::usd::get_relative_path(), blender::io::usd::get_tex_image_asset_filepath(), image_foreach_path(), image_save_sequence_exec(), blender::io::obj::MTLParser::MTLParser(), blender::io::usd::parent_dir_exists_on_file_system(), sequencer_add_image_strip_load_files(), ui_popup_context_menu_for_button(), ui_tooltip_from_clip(), ui_tooltip_from_image(), uiTemplateRecentFiles_tooltip_func(), WM_file_autoexec_init(), wm_link_append_invoke(), blender::io::usd::world_material_to_dome_light(), blender::io::obj::MTLWriter::write_materials(), blender::asset_system::AssetCatalogDefinitionFile::write_to_disk_unsafe(), and DocumentImporter::writeImage().
| void void void BLI_path_split_file_part | ( | const char * | filepath, |
| char * | file, | ||
| size_t | file_maxncpy ) |
Copies the leaf filename part of filepath into file, max length file_maxncpy.
Referenced by BKE_studiolight_create(), BKE_vfont_load(), block_create__close_file_dialog(), block_create_save_file_overwrite_dialog(), blender::io::usd::copy_single_file(), blender::io::usd::copy_tiled_textures(), draw_seq_in_view(), drop_import_file_copy(), blender::io::usd::export_in_memory_texture(), blender::io::usd::export_packed_texture(), file_handler_import_operator_create_ptr(), blender::io::usd::get_asset_base_name(), blender::bke::bake::get_blend_file_name(), blender::ed::asset::index::BlendFile::get_filename(), blender::io::usd::get_tex_image_asset_filepath(), image_foreach_path(), IMB_anim_get_filename(), blender::io::usd::perform_usdz_conversion(), preferences_asset_library_add_exec(), ptcache_path(), blender::io::grease_pencil::SVGImporter::read(), seq_disk_cache_get_files(), studiolight_add_file(), unpack_menu(), blender::ed::object::volume_import_exec(), and blender::io::usd::world_material_to_dome_light().
| bool bool BLI_path_suffix | ( | char * | path, |
| size_t | path_maxncpy, | ||
| const char * | suffix, | ||
| const char * | sep ) |
Appends a suffix to the path, fitting it before the extension
path = Foo.png, suffix = 123, separator = _. Foo.png -> Foo_123.png.
| path | original (and final) string. |
| path_maxncpy | Maximum length of path. |
| suffix | String to append to the original path. |
| sep | Optional separator character. |
Referenced by blender::ed::object::bake_targets_output_external(), BKE_image_memorypack(), BKE_scene_multiview_filepath_get(), BKE_scene_multiview_view_filepath_get(), do_makepicstring(), and blender::io::stl::export_frame().
| void BLI_path_to_display_name | ( | char * | display_name, |
| int | display_name_maxncpy, | ||
| const char * | name ) |
Creates a display string from path to be used menus and the user interface. Like bpy.path.display_name().
Referenced by blender::io::usd::import_startjob(), wm_homefile_write_invoke(), wm_read_factory_settings_invoke(), wm_userpref_read_invoke(), and workspace_add_invoke().
| void BLI_setenv | ( | const char * | env, |
| const char * | val ) |
Sets the specified environment variable to the specified value, and clears it if val == NULL.
Definition at line 1345 of file path_utils.cc.
References uputenv().
Referenced by arg_handle_env_system_set(), BLI_change_working_dir(), BLI_setenv_if_new(), BPY_python_start(), and blender::render::hydra::Engine::Engine().
| void BLI_setenv_if_new | ( | const char * | env, |
| const char * | val ) |
Only set an environment variable if already not there. Like Unix setenv(env, val, 0);
(not used anywhere).
Definition at line 1361 of file path_utils.cc.
References BLI_getenv(), and BLI_setenv().
| bool ATTR_WARN_UNUSED_RESULT |
Definition at line 34 of file BLI_path_utils.hh.