cmListFileCache.h 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. /*=========================================================================
  2. Program: CMake - Cross-Platform Makefile Generator
  3. Module: $RCSfile$
  4. Language: C++
  5. Date: $Date$
  6. Version: $Revision$
  7. Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved.
  8. See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details.
  9. This software is distributed WITHOUT ANY WARRANTY; without even
  10. the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
  11. PURPOSE. See the above copyright notices for more information.
  12. =========================================================================*/
  13. #ifndef cmListFileCache_h
  14. #define cmListFileCache_h
  15. #include "cmStandardIncludes.h"
  16. /** \class cmListFileCache
  17. * \brief A class to cache list file contents.
  18. *
  19. * cmListFileCache is a class used to cache the contents of parsed
  20. * cmake list files.
  21. */
  22. class cmMakefile;
  23. struct cmListFileArgument
  24. {
  25. cmListFileArgument(): Value(), Quoted(false), FilePath(0), Line(0) {}
  26. cmListFileArgument(const cmListFileArgument& r):
  27. Value(r.Value), Quoted(r.Quoted), FilePath(r.FilePath), Line(r.Line) {}
  28. cmListFileArgument(const std::string& v, bool q, const char* file,
  29. long line): Value(v), Quoted(q),
  30. FilePath(file), Line(line) {}
  31. bool operator == (const cmListFileArgument& r) const
  32. {
  33. return (this->Value == r.Value) && (this->Quoted == r.Quoted);
  34. }
  35. bool operator != (const cmListFileArgument& r) const
  36. {
  37. return !(*this == r);
  38. }
  39. std::string Value;
  40. bool Quoted;
  41. const char* FilePath;
  42. long Line;
  43. };
  44. struct cmListFileContext
  45. {
  46. std::string Name;
  47. std::string FilePath;
  48. long Line;
  49. };
  50. std::ostream& operator<<(std::ostream&, cmListFileContext const&);
  51. struct cmListFileFunction: public cmListFileContext
  52. {
  53. std::vector<cmListFileArgument> Arguments;
  54. };
  55. class cmListFileBacktrace: public std::vector<cmListFileContext> {};
  56. struct cmListFile
  57. {
  58. cmListFile()
  59. :ModifiedTime(0)
  60. {
  61. }
  62. bool ParseFile(const char* path,
  63. bool topLevel,
  64. cmMakefile *mf);
  65. long int ModifiedTime;
  66. std::vector<cmListFileFunction> Functions;
  67. };
  68. #endif