|
@@ -174,7 +174,8 @@ void cmLoadCacheCommand::CheckLine(const char* line)
|
|
|
// Check one line of the cache file.
|
|
// Check one line of the cache file.
|
|
|
std::string var;
|
|
std::string var;
|
|
|
std::string value;
|
|
std::string value;
|
|
|
- if(this->ParseEntry(line, var, value))
|
|
|
|
|
|
|
+ cmCacheManager::CacheEntryType type = cmCacheManager::UNINITIALIZED;
|
|
|
|
|
+ if(cmCacheManager::ParseEntry(line, var, value, type))
|
|
|
{
|
|
{
|
|
|
// Found a real entry. See if this one was requested.
|
|
// Found a real entry. See if this one was requested.
|
|
|
if(this->VariablesToRead.find(var) != this->VariablesToRead.end())
|
|
if(this->VariablesToRead.find(var) != this->VariablesToRead.end())
|
|
@@ -193,38 +194,3 @@ void cmLoadCacheCommand::CheckLine(const char* line)
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
-//----------------------------------------------------------------------------
|
|
|
|
|
-bool cmLoadCacheCommand::ParseEntry(const char* entry, std::string& var,
|
|
|
|
|
- std::string& value)
|
|
|
|
|
-{
|
|
|
|
|
- // input line is: key:type=value
|
|
|
|
|
- cmsys::RegularExpression reg("^([^:]*):([^=]*)=(.*[^\t ]|[\t ]*)[\t ]*$");
|
|
|
|
|
- // input line is: "key":type=value
|
|
|
|
|
- cmsys::RegularExpression
|
|
|
|
|
- regQuoted("^\"([^\"]*)\":([^=]*)=(.*[^\t ]|[\t ]*)[\t ]*$");
|
|
|
|
|
- bool flag = false;
|
|
|
|
|
- if(regQuoted.find(entry))
|
|
|
|
|
- {
|
|
|
|
|
- var = regQuoted.match(1);
|
|
|
|
|
- value = regQuoted.match(3);
|
|
|
|
|
- flag = true;
|
|
|
|
|
- }
|
|
|
|
|
- else if (reg.find(entry))
|
|
|
|
|
- {
|
|
|
|
|
- var = reg.match(1);
|
|
|
|
|
- value = reg.match(3);
|
|
|
|
|
- flag = true;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- // if value is enclosed in single quotes ('foo') then remove them
|
|
|
|
|
- // it is used to enclose trailing space or tab
|
|
|
|
|
- if (flag &&
|
|
|
|
|
- value.size() >= 2 &&
|
|
|
|
|
- value[0] == '\'' &&
|
|
|
|
|
- value[value.size() - 1] == '\'')
|
|
|
|
|
- {
|
|
|
|
|
- value = value.substr(1, value.size() - 2);
|
|
|
|
|
- }
|
|
|
|
|
- return flag;
|
|
|
|
|
-}
|
|
|