24 const std::string json_extention =
".json";
25 const std::string untitled_name =
"Untitled";
36 std::transform(result.begin(), result.end(), result.begin(), ::tolower);
37 return result + json_extention;
52 return std::make_unique<Project>(context);
68 auto pos = project_dir.find_last_of(
'/');
69 auto project_name = (pos == std::string::npos ? untitled_name : project_dir.substr(pos + 1));
70 auto unsaved_status = is_modified ?
"*" :
"";
71 return unsaved_status + project_name;
Interface to manipulate projects on disk.
Main class to hold hierarchy of SessionItem objects.
std::string modelType() const
Returns model type.
MVVM_MODEL_EXPORT std::string SuggestFileName(const SessionModel &model)
Suggests file name which can be used to store json content of given model.
MVVM_MODEL_EXPORT std::unique_ptr< ProjectInterface > CreateUntitledProject(const ProjectContext &context)
Creates new untitled project.
MVVM_MODEL_EXPORT bool IsPossibleProjectDir(const std::string &project_dir)
Returns 'true' if given directory might be a project directory.
MVVM_MODEL_EXPORT std::string ProjectWindowTitle(const ProjectInterface &project)
Returns a MainWindow title for given project.
MVVM_MODEL_EXPORT std::vector< std::string > FindFiles(const std::string &dirname, const std::string &ext)
Returns list of files with given extention found in given directory.
materialitems.h Collection of materials to populate MaterialModel.
@ project
selective copying for saving/loading the project (tags and data created by item, updated from JSON)
Provides necessary information for Project construction.