void Vpz::parseMemory(const std::string& buffer) { m_filename.clear(); vpz::SaxParser saxparser(*this); try { saxparser.parseMemory(buffer); } catch(const std::exception& sax) { try { validateMemory(buffer); } catch(const std::exception& dom) { throw utils::SaxParserError(fmt(_("%2%\n\n%1%")) % dom.what() % sax.what()); } throw utils::SaxParserError(sax.what()); } }
void Vpz::parseMemory(const std::string &buffer) { clear(); project().experiment().conditions().deleteValueSet(); m_filename.clear(); vpz::SaxParser saxparser(*this); saxparser.parseMemory(buffer); auto &cnd = project().experiment().conditions().get( Experiment::defaultSimulationEngineCondName()); if (cnd.getSetValues("begin").empty()) { cnd.getSetValues("begin").emplace_back(new value::Double(0)); cnd.getSetValues("duration").emplace_back(new value::Double(100)); } }
void Vpz::parseFile(const std::string& filename) { m_filename.assign(filename); vpz::SaxParser saxparser(*this); try { saxparser.parseFile(filename); } catch(const std::exception& sax) { try { validateFile(filename); } catch(const std::exception& dom) { saxparser.clearParserState(); throw utils::SaxParserError(fmt(_("%2%\n\n%1%")) % dom.what() % sax.what()); } throw utils::SaxParserError(sax.what()); } }