|
Blender V4.3
|
Functions | |
| std::string | normalize_directory_path (StringRef directory) |
| std::string | normalize_path (StringRefNull path, int64_t max_len) |
| std::string blender::asset_system::utils::normalize_directory_path | ( | StringRef | directory | ) |
Returns a normalized directory path with a trailing slash, and a maximum length of PATH_MAX. Slashes are not converted to native format (they probably should be though?).
Definition at line 17 of file asset_system/intern/utils.cc.
References BLI_path_normalize_dir(), BLI_strncpy(), blender::StringRefBase::data(), blender::StringRefBase::is_empty(), PATH_MAX, and blender::StringRefBase::size().
Referenced by blender::asset_system::AssetLibraryService::get_asset_library_on_disk().
| std::string blender::asset_system::utils::normalize_path | ( | StringRefNull | path, |
| int64_t | max_len = StringRef::not_found ) |
Normalize the given path (remove 'parent directory' and double-slashes element etc., and convert to native path separators).
If max_len is not StringRef::not_found (default value), only the first part of the given string up to the given length is processed, the rest remains unchanged. Needed to avoid modifying ID name part of linked library paths.
Definition at line 32 of file asset_system/intern/utils.cc.
References BLI_path_normalize(), BLI_path_slash_native(), BLI_strdupn(), blender::StringRefNull::c_str(), len, MEM_freeN(), blender::StringRefBase::not_found, blender::StringRefBase::size(), and blender::StringRefBase::substr().
Referenced by blender::asset_system::AssetLibraryService::normalize_asset_weak_reference_relative_asset_identifier(), blender::asset_system::AssetLibraryService::resolve_asset_weak_reference_to_full_path(), blender::asset_system::AssetLibraryService::resolve_asset_weak_reference_to_library_path(), blender::asset_system::tests::TEST_F(), blender::asset_system::tests::TEST_F(), blender::asset_system::tests::TEST_F(), blender::asset_system::tests::TEST_F(), and blender::asset_system::tests::TEST_F().