copasi/sedml/SEDMLImporter.cpp
/**
 * Function reads an SEDML file with libsedml and converts it to a Copasi CModel
 */
Function reads an SEDML file with libsedml and converts it to a Copasi CModel
Function reads an SEDML file with libsedml and converts it to a Copasi CModel
CModel* SEDMLImporter::readSEDML(std::string filename,
                                 CProcessReport* pImportHandler,
                                 SBMLDocument *& pSBMLDocument,
                                 SedDocument*& pSedDocument,
                                 std::map<CDataObject*, SedBase*>& copasi2sedmlmap,
                                 std::map<CDataObject*, SBase*>& copasi2sbmlmap,
                                 CListOfLayouts *& prLol,
                                 COutputDefinitionVector * &plotList,
                                 CDataModel* pDataModel)
{
  std::ifstream file(CLocaleString::fromUtf8(filename).c_str());
  if (!file)
    {
      CCopasiMessage(CCopasiMessage::EXCEPTION, MCSEDML + 5, filename.c_str());
    }
  std::ostringstream stringStream;
  char c;
  while (file.get(c))
    {
      stringStream << c;
    }
  file.clear();
  file.close();
  pDataModel->setSEDMLFileName(filename);
  return this->parseSEDML(stringStream.str(), pImportHandler,
                          pSBMLDocument, pSedDocument, copasi2sedmlmap, copasi2sbmlmap, prLol,  plotList, pDataModel);
}
CModel * SEDMLImporter :: readSEDML ( std :: string filename , CProcessReport * pImportHandler , SBMLDocument * & pSBMLDocument , SedDocument * & pSedDocument , std :: map < CDataObject * , SedBase * > & copasi2sedmlmap , std :: map < CDataObject * , SBase * > & copasi2sbmlmap , CListOfLayouts * & prLol , COutputDefinitionVector * & plotList , CDataModel * pDataModel ) { std :: ifstream file ( CLocaleString :: fromUtf8 ( filename ) . c_str ( ) ) ; if ( ! file ) { CCopasiMessage ( CCopasiMessage :: EXCEPTION , MCSEDML + 5 , filename . c_str ( ) ) ; } std :: ostringstream stringStream ; char c ; while ( file . get ( c ) ) { stringStream << c ; } file . clear ( ) ; file . close ( ) ; pDataModel -> setSEDMLFileName ( filename ) ; return this -> parseSEDML ( stringStream . str ( ) , pImportHandler , pSBMLDocument , pSedDocument , copasi2sedmlmap , copasi2sbmlmap , prLol , plotList , pDataModel ) ; }
Function reads an SEDML file with libsedml and converts it to a Copasi CModel
Function reads an SEDML file with libsedml and converts it to a Copasi CModel
// convert filename to the locale encoding //using libzip to read SEDML file /*  SEDMLUtils utils;
  std::string SEDMLFileName, fileContent("");
  SEDMLFileName = "sedml.xml";

  int success = utils.processArchive(filename, SEDMLFileName, fileContent);*/