copasi/UI/copasiui3window.cpp
/**
 * Utility function for guessing whether the file might
 * be an SBML file. If so it should contain an SBML tag in the
 * first couple of lines.
 */
Utility function for guessing whether the file might
be an SBML file. If so it should contain an SBML tag in the
first couple of lines.
Utility function for guessing whether the file might be an SBML file . If so it should contain an SBML tag in the first couple of lines .
bool isProbablySBML(QString &fileName)
{
  QFile file(fileName);
  if (!file.open(QIODevice::ReadOnly))
    return false;
  for (int i = 0; i < 5; ++i)
    {
      QByteArray array = file.readLine();
      if (QString(array).contains("<sbml"))
        return true;
    }
  file.close();
  return false;
}
bool isProbablySBML ( QString & fileName ) { QFile file ( fileName ) ; if ( ! file . open ( QIODevice :: ReadOnly ) ) return false ; for ( int i = 0 ; i < 5 ; ++ i ) { QByteArray array = file . readLine ( ) ; if ( QString ( array ) . contains ( " " ) ) return true ; } file . close ( ) ; return false ; }
Utility function for guessing whether the file might
 be an SBML file.
Utility function for guessing whether the file might be an SBML file .