cmListFileCache.h 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  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 cmListFileFunction
  45. {
  46. std::string Name;
  47. std::vector<cmListFileArgument> Arguments;
  48. std::string FilePath;
  49. long Line;
  50. };
  51. struct cmListFile
  52. {
  53. cmListFile()
  54. :ModifiedTime(0)
  55. {
  56. }
  57. bool ParseFile(const char* path,
  58. bool topLevel,
  59. cmMakefile *mf);
  60. long int ModifiedTime;
  61. std::vector<cmListFileFunction> Functions;
  62. };
  63. #endif