ppDirectoryTree.h 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. // Filename: ppDirectoryTree.h
  2. // Created by: drose (15Oct00)
  3. //
  4. ////////////////////////////////////////////////////////////////////
  5. #ifndef PPDIRECTORYTREE_H
  6. #define PPDIRECTORYTREE_H
  7. #include "ppremake.h"
  8. #include <map>
  9. #include <vector>
  10. class PPNamedScopes;
  11. class PPDirectory;
  12. class PPDependableFile;
  13. ///////////////////////////////////////////////////////////////////
  14. // Class : PPDirectoryTree
  15. // Description : Stores the entire directory hierarchy relationship of the
  16. // source tree. This is the root of a tree of
  17. // PPDirectory objects, each of which corresponds to a
  18. // particular directory.
  19. ////////////////////////////////////////////////////////////////////
  20. class PPDirectoryTree {
  21. public:
  22. PPDirectoryTree(PPDirectoryTree *main_tree = NULL);
  23. ~PPDirectoryTree();
  24. PPDirectoryTree *get_main_tree();
  25. void set_fullpath(const string &fullpath);
  26. bool scan_source(PPNamedScopes *named_scopes);
  27. bool scan_depends(PPNamedScopes *named_scopes);
  28. bool scan_extra_depends(const string &dependable_header_dirs,
  29. const string &cache_filename);
  30. int count_source_files() const;
  31. PPDirectory *get_root() const;
  32. const string &get_fullpath() const;
  33. string get_complete_tree() const;
  34. PPDirectory *find_dirname(const string &dirname) const;
  35. PPDependableFile *find_dependable_file(const string &filename) const;
  36. PPDependableFile *get_dependable_file_by_dirpath(const string &dirpath,
  37. bool is_header);
  38. void read_file_dependencies(const string &cache_filename);
  39. void update_file_dependencies(const string &cache_filename);
  40. private:
  41. PPDirectoryTree *_main_tree;
  42. PPDirectory *_root;
  43. string _fullpath;
  44. typedef map<string, PPDirectory *> Dirnames;
  45. Dirnames _dirnames;
  46. typedef map<string, PPDependableFile *> Dependables;
  47. Dependables _dependables;
  48. typedef vector<PPDirectoryTree *> RelatedTrees;
  49. RelatedTrees _related_trees;
  50. friend class PPDirectory;
  51. };
  52. #endif