|
Blender V5.3
|
Functions | |
| std::string | resolve_directory_path (StringRef directory) |
| std::string | resolve_path (StringRefNull path, int64_t max_len) |
| std::string blender::asset_system::utils::resolve_directory_path | ( | StringRef | directory | ) |
Returns a normalized directory path with a trailing slash, and a maximum length of PATH_MAX. Slashes are converted to native format.
Definition at line 23 of file asset_system/intern/utils.cc.
References blender::BKE_add_template_variables_general(), blender::BKE_blender_project_get(), blender::BKE_path_apply_template(), blender::BLI_path_normalize_dir(), blender::BLI_path_slash_native(), blender::BLI_strncpy(), blender::blender::StringRefBase::data(), G_MAIN, blender::blender::StringRefBase::is_empty(), blender::Vector< T, InlineBufferCapacity, Allocator >::is_empty(), PATH_MAX, resolve_directory_path(), and blender::blender::StringRefBase::size().
Referenced by blender::AS_asset_library_resolve_path(), blender::asset_system::AssetLibraryService::get_asset_library_on_disk(), blender::asset_system::AssetLibraryService::lookup_on_disk_library(), and resolve_directory_path().
| std::string blender::asset_system::utils::resolve_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 50 of file asset_system/intern/utils.cc.
References blender::BKE_add_template_variables_general(), blender::BKE_blender_project_get(), blender::BKE_path_apply_template(), blender::BLI_path_normalize(), blender::BLI_path_slash_native(), blender::BLI_strncpy(), blender::StringRefNull::c_str(), FILE_MAX, G_MAIN, blender::Vector< T, InlineBufferCapacity, Allocator >::is_empty(), len(), blender::blender::StringRefBase::not_found, resolve_path(), blender::blender::StringRefBase::size(), and blender::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(), resolve_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().