diff options
author | Alexander Neundorf <neundorf@kde.org> | 2007-08-23 20:13:15 (GMT) |
---|---|---|
committer | Alexander Neundorf <neundorf@kde.org> | 2007-08-23 20:13:15 (GMT) |
commit | 2120ce4fcd935d74442ad7f63c06c52287665f35 (patch) | |
tree | 6af954fa1a613f3d3d3b42f7f5789f99ba7f4ab8 /Source/cmCommandArgumentsHelper.cxx | |
parent | c6e937ca53c83de904aa1903481d3ddc88df381c (diff) | |
download | CMake-2120ce4fcd935d74442ad7f63c06c52287665f35.zip CMake-2120ce4fcd935d74442ad7f63c06c52287665f35.tar.gz CMake-2120ce4fcd935d74442ad7f63c06c52287665f35.tar.bz2 |
ENH: add support for a default value, fix case when there is no item except
the own group
Alex
Diffstat (limited to 'Source/cmCommandArgumentsHelper.cxx')
-rw-r--r-- | Source/cmCommandArgumentsHelper.cxx | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/Source/cmCommandArgumentsHelper.cxx b/Source/cmCommandArgumentsHelper.cxx index 3fb5642..2c311e1 100644 --- a/Source/cmCommandArgumentsHelper.cxx +++ b/Source/cmCommandArgumentsHelper.cxx @@ -23,6 +23,7 @@ cmCommandArgument::cmCommandArgument(cmCommandArgumentsHelper* args, :Key(key) ,Group(group) ,WasActive(false) +,ArgumentsBeforeEmpty(true) ,CurrentIndex(0) { if (args!=0) @@ -45,6 +46,7 @@ void cmCommandArgument::Reset() void cmCommandArgument::Follows(const cmCommandArgument* arg) { + this->ArgumentsBeforeEmpty = false; this->ArgumentsBefore.insert(arg); } @@ -52,6 +54,7 @@ void cmCommandArgument::FollowsGroup(const cmCommandArgumentGroup* group) { if (group!=0) { + this->ArgumentsBeforeEmpty = false; for(std::vector<cmCommandArgument*>::const_iterator argIt= group->ContainedArguments.begin(); argIt != group->ContainedArguments.end(); @@ -64,7 +67,7 @@ void cmCommandArgument::FollowsGroup(const cmCommandArgumentGroup* group) bool cmCommandArgument::MayFollow(const cmCommandArgument* current) const { - if (this->ArgumentsBefore.empty()) + if (this->ArgumentsBeforeEmpty) { return true; } @@ -180,7 +183,7 @@ bool cmCAString::DoConsume(const std::string& arg, unsigned int index) void cmCAString::DoReset() { - this->String = ""; + this->String = this->DefaultString; } cmCAEnabler::cmCAEnabler(cmCommandArgumentsHelper* args, |