| 990 | return string; |
| 991 | } |
| 992 | eng::Model* ProjectParser::LoadModel(const std::string& file) |
| 993 | { |
| 994 | // return already loaded model |
| 995 | for (auto& mdl : m_models) |
| 996 | if (mdl.first == file) |
| 997 | return mdl.second; |
| 998 | |
| 999 | m_models.push_back(std::make_pair(file, new eng::Model())); |
| 1000 | |
| 1001 | // load the model |
| 1002 | std::string path = GetProjectPath(file); |
| 1003 | bool loaded = m_models[m_models.size() - 1].second->LoadFromFile(path); |
| 1004 | if (!loaded) { |
| 1005 | m_models.erase(m_models.begin() + (m_models.size() - 1)); |
| 1006 | return nullptr; |
| 1007 | } |
| 1008 | |
| 1009 | return m_models[m_models.size() - 1].second; |
| 1010 | } |
| 1011 | void ProjectParser::SaveProjectFile(const std::string& file, const std::string& data) |
| 1012 | { |
| 1013 | std::ofstream out(GetProjectPath(file)); |
no test coverage detected