Vaucanson  1.4.1
dumper.hh
Go to the documentation of this file.
1 // dumper.hcc: this file is part of the Vaucanson project. -*- C++ -*-
2 //
3 // Vaucanson, a generic library for finite state machines.
4 //
5 // Copyright (C) 2005, 2006, 2007 The Vaucanson Group.
6 //
7 // This program is free software; you can redistribute it and/or
8 // modify it under the terms of the GNU General Public License
9 // as published by the Free Software Foundation; either version 2
10 // of the License, or (at your option) any later version.
11 //
12 // The complete GNU General Public Licence Notice can be found as the
13 // `COPYING' file in the root directory.
14 //
15 // The Vaucanson Group consists of people listed in the `AUTHORS' file.
16 
34 #ifndef VCSN_TOOLS_DUMPER_HH
35 # define VCSN_TOOLS_DUMPER_HH
36 # ifndef VCSN_SANITY_CHECK
37 
38 # include <string>
39 
40 namespace vcsn
41 {
42  namespace tools
43  {
45  int string_to_int (const std::string& s);
46 
47  struct dumper
48  {
51  dumper (int argc, char **argv, int pos = 1);
52 
54  void usage (int estatus);
55 
56  enum dump_format
57  {
58  fmt_error,
59  fmt_dot,
60  fmt_fsm,
61  fmt_simple,
62  fmt_xml,
63  };
64 
65  enum dump_format dump_format (std::string fmt);
66 
67  const char* get_fmt () const;
68 
69  void
70  operator () (std::ostream& o,
71  const automaton_t& automaton,
72  const std::string& name = "automaton");
73  private:
74  enum dump_format fmt_;
75  int argc_;
76  char** argv_;
77  };
78  }
79 }
80 
81 # ifndef VCSN_USE_INTERFACE_ONLY
82 # include <vaucanson/tools/dumper.hxx>
83 # endif // ! VCSN_USE_INTERFACE_ONLY
84 # endif // ! VCSN_SANITY_CHECK
85 #endif // ! VCSN_TOOLS_DUMPER_HH && ! VCSN_SANITY_CHECK