|
Blender V5.3
|
#include <algorithm>#include <cctype>#include <cstdlib>#include <cstring>#include "BLI_assert.hh"#include "BLI_fileops.hh"#include "BLI_fnmatch.hh"#include "BLI_path_utils.hh"#include "BLI_string.hh"#include "BLI_string_utf8.hh"#include "BLI_string_utils.hh"#include "BLI_utildefines.hh"#include <unistd.h>#include "MEM_guardedalloc.h"Go to the source code of this file.
Namespaces | |
| namespace | blender |
| BMesh Iterators. | |
Macros | |
| #define | FILENAME_FRAME_CHARS_MAX FILE_MAX |
| #define | IS_PARENT_DIR(p) |
| #define | INVALID_CHARS |
| #define | INVALID_TOKENS "<>" |
Functions | |
| static int | blender::BLI_path_unc_prefix_len (const char *path) |
| static int | blender::path_normalize_impl (char *path, bool check_blend_relative_prefix) |
| static bool | blender::path_relative_to_impl (char *path, const size_t path_maxncpy, const char *basepath, const bool walk_up, const bool blend_relative) |
| static bool | blender::path_frame_chars_find_range (const char *path, int *r_char_start, int *r_char_end) |
| static bool | blender::ensure_digits (char *path, const size_t path_maxncpy, int digits) |
| static bool | blender::path_extension_check_ex (const char *path, const size_t path_len, const char *ext, const size_t ext_len) |
| static bool | blender::path_name_at_index_forward (const char *__restrict path, const int index, int *__restrict r_offset, int *__restrict r_len) |
| static bool | blender::path_name_at_index_backward (const char *__restrict path, const int index, int *__restrict r_offset, int *__restrict r_len) |
Blender Specific Frame Sequence Encode/Decode | |
| int | blender::BLI_path_sequence_decode (const char *path, char *head, size_t head_maxncpy, char *tail, size_t tail_maxncpy, unsigned short *r_digits_len) |
| void | blender::BLI_path_sequence_encode (char *path, size_t path_maxncpy, const char *head, const char *tail, unsigned short numlen, int pic) |
Path Normalize | |
| int | blender::BLI_path_normalize (char *path) ATTR_NONNULL(1) |
| int | blender::BLI_path_normalize_native (char *path) ATTR_NONNULL(1) |
| int | blender::BLI_path_normalize_dir (char *dir, size_t dir_maxncpy) ATTR_NONNULL(1) |
Path Canonicalize | |
| int | blender::BLI_path_canonicalize_native (char *path, int path_maxncpy) |
Path Make Safe / Sanitize | |
| bool | blender::BLI_path_make_safe_filename_ex (char *filename, bool allow_tokens) ATTR_NONNULL(1) |
| bool | blender::BLI_path_make_safe_filename (char *filename) ATTR_NONNULL(1) |
| bool | blender::BLI_path_make_safe (char *path) ATTR_NONNULL(1) |
| void | blender::BLI_path_to_display_name (char *display_name, int display_name_maxncpy, const char *name) ATTR_NONNULL(1 |
Blender Specific File Relative Paths | |
| bool | blender::BLI_path_is_rel (const char *path) ATTR_NONNULL(1) ATTR_WARN_UNUSED_RESULT |
| bool void | blender::BLI_path_rel (char path[FILE_MAX], const char *basepath) ATTR_NONNULL(1) |
| bool | blender::BLI_path_abs (char path[FILE_MAX], const char *basepath) ATTR_NONNULL(1 |
Path Queries | |
| bool | blender::BLI_path_is_unc (const char *path) ATTR_NONNULL(1) ATTR_WARN_UNUSED_RESULT |
| bool | blender::BLI_path_is_win32_drive (const char *path) |
| bool | blender::BLI_path_is_win32_drive_only (const char *path) |
| bool | blender::BLI_path_is_win32_drive_with_slash (const char *path) |
| bool | blender::BLI_path_name_at_index (const char *__restrict path, int index, int *__restrict r_offset, int *__restrict r_len) ATTR_NONNULL(1 |
Path FileName Manipulation | |
| bool bool | blender::BLI_path_suffix (char *path, size_t path_maxncpy, const char *suffix, const char *sep) ATTR_NONNULL(1 |
| bool | blender::BLI_path_filename_ensure (char *filepath, size_t filepath_maxncpy, const char *filename) ATTR_NONNULL(1 |
Path Parent Operations | |
| const char * | blender::BLI_path_parent_dir_end (const char *path, size_t path_len) ATTR_NONNULL(1) ATTR_WARN_UNUSED_RESULT |
| bool | blender::BLI_path_parent_dir (char *path) ATTR_NONNULL(1) |
| bool | blender::BLI_path_parent_dir_until_exists (char *path) ATTR_NONNULL(1) |
Blender Specific Frame Number Apply/Strip | |
| bool | blender::BLI_path_frame (char *path, size_t path_maxncpy, int frame, int digits) ATTR_NONNULL(1) |
| bool | blender::BLI_path_frame_range (char *path, size_t path_maxncpy, int sta, int end, int digits) ATTR_NONNULL(1) |
| bool | blender::BLI_path_frame_get (const char *path, int *r_frame, int *r_digits_len) ATTR_NONNULL(1 |
| bool void | blender::BLI_path_frame_strip (char *path, char *r_ext, size_t ext_maxncpy) ATTR_NONNULL(1 |
| bool void bool | blender::BLI_path_frame_check_chars (const char *path) ATTR_NONNULL(1) ATTR_WARN_UNUSED_RESULT |
Current Working Directory Specific Paths | |
| bool | blender::BLI_path_is_abs_from_cwd (const char *path) ATTR_NONNULL(1) ATTR_WARN_UNUSED_RESULT |
| bool | blender::BLI_path_abs_from_cwd (char *path, size_t path_maxncpy) ATTR_NONNULL(1) |
Program Specific Path Functions | |
| bool | blender::BLI_path_program_search (char *program_filepath, size_t program_filepath_maxncpy, const char *program_name) ATTR_NONNULL(1 |
OS Level Wrappers | |
TODO: move these to a different module, they are not path functions. | |
| void | blender::BLI_setenv (const char *env, const char *val) ATTR_NONNULL(1) |
| void | blender::BLI_setenv_if_new (const char *env, const char *val) ATTR_NONNULL(1) |
| const char * | blender::BLI_getenv (const char *env) ATTR_NONNULL(1) ATTR_WARN_UNUSED_RESULT |
Path File Extensions | |
| bool | blender::BLI_path_extension_check (const char *path, const char *ext) ATTR_NONNULL(1 |
| bool | blender::BLI_path_extension_check_n (const char *path,...) ATTR_NONNULL(1) ATTR_SENTINEL(0) |
| bool | blender::BLI_path_extension_check_array (const char *path, const char **ext_array) ATTR_NONNULL(1 |
| bool | blender::BLI_path_extension_check_glob (const char *path, const char *ext_fnmatch) ATTR_NONNULL(1 |
| bool | blender::BLI_path_extension_glob_validate (char *ext_fnmatch) ATTR_NONNULL(1) |
| bool | blender::BLI_path_extension_replace (char *path, size_t path_maxncpy, const char *ext) ATTR_NONNULL(1 |
| bool bool | blender::BLI_path_extension_strip (char *path) ATTR_NONNULL(1) |
| bool | blender::BLI_path_extension_ensure (char *path, size_t path_maxncpy, const char *ext) ATTR_NONNULL(1 |
| const char * | blender::BLI_path_extension_or_end (const char *filepath) ATTR_NONNULL(1) ATTR_WARN_UNUSED_RESULT ATTR_RETURNS_NONNULL |
| const char * | blender::BLI_path_extension (const char *filepath) ATTR_NONNULL(1) ATTR_WARN_UNUSED_RESULT |
Path Directory/FileName Split | |
| void | blender::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 | blender::BLI_path_split_dir_part (const char *filepath, char *dir, size_t dir_maxncpy) ATTR_NONNULL(1 |
| void void void | blender::BLI_path_split_file_part (const char *filepath, char *file, size_t file_maxncpy) ATTR_NONNULL(1 |
| void void void const char * | blender::BLI_path_basename (const char *path) ATTR_NONNULL(1) ATTR_WARN_UNUSED_RESULT |
Path Append | |
| size_t | blender::BLI_path_append (char *__restrict dst, size_t dst_maxncpy, const char *__restrict file) ATTR_NONNULL(1 |
| size_t size_t | blender::BLI_path_append_dir (char *__restrict dst, size_t dst_maxncpy, const char *__restrict dir) ATTR_NONNULL(1 |
Path Join | |
| size_t | blender::BLI_path_join_array (char *__restrict dst, const size_t dst_maxncpy, const char *path_array[], const int path_array_num) ATTR_NONNULL(1 |
Path Comparison / Contains | |
| bool | blender::BLI_path_contains (const char *container_path, const char *containee_path) ATTR_NONNULL(1 |
| bool | blender::BLI_path_relative_to (const char *path, const char *base_dir, bool walk_up, char *r_path_relative, size_t r_path_relative_maxncpy) ATTR_NONNULL(1 |
| int | blender::BLI_path_cmp_normalized (const char *p1, const char *p2) ATTR_NONNULL(1 |
Path Slash Utilities | |
| const char * | blender::BLI_path_slash_find (const char *path) ATTR_NONNULL(1) ATTR_WARN_UNUSED_RESULT |
| const char * | blender::BLI_path_slash_rfind (const char *path) ATTR_NONNULL(1) ATTR_WARN_UNUSED_RESULT |
| int | blender::BLI_path_slash_ensure_ex (char *path, size_t path_maxncpy, const size_t path_len) ATTR_NONNULL(1) |
| int | blender::BLI_path_slash_ensure (char *path, size_t path_maxncpy) ATTR_NONNULL(1) |
| void | blender::BLI_path_slash_rstrip (char *path) ATTR_NONNULL(1) |
| const char * | blender::BLI_path_slash_skip (const char *path) ATTR_NONNULL(1) ATTR_WARN_UNUSED_RESULT |
| void | blender::BLI_path_slash_native (char *path) ATTR_NONNULL(1) |
| void | blender::BLI_path_slash_forward_from_native (char *path) ATTR_NONNULL(1) |
Path Filtering Utilities | |
| bool | blender::BLI_path_has_hidden_component (const char *path) ATTR_NONNULL(1) ATTR_WARN_UNUSED_RESULT |
Various string, file, list operations.
Definition in file path_utils.cc.
| #define FILENAME_FRAME_CHARS_MAX FILE_MAX |
The maximum number of # characters expanded for #BLI_path_frame & #BLI_path_frame_range Typically 12 is enough and even 16 is very large. Use a much larger value so hitting the upper limit is not an issue. Exceeding this limit won't fail either, it will just not insert so many leading zeros.
Definition at line 59 of file path_utils.cc.
Referenced by blender::BLI_path_frame(), and blender::BLI_path_frame_range().
| #define INVALID_CHARS |
Referenced by blender::BLI_path_make_safe_filename_ex().
| #define INVALID_TOKENS "<>" |
Referenced by blender::BLI_path_make_safe_filename_ex().
| #define IS_PARENT_DIR | ( | p | ) |
Referenced by blender::path_normalize_impl().