#include <file.h>
Collaboration diagram for File:
Public Methods | |
File (const char *fname) | |
Initializes all inner structures. More... | |
~File () | |
Deletes paths and next. | |
void | setGraphExcluded (int n, bool state) |
Tells this file that it should be excluded from the graph number n when it's drawn. More... | |
const char* | getFileName (void) |
const char* | getPath (void) |
const char* | getFullName (void) |
File* | getNext () |
int | getExtension (void) |
File* | addNextFile (File *file) |
Adds the File object after itself, unless it is NULL in which case nothing happens. More... | |
void | resolveDependencies (void) |
Parses the source-file (if its .c/.cc/.cpp or .h/.hh/.hpp) and extracts include statements. More... | |
void | print (bool recursive=false) |
Prints the contents of a file object. More... | |
void | tagRebuild (void) |
Tags all files that need be rebuilt. More... | |
void | writeCompilation (FILE *stream, const char *compiler) |
Writes all compilation lines to a stream. More... | |
void | writeLink (FILE *stream, const char *executable, const char *linker, const char *linkerTail) |
Writes the final link directive to a stream. More... | |
bool | writeDot (const char *dotFile) |
Writes a number of dot-graphs. More... | |
Static Public Methods | |
void | addFile (File *file) |
Adds a file to the fileRoot. More... | |
void | printRegistered (void) |
Prints the name of all files registered in the two pointers fileRoot and otherFilesRoot. | |
Private Methods | |
void | noDuplicates (const char *fname) |
Loads all lines in fname and discards lines that exactly like a previously encountered line, leaving only unique lines with no duplicates. More... | |
char* | warpPath (char *incPath) |
void | writeDotNodes (FILE *stream, bool followCPP=false) |
Writes a dot graph of the dependencies. More... | |
void | writeDotCPPs (FILE *stream, File *from) |
Writes a dot graph of the CPP-files dependencies. More... | |
void | writeDotCPPs2 (FILE *stream) |
Writes a dot graph of the dependencies for CPP-files and header files with class definitions in them. More... | |
void | writeDotCPPsubs (FILE *stream, File *from, bool CPPOnly=false) |
Writes a dot graph of the CPP-files dependencies. More... | |
void | getIncludePath (char **paths, int &count) |
Determines the include path needed. More... | |
void | writeObjects (FILE *stream) |
Dumps all rebuilt objects (including path) to a stream. More... | |
bool | isObjFileOld (time_t t) |
Asks recursively, following the header files from the dependencies, if any of them are newer than t. More... | |
bool | isNewer (time_t t) |
File* | addDependency (File *file) |
Adds a File as a dependency. More... | |
int | getStats (void) |
Gets stats about the File, if that isn't possible the return is non-zero. | |
void | disectFilename (void) |
Splits the fullName into path and filename. | |
void | guess (void) |
If the extension is CPP then a File is added as objFile with a faked extension of obj. | |
Private Attributes | |
char* | fullName |
char * | path |
char * | fileName |
char * | dotName |
int | extension |
struct stat | stats |
File* | objFile |
File* | cppFile [MAXDEPEND] |
File* | hFile [MAXDEPEND] |
File* | next |
bool | rebuild |
bool | scanned |
bool | tagged |
bool | compiled |
bool | objected |
bool | included |
bool | dotted |
bool | subDotted |
bool | ageChecked |
bool | excluded [EXCLUDELISTS] |
This list needs to be expanded when implementation of more exclude lists is made. | |
bool | hasClass |
If extension is EXTH and the word class appears in the file and if guess found no EXTCPP-file then the file "has the class". | |
int | hFileCount |
int | cppFileCount |
Static Private Methods | |
const char* | stripPath (const char *incPath) |
void | clearIncluded (void) |
Sets all included flags to false to allow the building of a new include path. More... | |
void | clearAgeChecked (void) |
Sets all ageChecked flags to false to allow a new object file to be checked for rebuild. More... | |
void | clearDotted (void) |
Sets all dotted flags to false to allow the building of new dot output. More... | |
void | clearSubDotted (void) |
Sets all subDotted flags to false to allow the building of new dot output. More... | |
File* | findFile (const char *fname, const char *ext, bool &aCopy) |
Attempts to create a File object from a filename and an extension (the current extension is switched to the supplied). More... | |
File* | getFileNoPath (const char *fname) |
Runs through the linked list starting in fileRoot, searching for the file named fname. More... |
If getFileName returns NULL, then the file doesn't exist.
Basically it is a linked list of File objects, but that is just a practical way of managing them.
Definition at line 53 of file file.h.
|
Initializes all inner structures.
Definition at line 61 of file file.h. Referenced by findFile(). |
|
Deletes paths and next.
|
|
Adds a File as a dependency. If MAXDEPEND is reached the program is halted.
Definition at line 958 of file file.h. Referenced by guess(), and resolveDependencies(). |
|
Adds a file to the fileRoot.
Definition at line 1259 of file file.h. Referenced by Maker::Maker(), Maker::addHeaderFiles(), guess(), and resolveDependencies(). |
|
Adds the File object after itself, unless it is NULL in which case nothing happens. No sorting.
|
|
Sets all ageChecked flags to false to allow a new object file to be checked for rebuild. Recursive along next. Definition at line 1150 of file file.h. Referenced by tagRebuild(). |
|
Sets all dotted flags to false to allow the building of new dot output. Recursive along next. Definition at line 1165 of file file.h. Referenced by writeDot(). |
|
Sets all included flags to false to allow the building of a new include path. Recursive along next. Definition at line 1135 of file file.h. Referenced by writeCompilation(). |
|
Sets all subDotted flags to false to allow the building of new dot output. Recursive along next. Definition at line 1180 of file file.h. Referenced by writeDot(), and writeDotCPPs2(). |
|
Splits the fullName into path and filename.
Definition at line 1028 of file file.h. Referenced by File(). |
|
Attempts to create a File object from a filename and an extension (the current extension is switched to the supplied).
Definition at line 1198 of file file.h. Referenced by guess(), and resolveDependencies(). |
|
Definition at line 178 of file file.h. Referenced by Maker::addHeaderFiles(). |
|
Definition at line 144 of file file.h. Referenced by Maker::addHeaderFiles(), and Maker::generateDotOutput(). |
|
Runs through the linked list starting in fileRoot, searching for the file named fname. Comparing ONLY the fileName NOT the whole name and path!!!
Definition at line 1239 of file file.h. Referenced by findFile(), and resolveDependencies(). |
|
|
|
Determines the include path needed. Recursive.
Definition at line 852 of file file.h. Referenced by writeCompilation(). |
|
Definition at line 169 of file file.h. Referenced by Maker::generateDotOutput(). |
|
|
|
Gets stats about the File, if that isn't possible the return is non-zero.
Definition at line 1020 of file file.h. Referenced by File(). |
|
If the extension is CPP then a File is added as objFile with a faked extension of obj.
Definition at line 1078 of file file.h. Referenced by File(). |
|
Definition at line 946 of file file.h. Referenced by isObjFileOld(). |
|
Asks recursively, following the header files from the dependencies, if any of them are newer than t.
Definition at line 921 of file file.h. Referenced by tagRebuild(). |
|
Loads all lines in fname and discards lines that exactly like a previously encountered line, leaving only unique lines with no duplicates. Those lines are written to the file fname.
Definition at line 528 of file file.h. Referenced by writeDot(). |
|
Prints the contents of a file object.
Definition at line 315 of file file.h. Referenced by printRegistered(). |
|
Prints the name of all files registered in the two pointers fileRoot and otherFilesRoot.
|
|
Parses the source-file (if its .c/.cc/.cpp or .h/.hh/.hpp) and extracts include statements. Standard path includes in brackets are ignored. All include statements after line 128 is ignored. First occurence of the word 'class' on the beginning of a line terminates the parsing of the file. Recursively calls its dependencies and cppFile if any. File objects are sought through the fileRoot. Definition at line 215 of file file.h. Referenced by Maker::resolveDependencies(). |
|
Tells this file that it should be excluded from the graph number n when it's drawn.
Definition at line 132 of file file.h. Referenced by Maker::generateDotOutput(). |
|
Definition at line 630 of file file.h. Referenced by getFileNoPath(). |
|
Tags all files that need be rebuilt. Recursive. Definition at line 342 of file file.h. Referenced by Maker::resolveDependencies(). |
|
Definition at line 584 of file file.h. Referenced by resolveDependencies(). |
|
Writes all compilation lines to a stream. Recursive.
Definition at line 385 of file file.h. Referenced by Maker::generateMakescript(). |
|
Writes a number of dot-graphs.
Definition at line 446 of file file.h. Referenced by Maker::generateDotOutput(). |
|
Writes a dot graph of the CPP-files dependencies. Recursive.
Definition at line 709 of file file.h. Referenced by writeDot(). |
|
Writes a dot graph of the dependencies for CPP-files and header files with class definitions in them. Recursive.
Definition at line 751 of file file.h. Referenced by writeDot(). |
|
Writes a dot graph of the CPP-files dependencies. Recursive.
Definition at line 817 of file file.h. Referenced by writeDotCPPs2(). |
|
Writes a dot graph of the dependencies. Recursive.
Definition at line 651 of file file.h. Referenced by writeDot(). |
|
Writes the final link directive to a stream.
Definition at line 431 of file file.h. Referenced by Maker::generateMakescript(). |
|
Dumps all rebuilt objects (including path) to a stream. Recursive.
Definition at line 892 of file file.h. Referenced by writeLink(). |
|
|
|
|
|
|
|
|
|
|
|
|
|
This list needs to be expanded when implementation of more exclude lists is made.
|
|
|
|
|
|
|
|
|
|
|
|
If extension is EXTH and the word class appears in the file and if guess found no EXTCPP-file then the file "has the class".
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|