Fawkes API  Fawkes Development Version
PluginGenerator Class Reference

Generate basic plugins from minimal input. More...

#include <plugin_generator.h>

Public Member Functions

 PluginGenerator (std::string directory, std::string author, std::string year, std::string creation_date, std::string plugin_name, 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...
 

Detailed Description

Generate basic plugins from minimal input.

Definition at line 31 of file plugin_generator.h.

Constructor & Destructor Documentation

◆ PluginGenerator()

PluginGenerator::PluginGenerator ( std::string  directory,
std::string  author,
std::string  year,
std::string  creation_date,
std::string  plugin_name,
std::string  description 
)

Constructor.

Parameters
directoryDirectory where to create the files
authorAuthor of the plugin
yearYear of copyright
creation_dateCreation date of the plugin
plugin_nameName of the plugin
descriptionPlugin description

Definition at line 50 of file plugin_generator.cpp.

References fawkes::StringConversions::to_upper().

◆ ~PluginGenerator()

PluginGenerator::~PluginGenerator ( )

Destructor.

Definition at line 81 of file plugin_generator.cpp.

Member Function Documentation

◆ format_class_name()

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

Parameters
plugin_namename of plugin
appendixclass name appendix, e.g., Thread or Plugin
Returns
class name matching the plugin name

Definition at line 322 of file plugin_generator.cpp.

◆ generate()

void PluginGenerator::generate ( )

Generator cpp and h files.

Definition at line 354 of file plugin_generator.cpp.

◆ replace_dash_w_undescore()

std::string PluginGenerator::replace_dash_w_undescore ( std::string  source)

Replace dash with underscore.

Example: plugin-generator to plugin_generator

Parameters
sourceinput string
Returns
modified string

Definition at line 305 of file plugin_generator.cpp.

◆ write_deflector()

void PluginGenerator::write_deflector ( FILE *  f)

Write header deflector.

Parameters
ffile to write to

Definition at line 148 of file plugin_generator.cpp.

◆ write_header()

void PluginGenerator::write_header ( FILE *  f,
std::string  filename 
)

Write header to file.

Parameters
ffile to write to
filenamename of file

Definition at line 90 of file plugin_generator.cpp.

◆ write_makefile()

void PluginGenerator::write_makefile ( FILE *  f)

Write Makefile.

Parameters
ffile to write to

Definition at line 278 of file plugin_generator.cpp.

◆ write_makefile_header()

void PluginGenerator::write_makefile_header ( FILE *  f)

Write makefile header.

Parameters
ffile to write to

Definition at line 122 of file plugin_generator.cpp.

◆ write_plugin_cpp()

void PluginGenerator::write_plugin_cpp ( FILE *  f)

Write plugin cpp file.

Parameters
ffile to write to

Definition at line 238 of file plugin_generator.cpp.

◆ write_thread_cpp()

void PluginGenerator::write_thread_cpp ( FILE *  f)

Write cpp file.

Parameters
ffile to write to

Definition at line 159 of file plugin_generator.cpp.

◆ write_thread_h()

void PluginGenerator::write_thread_h ( FILE *  f)

Write h file.

Parameters
ffile to write to

Definition at line 196 of file plugin_generator.cpp.


The documentation for this class was generated from the following files: