ppNamedScopes.h 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. // Filename: ppNamedScopes.h
  2. // Created by: drose (27Sep00)
  3. //
  4. ////////////////////////////////////////////////////////////////////
  5. #ifndef PPNAMEDSCOPES_H
  6. #define PPNAMEDSCOPES_H
  7. #include "ppremake.h"
  8. #include <map>
  9. #include <vector>
  10. class PPScope;
  11. ///////////////////////////////////////////////////////////////////
  12. // Class : PPNamedScopes
  13. // Description : A collection of named scopes, as defined by #begin
  14. // .. #end sequences within a series of command files,
  15. // each associated with the directory name of the
  16. // command file in which it was read.
  17. ////////////////////////////////////////////////////////////////////
  18. class PPNamedScopes {
  19. public:
  20. PPNamedScopes();
  21. ~PPNamedScopes();
  22. typedef vector<PPScope *> Scopes;
  23. PPScope *make_scope(const string &name);
  24. void get_scopes(const string &name, Scopes &scopes) const;
  25. static void sort_by_dependency(Scopes &scopes);
  26. void set_current(const string &dirname);
  27. private:
  28. typedef map<string, Scopes> Named;
  29. void p_get_scopes(const Named &named, const string &name,
  30. Scopes &scopes) const;
  31. typedef map<string, Named> Directories;
  32. Directories _directories;
  33. string _current;
  34. };
  35. #endif