cmListFileCache.h 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  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. struct cmListFileArgument
  23. {
  24. cmListFileArgument(): Value(), Quoted(false), FilePath(0), Line(0) {}
  25. cmListFileArgument(const cmListFileArgument& r):
  26. Value(r.Value), Quoted(r.Quoted), FilePath(r.FilePath), Line(r.Line) {}
  27. cmListFileArgument(const std::string& v, bool q, const char* file,
  28. long line): Value(v), Quoted(q),
  29. FilePath(file), Line(line) {}
  30. bool operator == (const cmListFileArgument& r) const
  31. {
  32. return (this->Value == r.Value) && (this->Quoted == r.Quoted);
  33. }
  34. bool operator != (const cmListFileArgument& r) const
  35. {
  36. return !(*this == r);
  37. }
  38. std::string Value;
  39. bool Quoted;
  40. const char* FilePath;
  41. long Line;
  42. };
  43. struct cmListFileFunction
  44. {
  45. std::string Name;
  46. std::vector<cmListFileArgument> Arguments;
  47. std::string FilePath;
  48. long Line;
  49. };
  50. struct cmListFile
  51. {
  52. cmListFile()
  53. :ModifiedTime(0)
  54. {
  55. }
  56. bool ParseFile(const char* path, bool requireProjectCommand);
  57. long int ModifiedTime;
  58. std::vector<cmListFileFunction> Functions;
  59. };
  60. #endif