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 <sstream>
27#include <stdio.h>
28#include <string>
29#include <vector>
30
32{
33public:
34 PluginGenerator(const std::string &directory,
35 const std::string &author,
36 const std::string &year,
37 const std::string &creation_date,
38 const std::string &plugin_name,
39 const std::string &description);
41
42 void write_thread_h(FILE *f);
43 void write_thread_cpp(FILE *f);
44 void write_plugin_cpp(FILE *f);
45 void write_makefile(FILE *f);
46 void write_makefile_header(FILE *f);
47 void write_header(FILE *f, std::string filename);
48 void write_deflector(FILE *f);
49 std::string format_class_name(std::string plugin_name, std::string append);
50 std::string replace_dash_w_undescore(std::string source);
51 void generate();
52
53private:
54 std::string _dir;
55 std::string _author;
56 std::string _year;
57 std::string _creation_date;
58 std::string _plugin_name;
59 std::string _plugin_name_underscore;
60 std::string _class_name_thread;
61 std::string _class_name_plugin;
62 std::string _description;
63 std::string _filename_thread_cpp;
64 std::string _filename_thread_h;
65 std::string _filename_plugin_cpp;
66 std::string _filename_makefile;
67 std::string _deflector;
68};
69
70#endif
Generate basic plugins from minimal input.
void write_header(FILE *f, std::string filename)
Write header to file.
void write_makefile(FILE *f)
Write Makefile.
void write_thread_cpp(FILE *f)
Write cpp file.
~PluginGenerator()
Destructor.
void write_makefile_header(FILE *f)
Write makefile header.
std::string replace_dash_w_undescore(std::string source)
Replace dash with underscore.
void generate()
Generator cpp and h files.
std::string format_class_name(std::string plugin_name, std::string append)
Format a lowercase plugin name to CamelCase class.
PluginGenerator(const std::string &directory, const std::string &author, const std::string &year, const std::string &creation_date, const std::string &plugin_name, const std::string &description)
Constructor.
void write_deflector(FILE *f)
Write header deflector.
void write_plugin_cpp(FILE *f)
Write plugin cpp file.
void write_thread_h(FILE *f)
Write h file.