STYLE: fix MSVC warnings by making the cmCommandArgumentsHelper a member of

cmInstallCommandArguments instead of deriving from it

Alex
This commit is contained in:
Alexander Neundorf 2007-08-24 14:27:18 -04:00
parent 9220e97401
commit 938ed7710a
3 changed files with 27 additions and 16 deletions

View File

@ -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);

View File

@ -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 = "";

View File

@ -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;