|
Fawkes API
Fawkes Development Version
|
Generate basic plugins from minimal input. More...
#include <plugin_generator.h>
Public Member Functions | |
| 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. More... | |
| ~PluginGenerator () | |
| Destructor. More... | |
| void | write_thread_h (FILE *f) |
| Write h file. More... | |
| void | write_thread_cpp (FILE *f) |
| Write cpp file. More... | |
| void | write_plugin_cpp (FILE *f) |
| Write plugin cpp file. More... | |
| void | write_makefile (FILE *f) |
| Write Makefile. More... | |
| void | write_makefile_header (FILE *f) |
| Write makefile header. More... | |
| void | write_header (FILE *f, std::string filename) |
| Write header to file. More... | |
| void | write_deflector (FILE *f) |
| Write header deflector. More... | |
| std::string | format_class_name (std::string plugin_name, std::string append) |
| Format a lowercase plugin name to CamelCase class. More... | |
| std::string | replace_dash_w_undescore (std::string source) |
| Replace dash with underscore. More... | |
| void | generate () |
| Generator cpp and h files. More... | |
Generate basic plugins from minimal input.
Definition at line 31 of file plugin_generator.h.
| PluginGenerator::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.
| directory | Directory where to create the files |
| author | Author of the plugin |
| year | Year of copyright |
| creation_date | Creation date of the plugin |
| plugin_name | Name of the plugin |
| description | Plugin description |
Definition at line 49 of file plugin_generator.cpp.
References format_class_name(), replace_dash_w_undescore(), and fawkes::StringConversions::to_upper().
| PluginGenerator::~PluginGenerator | ( | ) |
Destructor.
Definition at line 81 of file plugin_generator.cpp.
| std::string PluginGenerator::format_class_name | ( | std::string | plugin_name, |
| std::string | appendix | ||
| ) |
Format a lowercase plugin name to CamelCase class.
Example: plugin_name to PluginNameThread
| plugin_name | name of plugin |
| appendix | class name appendix, e.g., Thread or Plugin |
Definition at line 327 of file plugin_generator.cpp.
Referenced by PluginGenerator().
| void PluginGenerator::generate | ( | ) |
Generator cpp and h files.
Definition at line 358 of file plugin_generator.cpp.
References write_makefile(), write_plugin_cpp(), write_thread_cpp(), and write_thread_h().
| std::string PluginGenerator::replace_dash_w_undescore | ( | std::string | source | ) |
Replace dash with underscore.
Example: plugin-generator to plugin_generator
| source | input string |
Definition at line 311 of file plugin_generator.cpp.
Referenced by PluginGenerator().
| void PluginGenerator::write_deflector | ( | FILE * | f | ) |
Write header deflector.
| f | file to write to |
Definition at line 150 of file plugin_generator.cpp.
Referenced by write_thread_h().
| void PluginGenerator::write_header | ( | FILE * | f, |
| std::string | filename | ||
| ) |
Write header to file.
| f | file to write to |
| filename | name of file |
Definition at line 90 of file plugin_generator.cpp.
Referenced by write_plugin_cpp(), write_thread_cpp(), and write_thread_h().
| void PluginGenerator::write_makefile | ( | FILE * | f | ) |
Write Makefile.
| f | file to write to |
Definition at line 282 of file plugin_generator.cpp.
References write_makefile_header().
Referenced by generate().
| void PluginGenerator::write_makefile_header | ( | FILE * | f | ) |
Write makefile header.
| f | file to write to |
Definition at line 123 of file plugin_generator.cpp.
Referenced by write_makefile().
| void PluginGenerator::write_plugin_cpp | ( | FILE * | f | ) |
Write plugin cpp file.
| f | file to write to |
Definition at line 238 of file plugin_generator.cpp.
References write_header().
Referenced by generate().
| void PluginGenerator::write_thread_cpp | ( | FILE * | f | ) |
Write cpp file.
| f | file to write to |
Definition at line 160 of file plugin_generator.cpp.
References write_header().
Referenced by generate().
| void PluginGenerator::write_thread_h | ( | FILE * | f | ) |
Write h file.
| f | file to write to |
Definition at line 197 of file plugin_generator.cpp.
References write_deflector(), and write_header().
Referenced by generate().