summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Neundorf <neundorf@kde.org>2007-08-24 18:27:18 (GMT)
committerAlexander Neundorf <neundorf@kde.org>2007-08-24 18:27:18 (GMT)
commit938ed7710ab15ad13f51bd17243cfe20cf8285eb (patch)
tree4234154b94405fba1de7ed626af9d9fdc4b7a33d
parent9220e974017e34b53ba0650ec45c1a16566b6b88 (diff)
downloadCMake-938ed7710ab15ad13f51bd17243cfe20cf8285eb.zip
CMake-938ed7710ab15ad13f51bd17243cfe20cf8285eb.tar.gz
CMake-938ed7710ab15ad13f51bd17243cfe20cf8285eb.tar.bz2
STYLE: fix MSVC warnings by making the cmCommandArgumentsHelper a member of
cmInstallCommandArguments instead of deriving from it Alex
-rw-r--r--Source/cmInstallCommand.cxx12
-rw-r--r--Source/cmInstallCommandArguments.cxx21
-rw-r--r--Source/cmInstallCommandArguments.h10
3 files changed, 27 insertions, 16 deletions
diff --git a/Source/cmInstallCommand.cxx b/Source/cmInstallCommand.cxx
index a27ef31..c2ed512 100644
--- a/Source/cmInstallCommand.cxx
+++ b/Source/cmInstallCommand.cxx
@@ -176,8 +176,8 @@ bool cmInstallCommand::HandleTargetsMode(std::vector<std::string> const& args)
std::vector<std::string> unknownArgs;
cmInstallCommandArguments genericArgs;
- cmCAStringVector targetList(&genericArgs, "TARGETS");
- cmCAString exports(&genericArgs, "EXPORT", &genericArgs.ArgumentGroup);
+ cmCAStringVector targetList(&genericArgs.Parser, "TARGETS");
+ cmCAString exports(&genericArgs.Parser,"EXPORT", &genericArgs.ArgumentGroup);
targetList.Follows(0);
genericArgs.ArgumentGroup.Follows(&targetList);
genericArgs.Parse(&genericArgVector.GetVector(), &unknownArgs);
@@ -509,7 +509,7 @@ bool cmInstallCommand::HandleFilesMode(std::vector<std::string> const& args)
// This is the FILES mode.
bool programs = (args[0] == "PROGRAMS");
cmInstallCommandArguments ica;
- cmCAStringVector files(&ica, programs ? "PROGRAMS" : "FILES");
+ cmCAStringVector files(&ica.Parser, programs ? "PROGRAMS" : "FILES");
files.Follows(0);
ica.ArgumentGroup.Follows(&files);
std::vector<std::string> unknownArgs;
@@ -954,9 +954,9 @@ bool cmInstallCommand::HandleExportMode(std::vector<std::string> const& args)
{
// This is the EXPORT mode.
cmInstallCommandArguments ica;
- cmCAStringVector exports(&ica, "EXPORT");
- cmCAString prefix(&ica, "PREFIX", &ica.ArgumentGroup);
- cmCAString filename(&ica, "FILENAME", &ica.ArgumentGroup);
+ cmCAStringVector exports(&ica.Parser, "EXPORT");
+ cmCAString prefix(&ica.Parser, "PREFIX", &ica.ArgumentGroup);
+ cmCAString filename(&ica.Parser, "FILENAME", &ica.ArgumentGroup);
exports.Follows(0);
ica.ArgumentGroup.Follows(&exports);
diff --git a/Source/cmInstallCommandArguments.cxx b/Source/cmInstallCommandArguments.cxx
index 91a00ce..9cba5bf 100644
--- a/Source/cmInstallCommandArguments.cxx
+++ b/Source/cmInstallCommandArguments.cxx
@@ -29,14 +29,14 @@ const char* cmInstallCommandArguments::PermissionsTable[] =
const std::string cmInstallCommandArguments::EmptyString;
cmInstallCommandArguments::cmInstallCommandArguments()
-:cmCommandArgumentsHelper()
+:Parser()
,ArgumentGroup()
-,Destination (this, "DESTINATION" , &ArgumentGroup)
-,Component (this, "COMPONENT" , &ArgumentGroup)
-,Rename (this, "RENAME" , &ArgumentGroup)
-,Permissions (this, "PERMISSIONS" , &ArgumentGroup)
-,Configurations(this, "CONFIGURATIONS", &ArgumentGroup)
-,Optional (this, "OPTIONAL" , &ArgumentGroup)
+,Destination (&Parser, "DESTINATION" , &ArgumentGroup)
+,Component (&Parser, "COMPONENT" , &ArgumentGroup)
+,Rename (&Parser, "RENAME" , &ArgumentGroup)
+,Permissions (&Parser, "PERMISSIONS" , &ArgumentGroup)
+,Configurations(&Parser, "CONFIGURATIONS", &ArgumentGroup)
+,Optional (&Parser, "OPTIONAL" , &ArgumentGroup)
,GenericArguments(0)
{
this->Component.SetDefaultString("Unspecified");
@@ -133,6 +133,13 @@ bool cmInstallCommandArguments::Finalize()
return true;
}
+void cmInstallCommandArguments::Parse(const std::vector<std::string>* args,
+ std::vector<std::string>* unconsumedArgs)
+{
+ this->Parser.Parse(args, unconsumedArgs);
+}
+
+
bool cmInstallCommandArguments::CheckPermissions()
{
this->PermissionsString = "";
diff --git a/Source/cmInstallCommandArguments.h b/Source/cmInstallCommandArguments.h
index 936aa46..2547877 100644
--- a/Source/cmInstallCommandArguments.h
+++ b/Source/cmInstallCommandArguments.h
@@ -21,15 +21,17 @@
#include "cmStandardIncludes.h"
#include "cmCommandArgumentsHelper.h"
-class cmInstallCommandArguments : public cmCommandArgumentsHelper
+class cmInstallCommandArguments
{
public:
cmInstallCommandArguments();
void SetGenericArguments(cmInstallCommandArguments* args)
{this->GenericArguments = args;}
- // Compute destination path.
+ void Parse(const std::vector<std::string>* args,
+ std::vector<std::string>* unconsumedArgs);
+
+ // Compute destination path.and check permissions
bool Finalize();
- cmCommandArgumentGroup ArgumentGroup;
const std::string& GetDestination() const;
const std::string& GetComponent() const;
@@ -45,6 +47,8 @@ class cmInstallCommandArguments : public cmCommandArgumentsHelper
std::string& absDest);
static bool CheckPermissions(const std::string& onePerm,
std::string& perm);
+ cmCommandArgumentsHelper Parser;
+ cmCommandArgumentGroup ArgumentGroup;
private:
cmCAString Destination;
cmCAString Component;