Logo Search packages:      
Sourcecode: ccbuild version File versions

bneijt::Compiler Class Reference

#include <Compiler.hh>

List of all members.


Detailed Description

A compiler wrapping class.

This class is a wrapper for the compiler. All functionality of the compiler is is, as needed, reflected by functions in this class. It also keeps track of any additional compiler arguments "currently" needed.

When cleaning a system, this Compiler's interface is overloaded with the Cleaner class, which issues the unlink command on the output files for all the objects.

Definition at line 38 of file Compiler.hh.


Public Member Functions

void addArgument (std::string argument)
 Add the library lib to the compiler options.
void addObject (std::string objFilename)
 Add the folowing object as a link option to the commandline.
int ar (std::string pwd, std::string outputFile) const
 Create an archive from all the objects.
int compile (std::string pwd, std::string target, std::string outputFile) const
 Run the compiler to create an object.
std::vector< std::string > const & compileArguments () const
 Return the arguments used for compilation (also used while linking).
std::string compileCommand (std::string pwd, std::string target, std::string outputFile) const
 Return the compile command to create an object.
 Compiler (Compiler const &other)
 Copy constructor.
 Compiler (std::string basecommand=Options::CC)
 Initialize the compiler.
int lib (std::string pwd, std::string outputFile, std::string const &version) const
 Create a library from all the objects.
std::string libCommand (std::string pwd, std::string outputFile) const
 Return the library creation command to create a library.
int link (std::string pwd, std::string outputFile) const
 Link all the objects to a file.
std::vector< std::string > const & linkArguments () const
 Return the arguments used for linking only.
std::string linkCommand (std::string pwd, std::string outputFile) const
 Return the command used to link all the objects to a file.
std::vector< std::string > const & objects () const
 Return the map containing all the objects.
Compiler const & operator+ (Compiler const &rvalue)
 Return the sum of to compilers.
int precompile (std::string pwd, std::string target, std::string outputFile) const
 Run the compiler to precopmile a (header) file.
std::string precompileCommand (std::string pwd, std::string target, std::string outputFile) const
 Return the compiler command to precopmile a (header) file.
void rmCompileOptions ()
 Remove all compile-time arguments of the compiler.
void rmObjects ()
 Clear the list of objects used at link-time.

Private Member Functions

void cls () const
 Clear the screen if needed according to options.
unsigned countFirstLinkerArguments (std::vector< std::string > &arguments) const
 Return the number of linker arguments at the beginning of the given list.
void splitInto (std::string argument, std::vector< std::string > &arguments) const
 Split an arguments list into it's arguments.

Private Attributes

std::string d_baseCommand
 The basic command used for both link and compile (g++).
std::vector< std::string > d_compile
 List of compile options.
std::vector< std::string > d_link
 List of link options.
std::vector< std::string > d_objects
 List of known objects (.o files for link fase).

Static Private Attributes

static std::string const s_clear
 String to clear the screen.
static std::string const s_highLightOff
 String to end a highlight.
static std::string const s_highLightOn
 String to begin a highlight.
static std::string const s_msgCancelBruteMode
 Message to print when canceling brute mode.

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

Generated by  Doxygen 1.6.0   Back to index