summaryrefslogtreecommitdiffstats
path: root/Source/cmCommandArgumentsHelper.h
diff options
context:
space:
mode:
authorAlexander Neundorf <neundorf@kde.org>2007-08-23 20:13:15 (GMT)
committerAlexander Neundorf <neundorf@kde.org>2007-08-23 20:13:15 (GMT)
commit2120ce4fcd935d74442ad7f63c06c52287665f35 (patch)
tree6af954fa1a613f3d3d3b42f7f5789f99ba7f4ab8 /Source/cmCommandArgumentsHelper.h
parentc6e937ca53c83de904aa1903481d3ddc88df381c (diff)
downloadCMake-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.h')
-rw-r--r--Source/cmCommandArgumentsHelper.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/Source/cmCommandArgumentsHelper.h b/Source/cmCommandArgumentsHelper.h
index 1d7ba61..e22d838 100644
--- a/Source/cmCommandArgumentsHelper.h
+++ b/Source/cmCommandArgumentsHelper.h
@@ -87,6 +87,7 @@ class cmCommandArgument
std::set<const cmCommandArgument*> ArgumentsBefore;
cmCommandArgumentGroup* Group;
bool WasActive;
+ bool ArgumentsBeforeEmpty;
unsigned int CurrentIndex;
virtual bool DoConsume(const std::string& arg, unsigned int index) = 0;
@@ -128,8 +129,12 @@ class cmCAString : public cmCommandArgument
/// Return the string
const std::string& GetString() const {return this->String;}
+ const char* GetCString() const {return this->String.c_str();}
+ void SetDefaultString(const char* text)
+ {this->DefaultString = (text ? text : "");}
private:
std::string String;
+ std::string DefaultString;
unsigned int DataStart;
virtual bool DoConsume(const std::string& arg, unsigned int index);
virtual void DoReset();
@@ -197,7 +202,6 @@ class cmCommandArgumentsHelper
/// Parse the argument list
void Parse(const std::vector<std::string>* args,
std::vector<std::string>* unconsumedArgs);
-
/// Add an argument.
void AddArgument(cmCommandArgument* arg);
private: