#pragma once #include "ProjectBrowserModel.h" #include #include #include #include namespace XCEngine::UI::Editor::App::ProjectBrowserModelInternal { inline constexpr std::string_view kAssetsRootId = "Assets"; std::string ToLowerCopy(std::string value); std::string PathToUtf8String(const std::filesystem::path& path); std::string NormalizePathSeparators(std::string value); std::string BuildRelativeItemId( const std::filesystem::path& path, const std::filesystem::path& assetsRoot); std::string BuildRelativeProjectPath( const std::filesystem::path& path, const std::filesystem::path& projectRoot); std::string BuildAssetDisplayName(const std::filesystem::path& path, bool directory); std::string BuildAssetNameWithExtension(const std::filesystem::path& path, bool directory); bool IsMetaFile(const std::filesystem::path& path); bool HasChildDirectories(const std::filesystem::path& folderPath); std::vector CollectSortedChildDirectories( const std::filesystem::path& folderPath); std::wstring MakePathKey(const std::filesystem::path& path); bool IsSameOrDescendantPath( const std::filesystem::path& path, const std::filesystem::path& ancestor); std::string TrimAssetName(std::string_view name); bool HasInvalidAssetName(std::string_view name); std::filesystem::path MakeUniqueFolderPath( const std::filesystem::path& parentPath, std::string_view preferredName); std::filesystem::path MakeUniqueFilePath( const std::filesystem::path& parentPath, const std::filesystem::path& preferredFileName); std::string BuildRenamedEntryName( const std::filesystem::path& sourcePath, std::string_view requestedName); std::filesystem::path GetMetaSidecarPath(const std::filesystem::path& assetPath); void RemoveMetaSidecarIfPresent(const std::filesystem::path& assetPath); bool RenamePathCaseAware( const std::filesystem::path& sourcePath, const std::filesystem::path& destPath); void MoveMetaSidecarIfPresent( const std::filesystem::path& sourcePath, const std::filesystem::path& destPath); bool MovePathWithOptionalMeta( const std::filesystem::path& sourcePath, const std::filesystem::path& destinationPath); ProjectBrowserModel::ItemKind ResolveItemKind( const std::filesystem::path& path, bool directory); bool CanOpenItemKind(ProjectBrowserModel::ItemKind kind); bool CanPreviewItemKind(ProjectBrowserModel::ItemKind kind); } // namespace XCEngine::UI::Editor::App::ProjectBrowserModelInternal