public addOption ( |
||
option | ||
return | void |
public new void addOption(ConversionOption option)
{
libsbmlPINVOKE.ConversionProperties_addOption__SWIG_0(swigCPtr, ConversionOption.getCPtr(option));
if (libsbmlPINVOKE.SWIGPendingException.Pending) throw libsbmlPINVOKE.SWIGPendingException.Retrieve();
}
ConversionProperties::addOption ( string key ) : void | |
ConversionProperties::addOption ( string key, bool value ) : void | |
ConversionProperties::addOption ( string key, bool value, string description ) : void | |
ConversionProperties::addOption ( string key, double value ) : void | |
ConversionProperties::addOption ( string key, double value, string description ) : void | |
ConversionProperties::addOption ( string key, float value ) : void | |
ConversionProperties::addOption ( string key, float value, string description ) : void | |
ConversionProperties::addOption ( string key, int value ) : void | |
ConversionProperties::addOption ( string key, int value, string description ) : void | |
ConversionProperties::addOption ( string key, string value ) : void | |
ConversionProperties::addOption ( string key, string value, int type ) : void | |
ConversionProperties::addOption ( string key, string value, int type, string description ) : void | |
ConversionProperties::addOption ( string key, string value, string description ) : void |
public static void Main(String[] args) { if (args.Length < 2 || args.Length > 3) { Console.WriteLine("Usage: FlattenModel [-p] input-filename output-filename"); Console.WriteLine(" -p : list unused ports"); Environment.Exit(2); } SBMLReader reader = new SBMLReader(); SBMLWriter writer = new SBMLWriter(); bool leavePorts = false; SBMLDocument doc; if (args.Length == 2) { doc = reader.readSBML(args[0]); } else { doc = reader.readSBML(args[1]); leavePorts = true; } if (doc.getErrorLog().getNumFailsWithSeverity(libsbml.LIBSBML_SEV_ERROR) > 0) { doc.printErrors(); } else { /* create a new conversion properties structure */ ConversionProperties props = new ConversionProperties(); /* add an option that we want to flatten */ props.addOption("flatten comp", true, "flatten comp"); /* add an option to leave ports if the user has requested this */ props.addOption("leavePorts", leavePorts, "unused ports should be listed in the flattened model"); /* perform the conversion */ int result = doc.convert(props); if (result != libsbml.LIBSBML_OPERATION_SUCCESS) { Console.WriteLine("conversion failed ... ({0})", result); doc.printErrors(); Environment.Exit(3); } if (args.Length == 2) { writer.writeSBML(doc, args[1]); } else { writer.writeSBML(doc, args[2]); } } }