gen2dot.cpp
Go to the documentation of this file.
1 /** gen2dot.cpp Utility to convert gen files to dot files */
2 
3 /* FAU Discrete Event Systems Library (libfaudes)
4 
5  Copyright (C) 2006 Bernd Opitz
6  Exclusive copyright is granted to Klaus Schmidt
7 
8  This library is free software; you can redistribute it and/or
9  modify it under the terms of the GNU Lesser General Public
10  License as published by the Free Software Foundation; either
11  version 2.1 of the License, or (at your option) any later version.
12 
13  This library is distributed in the hope that it will be useful,
14  but WITHOUT ANY WARRANTY; without even the implied warranty of
15  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16  Lesser General Public License for more details.
17 
18  You should have received a copy of the GNU Lesser General Public
19  License along with this library; if not, write to the Free Software
20  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
21 
22 #include "corefaudes.h"
23 
24 using namespace faudes;
25 
26 int main(int argc, char *argv[]) {
27 
28  // simple command line
29  if (argc != 2) {
30  std::cerr << "gen2dot: " << VersionString() << std::endl;
31  std::cerr << "usage: gen2dot <generator>" << std::endl;
32  exit(1);
33  }
34 
35  // read gen file
36  Generator g(argv[1]);
37 
38  // fix output file name
39  std::string basename = argv[1];
40  if (basename.rfind(".gen") < basename.size()) {
41  basename.resize(basename.rfind(".gen"));
42  }
43  std::string dotfilename = basename+".dot";
44 
45  // write dot file
46  g.DotWrite(dotfilename);
47 
48  return 0;
49 }
Base class of all FAUDES generators.
virtual void DotWrite(const std::string &rFileName) const
Writes generator to dot input format.
Includes all libFAUDES headers, no plugins.
int main(int argc, char *argv[])
Definition: gen2dot.cpp:26
libFAUDES resides within the namespace faudes.
std::string VersionString()
Return FAUDES_VERSION as std::string.
Definition: cfl_helper.cpp:131

libFAUDES 2.32b --- 2024.03.01 --- c++ api documentaion by doxygen