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