1 #ifndef WS_PROJECT_H_INCLUDED
2 #define WS_PROJECT_H_INCLUDED
44 template <
class FileType, const std::
string& index_file>
51 Project(
const std::string& path,
52 const std::string& prefs_file,
53 const std::shared_ptr<IWorkspace>& w);
62 virtual FileIterator
Add(
const std::string& name);
65 virtual std::shared_ptr<IFile>
Back();
68 virtual std::shared_ptr<const IFile>
Back()
const;
71 virtual FileIterator
begin();
74 virtual ConstFileIterator
begin()
const;
77 virtual FileIterator
end();
80 virtual ConstFileIterator
end()
const;
86 virtual FileIterator
Find(
const std::string& name);
89 virtual ConstFileIterator
Find(
const std::string& name)
const;
92 virtual std::shared_ptr<IFile>
Front();
95 virtual std::shared_ptr<const IFile>
Front()
const;
98 virtual std::shared_ptr<IFile>
Get(
const std::string& name);
101 virtual std::shared_ptr<const IFile>
Get(
const std::string& name)
const;
107 virtual const std::string&
GetPath()
const;
110 virtual std::shared_ptr<Session::ISession>
GetSession()
const;
116 virtual const boost::property_tree::ptree&
GetUserData(
const std::string& user)
const;
119 virtual bool IsLeaf(
const std::string& name)
const;
131 virtual void Open(
const std::string& name);
134 virtual void Open(FileIterator);
140 virtual void Remove(
const std::string& name);
143 virtual void Remove(FileIterator);
152 virtual void SetUserData(
const std::string& user,
const boost::property_tree::ptree&);
177 #endif // end_of_inclde_guard
Utility class for being informed about changes to a file/directory on the filesystem.
Implementation of IPreferences.
Util::FileSystemWatcher m_filesystem_watcher
Watches project directory for changes.
virtual FileIterator Add(const std::string &name)
Interface for project-like behavior.
virtual bool IsWatchingDirectory() const
Interface for Preferences.
virtual Session::ISession & Session() const
virtual void Remove(const std::string &name)
virtual void SetWatchingDirectory(bool)
virtual std::shared_ptr< IFile > Get(const std::string &name)
Abstraction of project in workspace on file system.
boost::property_tree::ptree m_user_data
User data. Mutable because a GetUserData() with non-existing argument will create an empty user data ...
virtual std::string GetSessionFileName() const
std::string m_session_name
Name of opened file.
virtual bool IsLeaf(const std::string &name) const
Project(const std::string &path, const std::string &prefs_file, const std::shared_ptr< IWorkspace > &w)
Constructor.
virtual FileIterator begin()
virtual bool IsOpened() const
virtual std::shared_ptr< Session::ISession > GetSession() const
virtual ~Project()
Virtual destructor.
std::shared_ptr< Session::ISession > m_session
Opened state.
virtual std::shared_ptr< IFile > Back()
virtual FileIterator end()
std::shared_ptr< IWorkspace > m_workspace
Workspace to which project belongs.
std::string m_path
Path of project directory.
virtual void SetUserData(const std::string &user, const boost::property_tree::ptree &)
FileMap m_files
Mapping from file name to file objects.
virtual std::shared_ptr< IFile > Front()
virtual const std::string & GetPath() const
virtual const std::string & GetIndexFile() const
Namespace for generic graphical shell for simulators.
Definition for FileSystemWatcher.
virtual const boost::property_tree::ptree & GetUserData(const std::string &user) const
Generic session interface.
virtual FileIterator Find(const std::string &name)