cmFileTimeComparison.h 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. /*============================================================================
  2. CMake - Cross Platform Makefile Generator
  3. Copyright 2000-2009 Kitware, Inc., Insight Software Consortium
  4. Distributed under the OSI-approved BSD License (the "License");
  5. see accompanying file Copyright.txt for details.
  6. This software is distributed WITHOUT ANY WARRANTY; without even the
  7. implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  8. See the License for more information.
  9. ============================================================================*/
  10. #ifndef cmFileTimeComparison_h
  11. #define cmFileTimeComparison_h
  12. #include "cmStandardIncludes.h"
  13. class cmFileTimeComparisonInternal;
  14. /** \class cmFileTimeComparison
  15. * \brief Helper class for performing globbing searches.
  16. *
  17. * Finds all files that match a given globbing expression.
  18. */
  19. class cmFileTimeComparison
  20. {
  21. public:
  22. cmFileTimeComparison();
  23. ~cmFileTimeComparison();
  24. /**
  25. * Compare file modification times.
  26. * Return true for successful comparison and false for error.
  27. * When true is returned, result has -1, 0, +1 for
  28. * f1 older, same, or newer than f2.
  29. */
  30. bool FileTimeCompare(const char* f1, const char* f2, int* result);
  31. /**
  32. * Compare file modification times. Return true unless both files
  33. * exist and have modification times less than 1 second apart.
  34. */
  35. bool FileTimesDiffer(const char* f1, const char* f2);
  36. protected:
  37. cmFileTimeComparisonInternal* Internals;
  38. };
  39. #endif