Envision
A visual programming IDE for object-oriented languages
List of all members | Public Member Functions | Private Attributes
OODebug::CommandLineCompiler Class Reference

A wrapper class for command line compilers. More...

Public Member Functions

 CommandLineCompiler (const QString &compilerCommand, std::function< CompilerFeedback(const QString &)> parseFunction)
 Creates a new CommandLineCompiler which will use the command compilerCommand and parseFunction for parsing the output. More...
 
CompilerFeedback compileFile (const QString &workingDirectory, const QString &fileName, const QStringList &args={})
 Starts the compile command in the directory workingDirectory and compiles the file with name fileName using the arguments as in args. More...
 

Private Attributes

QString command_
 
std::function< CompilerFeedback(const QString &)> parseFunction_
 

Detailed Description

A wrapper class for command line compilers.

Constructor & Destructor Documentation

◆ CommandLineCompiler()

OODebug::CommandLineCompiler::CommandLineCompiler ( const QString &  compilerCommand,
std::function< CompilerFeedback(const QString &)>  parseFunction 
)
inline

Creates a new CommandLineCompiler which will use the command compilerCommand and parseFunction for parsing the output.

Member Function Documentation

◆ compileFile()

CompilerFeedback OODebug::CommandLineCompiler::compileFile ( const QString &  workingDirectory,
const QString &  fileName,
const QStringList &  args = {} 
)

Starts the compile command in the directory workingDirectory and compiles the file with name fileName using the arguments as in args.

If there are problems (like e.g. missing command) this method throws an OODebugException.

Note: This call is blocking, it blocks until the command is finished.

Member Data Documentation

◆ command_

QString OODebug::CommandLineCompiler::command_
private

◆ parseFunction_

std::function<CompilerFeedback(const QString&)> OODebug::CommandLineCompiler::parseFunction_
private