ppDirectoryTree.h 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  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. class PPNamedScopes;
  10. class PPDirectory;
  11. class PPDependableFile;
  12. ///////////////////////////////////////////////////////////////////
  13. // Class : PPDirectoryTree
  14. // Description : Stores the entire directory hierarchy relationship of the
  15. // source tree. This is the root of a tree of
  16. // PPDirectory objects, each of which corresponds to a
  17. // particular directory.
  18. ////////////////////////////////////////////////////////////////////
  19. class PPDirectoryTree {
  20. public:
  21. PPDirectoryTree();
  22. ~PPDirectoryTree();
  23. bool scan_source(PPNamedScopes *named_scopes);
  24. bool scan_depends(PPNamedScopes *named_scopes);
  25. int count_source_files() const;
  26. PPDirectory *get_root() const;
  27. string get_complete_tree() const;
  28. PPDirectory *find_dirname(const string &dirname) const;
  29. PPDependableFile *find_dependable_file(const string &filename) const;
  30. PPDependableFile *get_dependable_file_by_dirpath(const string &dirpath,
  31. bool is_header);
  32. void read_file_dependencies(const string &cache_filename);
  33. void update_file_dependencies(const string &cache_filename);
  34. private:
  35. PPDirectory *_root;
  36. typedef map<string, PPDirectory *> Dirnames;
  37. Dirnames _dirnames;
  38. typedef map<string, PPDependableFile *> Dependables;
  39. Dependables _dependables;
  40. friend class PPDirectory;
  41. };
  42. #endif