COPASI API  4.16.103
Macros | Functions
SBWTranslator.cpp File Reference
#include <stdlib.h>
#include <sstream>
#include <string>
#include <iostream>
#include <SBWTranslator.h>
#include <SBW/SBW.h>
#include <copasi/copasi.h>
#include <copasi/commandline/COptions.h>
#include <copasi/report/CCopasiRootContainer.h>
#include <copasi/CopasiDataModel/CCopasiDataModel.h>
#include <copasi/utilities/CVersion.h>
#include <copasi/utilities/CDirEntry.h>
Include dependency graph for SBWTranslator.cpp:

Go to the source code of this file.

Macros

#define COPASI_MAIN
 

Functions

int main (int argc, char *argv[])
 

Macro Definition Documentation

#define COPASI_MAIN

Definition at line 20 of file SBWTranslator.cpp.

Function Documentation

int main ( int  argc,
char *  argv[] 
)

Definition at line 156 of file SBWTranslator.cpp.

References Copasi2SBMLTranslator::translateFileToSBML().

157 {
158 
159  try
160  {
161  setlocale(LC_ALL, "C");
162  bool doTranslate = false;
163  string fileName;
164 
165  for (int i = 0; i < argc; i++)
166  {
167  string current(argv[i]);
168 
169  if (current == "-f" && i + 1 < argc)
170  {
171  doTranslate = true;
172  fileName = argv[i + 1];
173  i++;
174  }
175  }
176 
177  if (doTranslate)
178  {
179  cout << Copasi2SBMLTranslator::translateFileToSBML(fileName) << endl;
180  exit(0);
181  }
182 
183  ModuleImpl modImpl(
184  "org.copasi.copasi2sbml", // module identification
185  "Copasi to SBML Translator", // humanly readable name
186  UniqueModule); // management scheme
187 
188  modImpl.addServiceObject(
189  "translator", // service identification
190  "Copasi2SBML Translator", // humanly readable name
191  "plugin/sbmlTranslator/bidirectional", // category
192  new Copasi2SBMLTranslator()); // service implementation
193 
194  modImpl.run(argc, argv);
195  }
196  catch (SBWException *e)
197  {
198  fprintf(stderr, "Copasi2SBMLTranslator exception: %s\n", e->getMessage().c_str());
199  return -1;
200  }
201 
202  return 0;
203 }
static std::string translateFileToSBML(const std::string &fileName)