1 /*============================================================================
2 CMake - Cross Platform Makefile Generator
3 Copyright 2000-2009 Kitware, Inc., Insight Software Consortium
5 Distributed under the OSI-approved BSD License (the "License");
6 see accompanying file Copyright.txt for details.
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 cmListFileCache_h
13 #define cmListFileCache_h
15 #include "cmStandardIncludes.h"
17 /** \class cmListFileCache
18 * \brief A class to cache list file contents.
20 * cmListFileCache is a class used to cache the contents of parsed
26 struct cmListFileArgument
33 cmListFileArgument(): Value(), Delim(Unquoted), FilePath(0), Line(0) {}
34 cmListFileArgument(const cmListFileArgument& r):
35 Value(r.Value), Delim(r.Delim), FilePath(r.FilePath), Line(r.Line) {}
36 cmListFileArgument(const std::string& v, Delimiter d, const char* file,
37 long line): Value(v), Delim(d),
38 FilePath(file), Line(line) {}
39 bool operator == (const cmListFileArgument& r) const
41 return (this->Value == r.Value) && (this->Delim == r.Delim);
43 bool operator != (const cmListFileArgument& r) const
53 struct cmListFileContext
58 cmListFileContext(): Name(), FilePath(), Line(0) {}
61 std::ostream& operator<<(std::ostream&, cmListFileContext const&);
63 struct cmListFileFunction: public cmListFileContext
65 std::vector<cmListFileArgument> Arguments;
68 class cmListFileBacktrace: public std::vector<cmListFileContext> {};
76 bool ParseFile(const char* path,
80 long int ModifiedTime;
81 std::vector<cmListFileFunction> Functions;
84 struct cmValueWithOrigin {
85 cmValueWithOrigin(const std::string &value,
86 const cmListFileBacktrace &bt)
87 : Value(value), Backtrace(bt)
90 cmListFileBacktrace Backtrace;