A simple command-line program that reads an SBML file and prints some statistics about it.
using System.Collections.Generic;
internal class ReadSBML
{
public static int Main(string[] args)
{
if (args.Length != 1)
{
Console.WriteLine("Usage: readSBML filename");
return 1;
}
string filename = args[0];
long current = DateTime.Now.Ticks;
SBMLDocument document = libsbml.readSBML(filename);
int errors = (int)document.getNumErrors();
Console.WriteLine();
Console.WriteLine(" filename: " + filename);
Console.WriteLine(" file size: " + new FileInfo(filename).Length);
Console.WriteLine(" read time (ms): " + (DateTime.Now.Ticks - current));
Console.WriteLine(" validation error(s): " + errors);
Console.WriteLine();
document.printErrors();
return errors;
}
}