From 938ed7710ab15ad13f51bd17243cfe20cf8285eb Mon Sep 17 00:00:00 2001 From: Alexander Neundorf Date: Fri, 24 Aug 2007 14:27:18 -0400 Subject: [PATCH] STYLE: fix MSVC warnings by making the cmCommandArgumentsHelper a member of cmInstallCommandArguments instead of deriving from it Alex --- Source/cmInstallCommand.cxx | 12 ++++++------ Source/cmInstallCommandArguments.cxx | 21 ++++++++++++++------- Source/cmInstallCommandArguments.h | 10 +++++++--- 3 files changed, 27 insertions(+), 16 deletions(-) diff --git a/Source/cmInstallCommand.cxx b/Source/cmInstallCommand.cxx index a27ef3106..c2ed512fd 100644 --- a/Source/cmInstallCommand.cxx +++ b/Source/cmInstallCommand.cxx @@ -176,8 +176,8 @@ bool cmInstallCommand::HandleTargetsMode(std::vector const& args) std::vector 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 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 unknownArgs; @@ -954,9 +954,9 @@ bool cmInstallCommand::HandleExportMode(std::vector 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 91a00ce7b..9cba5bf89 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* args, + std::vector* unconsumedArgs) +{ + this->Parser.Parse(args, unconsumedArgs); +} + + bool cmInstallCommandArguments::CheckPermissions() { this->PermissionsString = ""; diff --git a/Source/cmInstallCommandArguments.h b/Source/cmInstallCommandArguments.h index 936aa460a..2547877ab 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* args, + std::vector* 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;