Logo Search packages:      
Sourcecode: ccbuild version File versions

bneijt::Source Class Reference

#include <Source.hh>

List of all members.


Detailed Description

Sourcefile wrapper.

This class wraps a sourcefile. It holds all functionality needed to extract information from the source. Information like: is it a headerfile (isHeader) or a sourcefile? Wether it should be used to create a executable (isBinTarget), a library (isLibTarget) or just an object (isObjectTarget). The source wrapper should be able to tell us everything we want to know about a source.

Definition at line 48 of file Source.hh.


Public Member Functions

std::string basename () const
 The basename of the filename.
void build (Compiler &cc)
 Compile this source using the compiler cc (Currently NOT USED).
void buildBinTarget (Compiler &cc)
 Build this source using the given compiler.
void buildHeader (Compiler &cc)
 Build this source using the given compiler (Currently NOT USED).
void buildObjectTarget (Compiler &cc)
 Build this source using the given compiler.
bool changed () const
 Check wether this source has changed since last seen.
bool changed (std::string const &substituteOutput) const
 Return wether this source has changed since last seen.
void dependencies (std::vector< Source * > &localDeps)
 Append this source's local dependency pointers to this list.
void dependencies (std::vector< Source * > &localDeps, std::vector< std::string * > &globalDeps)
 Give a list of all the sources that this source depends on.
void directDeps (std::vector< Source * > &localDeps, std::vector< std::string * > &globalDeps, std::vector< std::string > &ignored) const
 Give a list of all the sources that this source depends on.
void directDeps (std::vector< Source * > &localDeps, std::vector< std::string * > &globalDeps) const
 Give a list of all the sources that this source depends on.
void directDeps (std::vector< Source * > &localDeps) const
 Give a list of all the sources that this source depends on.
std::string directory () const
 The directory the file is in.
std::string const & filename () const
 The actual given filename.
void genDeps ()
 Create the list of all the sources that this source depends on directly.
bool hasSourceExtension () const
 Return true if the file has a C++ source extension (.cc etc.).
void ignoredDeps (std::vector< std::string > &ignored) const
 Give a list of all ignored dependencies.
bool isBinTarget () const
 Return true if the file is a binary target. This can only be done after the source has been inspected using genDeps().
bool isHeader () const
 Return true if the file is a header. This can only be done after the source has been inspected using genDeps().
bool isInternalHeader () const
 Return true if the file is a header. This can only be done after the source has been inspected using genDeps().
bool isLibTarget () const
 Return true if the file is a library target. This can only be done after the source has been inspected using genDeps().
bool isLocalHeader () const
 Return true if the file is a header. This can only be done after the source has been inspected using genDeps().
bool isObjectTarget () const
 Return true if the file is an object target. This can only be done after the source has been inspected using genDeps().
bool operator== (Source const &rvalue) const
 Compares two sources based on inode and device numbers.
std::string outputFilename () const
 The filename it will create.
bool producesOutput () const
 Return wether this source produces output.
bool reload ()
 Reload this source.
 Source ()
 Create an empty source.
 Source (std::string const filename)
 Load the source.
bool stale ()
 Return true if the source file is newer then the loaded class.
bool upToDate (std::vector< Source * > const &sources) const
 Return wether the source is up to date given a collection of reference sources.
bool upToDate ()
 Non-const helper function. Not const because of dependencies not being const.

Private Types

typedef std::pair< ino_t, dev_t > InodeDevPair
 A pair containing ino_t and dev_t information.
enum  SourceType { Unknown, LocalHeader, InternalHeader }
 Internallly used source type defenitions.

Private Member Functions

void scan (std::vector< std::string > *local, std::vector< std::string > *global, std::vector< std::string > *ignore=0)
 Fills the two vectors up with the local and global includes and fills d_hasMainFunction.

Private Attributes

std::vector< Source * > d_deps
 Local dependencies (direct).
bool d_depsDone
 Have the dependencies been calculated?
bool d_done
 Has this source been parsed?
std::string d_filename
 Filename.
std::set< std::string * > d_globalDeps
 Global dependencies.
bool d_hasMainFunction
 Does this source have a main function.
std::vector< std::string > d_ignored
 Ignored dependencies.
InodeDevPair d_inoDev
 File ino dev pair.
time_t d_modTime
 File modtime.
SourceType d_srcType
 The type of this source.
unsigned char d_update
 Do we need an update? 0=unknown, 1=true, 2=false;.

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

Generated by  Doxygen 1.6.0   Back to index