scaffold  1.0.0
Generates files and directories based on templates and user input
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
scaffold::GenBasic Class Reference

Simple Generator. More...

#include <genbasic.h>

+ Inheritance diagram for scaffold::GenBasic:

Classes

class  FileList
 the list of files to generate and their sources More...
 

Public Member Functions

 GenBasic (Project *p, const QString &s_name)
 constructor
 
virtual ~GenBasic (void)
 destructor;
 
virtual bool addTemplate (const QString &s_path)
 add a template (TEMPL command uses this) More...
 
virtual bool generate (void)
 generate content
 
- Public Member Functions inherited from scaffold::Generator
 Generator (Project *p, const QString &s_name)
 constructor
 
virtual ~Generator (void)
 destructor;
 
Projectparent (void) const
 parent project
 
const QString & name (void) const
 the name of this generator
 
QString outputPath (void) const
 where we should generate content
 
ExistingPolicy overwriteMode (void) const
 how to deal with existing files
 
void setOverwriteMode (ExistingPolicy new_p)
 set how to deal with existing files
 

Static Public Member Functions

static Generatorcreate (Project *p, const QString &s_name)
 factory method in line with Generator::generatorFactory
 
- Static Public Member Functions inherited from scaffold::Generator
static void addGeneratorFactory (const QString &s_gen_name, generatorFactory factory)
 add a generator
 
static void remGeneratorFactory (const QString &s_gen_name)
 remove a generator
 
static generatorFactory factory (const QString &s_name)
 get generator factory for given name of NULL
 

Additional Inherited Members

- Public Types inherited from scaffold::Generator
enum  ExistingPolicy { OVERWRITE, KEEP, BLEND }
 how to deal with existing files
 
typedef Generator *(* generatorFactory )(Project *p, const QString &s_name)
 function capable of creating a generator
 

Detailed Description

Simple Generator.

This is a simple generator that copies files from the templates it recieves, replaces variables and creates coresponding files in output path.

When looking for files to use as templates the directories that start with an underscore ( _ ) are ignoed.

Member Function Documentation

bool GenBasic::addTemplate ( const QString &  s_path)
virtual

add a template (TEMPL command uses this)

Informs the generator that a template was added to it.

Parameters
s_paththe path to the template
Returns
false if an error occured

Implements scaffold::Generator.


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