Fawkes API  Fawkes Development Version
plugin_generator.h
1 
2 /***************************************************************************
3  * cpp_generator.h - C++ Interface generator
4  *
5  * Created: Thu Oct 12 01:59:02 2006
6  * Copyright 2006-2008 Tim Niemueller [www.niemueller.de]
7  *
8  ****************************************************************************/
9 
10 /* This program is free software; you can redistribute it and/or modify
11  * it under the terms of the GNU General Public License as published by
12  * the Free Software Foundation; either version 2 of the License, or
13  * (at your option) any later version.
14  *
15  * This program is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18  * GNU Library General Public License for more details.
19  *
20  * Read the full text in the LICENSE.GPL file in the doc directory.
21  */
22 
23 #ifndef __PLUGINS_GENERATOR_H_
24 #define __PLUGINS_GENERATOR_H_
25 
26 #include <vector>
27 #include <string>
28 #include <sstream>
29 #include <stdio.h>
30 
32 {
33  public:
34  PluginGenerator(std::string directory,
35  std::string author,
36  std::string year, std::string creation_date,
37  std::string plugin_name, std::string description
38  );
40 
41  void write_thread_h(FILE *f);
42  void write_thread_cpp(FILE *f);
43  void write_plugin_cpp(FILE *f);
44  void write_makefile(FILE *f);
45  void write_makefile_header(FILE *f);
46  void write_header(FILE *f, std::string filename);
47  void write_deflector(FILE *f);
48  std::string format_class_name(std::string plugin_name, std::string append);
49  std::string replace_dash_w_undescore(std::string source);
50  void generate();
51 
52  private:
53  std::string _dir;
54  std::string _plugin_name;
55  std::string _plugin_name_underscore;
56  std::string _class_name_thread;
57  std::string _class_name_plugin;
58  std::string _description;
59  std::string _filename_thread_cpp;
60  std::string _filename_thread_h;
61  std::string _filename_plugin_cpp;
62  std::string _filename_makefile;
63  std::string _deflector;
64  std::string _author;
65  std::string _year;
66  std::string _creation_date;
67 };
68 
69 
70 #endif
std::string format_class_name(std::string plugin_name, std::string append)
Format a lowercase plugin name to CamelCase class.
void write_thread_h(FILE *f)
Write h file.
void write_thread_cpp(FILE *f)
Write cpp file.
void write_plugin_cpp(FILE *f)
Write plugin cpp file.
std::string replace_dash_w_undescore(std::string source)
Replace dash with underscore.
void write_makefile_header(FILE *f)
Write makefile header.
void generate()
Generator cpp and h files.
PluginGenerator(std::string directory, std::string author, std::string year, std::string creation_date, std::string plugin_name, std::string description)
Constructor.
void write_header(FILE *f, std::string filename)
Write header to file.
Generate basic plugins from minimal input.
~PluginGenerator()
Destructor.
void write_makefile(FILE *f)
Write Makefile.
void write_deflector(FILE *f)
Write header deflector.