#ifndef PROJECT_H #define PROJECT_H #include #include #include #include #include "project/RefreshInfo.h" #include "project/SourceGroup.h" struct FileInfo; class DialogView; class FilePath; class PersistentStorage; class ProjectSettings; class StorageCache; class Project { public: Project(std::shared_ptr settings, StorageCache* storageCache, bool hasGUI); virtual ~Project(); FilePath getProjectSettingsFilePath() const; std::string getDescription() const; bool settingsEqualExceptNameAndLocation(const ProjectSettings& otherSettings) const; void setStateSettingsUpdated(); void load(); void refresh(DialogView* dialogView, RefreshMode refreshMode); RefreshInfo getRefreshInfo(RefreshMode mode) const; void buildIndex(const RefreshInfo& info); private: enum ProjectStateType { PROJECT_STATE_NOT_LOADED, PROJECT_STATE_EMPTY, PROJECT_STATE_LOADED, PROJECT_STATE_OUTDATED, PROJECT_STATE_OUTVERSIONED, PROJECT_STATE_SETTINGS_UPDATED, PROJECT_STATE_NEEDS_MIGRATION }; Project(const Project&); std::set getAllSourceFilePaths() const; RefreshInfo getRefreshInfoForUpdatedFiles() const; RefreshInfo getRefreshInfoForIncompleteFiles() const; RefreshInfo getRefreshInfoForAllFiles() const; bool hasCxxSourceGroup() const; bool didFileChange(const FileInfo& info) const; std::shared_ptr m_settings; StorageCache* const m_storageCache; ProjectStateType m_state; std::shared_ptr m_storage; std::vector> m_sourceGroups; bool m_hasGUI; }; #endif // PROJECT_H