00001 // idep_filedepiter.h 00002 #ifndef INCLUDED_IDEP_FILEDEPITER 00003 #define INCLUDED_IDEP_FILEDEPITER 00004 00005 // This component defines 1 fully insulated iterator class: 00006 // idep_FileDepIter: iterate over the header files included by a file. 00007 00008 00009 class idep_FileDepIter_i; 00010 class idep_FileDepIter { 00011 idep_FileDepIter_i *d_this; 00012 00013 private: 00014 idep_FileDepIter(const idep_FileDepIter&); // not implemented 00015 idep_FileDepIter& operator=(const idep_FileDepIter&); // not implemented 00016 00017 public: 00018 // CREATORS 00019 idep_FileDepIter(const char *fileName); 00020 // Create a compile-time dependency iterator for the specified file. 00021 // The filenames in preprocessor include directives will be presented 00022 // in the order in which they appear in the file. Dependencies that 00023 // are conditionally compiled or commented out with multi-line 00024 // /* ... */ comments will none-the-less be returned by this iterator. 00025 00026 ~idep_FileDepIter(); 00027 00028 // MANIPULATORS 00029 void reset(); 00030 // Return to the first dependency in the file (if one exists). 00031 00032 void operator++(); 00033 // Advance to next dependency in the file. The behavior of this 00034 // function is undefined if the iteration state is invalid. 00035 00036 // ACCESSORS 00037 int isValidFile() const; 00038 // Return non-zero if the specified file is valid/readable; else 0. 00039 00040 operator const void *() const; 00041 // Return non-zero if the current iteration state (i.e., dependency) 00042 // is valid; else 0. Note that this function will correctly return 0 00043 // if the file itself is not valid. 00044 00045 const char *operator()() const; 00046 // Return the name of current file on which this file depends. 00047 // If the iteration state is not valid, 0 is returned. 00048 }; 00049 00050 #endif 00051
1.3.9.1