summaryrefslogtreecommitdiffstats
path: root/Source/kwsys
diff options
context:
space:
mode:
authorAndy Cedilnik <andy.cedilnik@kitware.com>2005-12-10 17:10:09 (GMT)
committerAndy Cedilnik <andy.cedilnik@kitware.com>2005-12-10 17:10:09 (GMT)
commit5e56c7c201a60a8a63b4a5c3ba8c622bcf1a55ab (patch)
treef41472417d375f6d2fa52c0f6826247c70f074c5 /Source/kwsys
parent5999a81bcdd22f206255fa209e2c211bce88555b (diff)
downloadCMake-5e56c7c201a60a8a63b4a5c3ba8c622bcf1a55ab.zip
CMake-5e56c7c201a60a8a63b4a5c3ba8c622bcf1a55ab.tar.gz
CMake-5e56c7c201a60a8a63b4a5c3ba8c622bcf1a55ab.tar.bz2
ENH: Add a method to remove remaining arguments
Diffstat (limited to 'Source/kwsys')
-rw-r--r--Source/kwsys/CommandLineArguments.cxx11
-rw-r--r--Source/kwsys/CommandLineArguments.hxx.in1
2 files changed, 12 insertions, 0 deletions
diff --git a/Source/kwsys/CommandLineArguments.cxx b/Source/kwsys/CommandLineArguments.cxx
index e0d0edc..b84c9b7 100644
--- a/Source/kwsys/CommandLineArguments.cxx
+++ b/Source/kwsys/CommandLineArguments.cxx
@@ -359,6 +359,17 @@ void CommandLineArguments::GetRemainingArguments(int* argc, char*** argv)
}
//----------------------------------------------------------------------------
+void CommandLineArguments::DeleteRemainingArguments(int argc, char*** argv)
+{
+ int cc;
+ for ( cc = 0; cc < argc; ++ cc )
+ {
+ delete [] *argv[cc];
+ }
+ delete [] *argv;
+}
+
+//----------------------------------------------------------------------------
void CommandLineArguments::AddCallback(const char* argument, ArgumentTypeEnum type,
CallbackType callback, void* call_data, const char* help)
{
diff --git a/Source/kwsys/CommandLineArguments.hxx.in b/Source/kwsys/CommandLineArguments.hxx.in
index 8d286fa..eea51eb 100644
--- a/Source/kwsys/CommandLineArguments.hxx.in
+++ b/Source/kwsys/CommandLineArguments.hxx.in
@@ -170,6 +170,7 @@ public:
* delete[] on it.
*/
void GetRemainingArguments(int* argc, char*** argv);
+ void DeleteRemainingArguments(int argc, char*** argv);
/**
* Return string containing help. If the argument is specified, only return