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::Scaffold Class Reference

Main class for the program, as a singleton. More...

#include <scaffold.h>

+ Inheritance diagram for scaffold::Scaffold:

Public Types

enum  LogTypes { LOG_PROJECTS = 0x0000100, LOG_GENERATORS = 0x0000200, LOG_GENFILES = 0x0000400, LOG_ALL }
 bitmask for types of messages that are being logged More...
 

Public Member Functions

bool initDMP (void)
 initialise diff_match_patch module at the beginning of second stage More...
 

Static Public Member Functions

static Scaffoldunique (void)
 the one and only instance
 
static bool init (const QStringList &init_files, const bbb::VarMap &var_map)
 initialisation method
 
static ExitCode perform (QCoreApplication &app)
 acts as main
 
static void end (void)
 finish method
 
static Scafrexscafrex (void)
 enhanced rexscript interpreter
 
static bool blendTwoFiles (const QString &s_path_1, const QString &s_path_2)
 mixes two files and saves the result in first file
 
static bool readTextFile (const QString &s_path, QString &s_out)
 get the content of a file; throw an error if it fails
 
static bool writeTextFile (const QString &s_path, const QString &s_out)
 write the string to a file; throw an error if it fails
 
Generators

Shortcuts for dealing with generators

static GeneratorgetValidGenerator (void)
 expect current project to be a valid generator
 
static GeneratorgetValidGenerator (const QString &s_name)
 expect current project to be a valid generator
 
Messages

Communication with the user

static void fileError (const QString &s)
 show an error message related to current file and line
 
static void error (const QString &s)
 show an error message not related to control file
 
static void info (const QString &s)
 show an informative message
 
static void log (int ty, const QString &s)
 show a log message
 

Projects

Methods in this group deal with projects.

static int findProjectId (const QString &s_name)
 find a project given its name
 
static int findProjectId (const Project *trg)
 find a project given its name
 
static ProjectfindProject (const QString &s_name)
 find a project given its name
 
static ProjectgetProject (const QString &s_name)
 get existing project or start a new one
 
static ProjectcurrentProject (void)
 current project
 
static ProjectgetValidProject (void)
 expect current project to be a valid project
 
static ProjectgetValidProject (const QString &s_name)
 expect named project to be a valid project
 
static ProjectstartProject (const QString &s_name)
 launch a project
 
QString defaultProjectPath (void)
 default path to projects; retrieves the value of PRJPATH
 

Detailed Description

Main class for the program, as a singleton.

Member Enumeration Documentation

bitmask for types of messages that are being logged

The bits here must be synced with the ones in RexScript::LogTypes; as such, 0x00FF byte is reserved and we start with next available it.

Enumerator
LOG_PROJECTS 

Changes in projects

LOG_GENERATORS 

Changes in generators

LOG_GENFILES 

Files generated by us

LOG_ALL 

all tests are enabled with this

Member Function Documentation

bool Scaffold::initDMP ( void  )

initialise diff_match_patch module at the beginning of second stage

The method will look at the variables that influence DMP and, if found, will use their values; the method throws an error if there are problems in interpreting the values.

Returns
false if errors occured

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