/* * Copyright (c) Contributors to the Open 3D Engine Project. * For complete copyright and license terms please see the LICENSE at the root of this distribution. * * SPDX-License-Identifier: Apache-2.0 OR MIT * */ #pragma once #include #include #include #include #include namespace AzToolsFramework { namespace AssetBrowser { class AssetBrowserEntry; } } //! UISliceLibraryFilter locates all of the UI slices so that they can be instantiated via "Element from Slice Library" menu function class UISliceLibraryFilter : public AzToolsFramework::AssetBrowser::AssetBrowserEntryFilter { public: UISliceLibraryFilter(const AZ::Data::AssetType& assetType, const char* pathToSearch); ~UISliceLibraryFilter() override = default; protected: QString GetNameInternal() const override; bool MatchInternal(const AzToolsFramework::AssetBrowser::AssetBrowserEntry* entry) const override; private: AZ::Data::AssetType m_assetType; AZStd::string m_pathToSearch; }; //////////////////////////////////////////////////////////////////////////////////////////////////// //! Class to build and represent a hierarchical tree view of files and folders containing //! assets of a given type under a given path class AssetTreeEntry { public: // types using FolderMap = AZStd::map; using FileMap = AZStd::map; public: // methods ~AssetTreeEntry(); static AssetTreeEntry* BuildAssetTree(const AZ::Data::AssetType& assetType, const AZStd::string& pathToSearch); public: // data FileMap m_files; FolderMap m_folders; protected: void Insert(const AZStd::string& path, const AZStd::string& menuName, const AZ::Data::AssetId& assetId); };