summaryrefslogtreecommitdiffstats
path: root/Source/cmListFileCache.h
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2004-08-04 14:45:11 (GMT)
committerBrad King <brad.king@kitware.com>2004-08-04 14:45:11 (GMT)
commitb6da1d127196d82c58a3780432e9466b459d8543 (patch)
tree17a8359a57d7c1de7434c9f836d8e2eace470ca3 /Source/cmListFileCache.h
parent743eed068cbd81747cac0184e7c4a43ce8aab8c3 (diff)
downloadCMake-b6da1d127196d82c58a3780432e9466b459d8543.zip
CMake-b6da1d127196d82c58a3780432e9466b459d8543.tar.gz
CMake-b6da1d127196d82c58a3780432e9466b459d8543.tar.bz2
ENH: Added support for special variables CMAKE_CURRENT_LIST_FILE and CMAKE_CURRENT_LIST_LINE that evaluate to the file name and line number in which they appear. This implements the feature request from bug 1012.
Diffstat (limited to 'Source/cmListFileCache.h')
-rw-r--r--Source/cmListFileCache.h19
1 files changed, 15 insertions, 4 deletions
diff --git a/Source/cmListFileCache.h b/Source/cmListFileCache.h
index 8dc371f..17239d2 100644
--- a/Source/cmListFileCache.h
+++ b/Source/cmListFileCache.h
@@ -28,9 +28,12 @@
struct cmListFileArgument
{
- cmListFileArgument(): Value(), Quoted(false) {}
- cmListFileArgument(const cmListFileArgument& r): Value(r.Value), Quoted(r.Quoted) {}
- cmListFileArgument(const std::string& v, bool q): Value(v), Quoted(q) {}
+ cmListFileArgument(): Value(), Quoted(false), FilePath(0), Line(0) {}
+ cmListFileArgument(const cmListFileArgument& r):
+ Value(r.Value), Quoted(r.Quoted), FilePath(r.FilePath), Line(r.Line) {}
+ cmListFileArgument(const std::string& v, bool q, const char* file,
+ long line): Value(v), Quoted(q),
+ FilePath(file), Line(line) {}
bool operator == (const cmListFileArgument& r) const
{
return (this->Value == r.Value) && (this->Quoted == r.Quoted);
@@ -41,13 +44,15 @@ struct cmListFileArgument
}
std::string Value;
bool Quoted;
+ const char* FilePath;
+ long Line;
};
struct cmListFileFunction
{
std::string m_Name;
std::vector<cmListFileArgument> m_Arguments;
- std::string m_FilePath;
+ const char* m_FilePath;
long m_Line;
};
@@ -80,12 +85,18 @@ public:
//! Flush cache file out of cache.
void FlushCache(const char* path);
+ ~cmListFileCache();
private:
// Cache the file
bool CacheFile(const char* path, bool requireProjectCommand);
// private data
typedef std::map<cmStdString, cmListFile> ListFileMap;
ListFileMap m_ListFileCache; // file name to ListFile map
+
+ typedef std::map<cmStdString, char*> UniqueStrings;
+ UniqueStrings m_UniqueStrings;
+ const char* GetUniqueStringPointer(const char* name);
+
static cmListFileCache* Instance; // singelton pointer
};