makefile::Conditional Class Reference

Makefiles can have conditional parts, that are only seen by make if the condition is true. More...

#include <Conditional.h>

Inheritance diagram for makefile::Conditional:

Inheritance graph
[legend]
List of all members.

Public Member Functions

 Conditional ()
virtual ~Conditional ()
void addToIf (MakefileItem &item)
void addToElse (MakefileItem &item)
virtual string toString ()

Private Member Functions

virtual string printif ()=0
 Output the header line, like ifeq (arg1, arg2).

Private Attributes

std::vector< MakefileItem * > ifblock
 MakefileItem active if the condition is true.
std::vector< MakefileItem * > elseblock
 MakefileItem in the else block. The else-block is ommited if this is empty.

Detailed Description

Makefiles can have conditional parts, that are only seen by make if the condition is true.

Therefore the conditional blocks can contain any one or more MakefileItem. There are four kinds of conditionals, they can start with ifeq, ifneq, ifdef and ifndef. The first two test for equality or non-equality, the latter two are true if a Variable is defined or not. This is the abstract baseclass for all those.

Note:
The output does intentionally not have intentions. Maybe that would be good and unproblematic but I'm not sure, and intention matters in makefiles (see rules).

Definition at line 48 of file Conditional.h.


Constructor & Destructor Documentation

makefile::Conditional::Conditional (  )  [inline]

Definition at line 57 of file Conditional.h.

virtual makefile::Conditional::~Conditional (  )  [inline, virtual]

Definition at line 59 of file Conditional.h.


Member Function Documentation

void makefile::Conditional::addToElse ( MakefileItem item  )  [inline]

Definition at line 66 of file Conditional.h.

Referenced by makefile::tester::TestConditional::TestConditional().

void makefile::Conditional::addToIf ( MakefileItem item  )  [inline]

Examples:
example.cpp.

Definition at line 62 of file Conditional.h.

Referenced by main(), and makefile::tester::TestConditional::TestConditional().

virtual string makefile::Conditional::printif (  )  [private, pure virtual]

Output the header line, like ifeq (arg1, arg2).

Implemented in makefile::ConditionalEQ, makefile::ConditionalNEQ, makefile::ConditionalDEF, and makefile::ConditionalNDEF.

Referenced by toString().

string makefile::Conditional::toString (  )  [virtual]

Returns:
A string representation of the MakefileItem.

Implements makefile::MakefileItem.

Definition at line 30 of file Conditional.cpp.

References cstr, elseblock, ifblock, and printif().


Member Data Documentation

std::vector<MakefileItem*> makefile::Conditional::elseblock [private]

MakefileItem in the else block. The else-block is ommited if this is empty.

Definition at line 55 of file Conditional.h.

Referenced by toString().

std::vector<MakefileItem*> makefile::Conditional::ifblock [private]

MakefileItem active if the condition is true.

Definition at line 53 of file Conditional.h.

Referenced by toString().


The documentation for this class was generated from the following files:
Generated on 26 Nov 2014 for Hugintrunk by  doxygen 1.4.7