#pragma once #include "ProjectFile.h" #include #include #include #include #include class Project { AK_MAKE_NONCOPYABLE(Project) AK_MAKE_NONMOVABLE(Project) public: ~Project(); static OwnPtr load_from_file(const String& path); [[nodiscard]] bool add_file(const String& filename); ProjectFile* get_file(const String& filename); GModel& model() { return *m_model; } template void for_each_text_file(Callback callback) const { for (auto& file : m_files) { callback(file); } } private: friend class ProjectModel; struct ProjectTreeNode; explicit Project(const String& path, Vector&& files); const ProjectTreeNode& root_node() const { return *m_root_node; } void rebuild_tree(); String m_path; RefPtr m_model; NonnullRefPtrVector m_files; OwnPtr m_root_node; GIcon m_directory_icon; GIcon m_file_icon; GIcon m_cplusplus_icon; GIcon m_header_icon; GIcon m_project_icon; };