Changeset View
Changeset View
Standalone View
Standalone View
source/blender/blenlib/BLI_path_util.h
| Show First 20 Lines • Show All 248 Lines • ▼ Show 20 Lines | |||||
| * | * | ||||
| * \note Same as #BLI_path_normalize but adds a trailing slash. | * \note Same as #BLI_path_normalize but adds a trailing slash. | ||||
| */ | */ | ||||
| void BLI_path_normalize_dir(const char *relabase, char *dir) ATTR_NONNULL(2); | void BLI_path_normalize_dir(const char *relabase, char *dir) ATTR_NONNULL(2); | ||||
| /** | /** | ||||
| * Make given name safe to be used in paths. | * Make given name safe to be used in paths. | ||||
| * | * | ||||
| * \param 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. | |||||
| * | |||||
| * \return true if \a fname was changed, false otherwise. | * \return true if \a fname was changed, false otherwise. | ||||
| * | * | ||||
| * For now, simply replaces reserved chars (as listed in | * For now, simply replaces reserved chars (as listed in | ||||
| * https://en.wikipedia.org/wiki/Filename#Reserved_characters_and_words ) | * https://en.wikipedia.org/wiki/Filename#Reserved_characters_and_words ) | ||||
| * by underscores ('_'). | * by underscores ('_'). | ||||
| * | * | ||||
| * \note Space case ' ' is a bit of an edge case here - in theory it is allowed, | * \note Space case ' ' is a bit of an edge case here - in theory it is allowed, | ||||
| * but again can be an issue in some cases, so we simply replace it by an underscore too | * but again can be an issue in some cases, so we simply replace it by an underscore too | ||||
| * (good practice anyway). | * (good practice anyway). | ||||
| * REMOVED based on popular demand (see T45900). | * REMOVED based on popular demand (see T45900). | ||||
| * Percent '%' char is a bit same case - not recommended to use it, | * Percent '%' char is a bit same case - not recommended to use it, | ||||
| * but supported by all decent file-systems/operating-systems around. | * but supported by all decent file-systems/operating-systems around. | ||||
| * | * | ||||
| * \note On Windows, it also ensures there is no '.' (dot char) at the end of the file, | * \note On Windows, it also ensures there is no '.' (dot char) at the end of the file, | ||||
| * this can lead to issues. | * this can lead to issues. | ||||
| * | * | ||||
| * \note On Windows, it also checks for forbidden names | * \note On Windows, it also checks for forbidden names | ||||
| * (see https://msdn.microsoft.com/en-us/library/windows/desktop/aa365247%28v=vs.85%29.aspx ). | * (see https://msdn.microsoft.com/en-us/library/windows/desktop/aa365247%28v=vs.85%29.aspx ). | ||||
| */ | */ | ||||
| bool BLI_filename_make_safe_ex(char *fname, bool allow_tokens) ATTR_NONNULL(1); | |||||
| bool BLI_filename_make_safe(char *fname) ATTR_NONNULL(1); | bool BLI_filename_make_safe(char *fname) ATTR_NONNULL(1); | ||||
| /** | /** | ||||
| * Make given path OS-safe. | * Make given path OS-safe. | ||||
| * | * | ||||
| * \return true if \a path was changed, false otherwise. | * \return true if \a path was changed, false otherwise. | ||||
| */ | */ | ||||
| bool BLI_path_make_safe(char *path) ATTR_NONNULL(1); | bool BLI_path_make_safe(char *path) ATTR_NONNULL(1); | ||||
| /** | /** | ||||
| ▲ Show 20 Lines • Show All 150 Lines • Show Last 20 Lines | |||||