Imported Upstream version 2.8.9
[platform/upstream/cmake.git] / Source / cmInstallCommandArguments.h
1 /*============================================================================
2   CMake - Cross Platform Makefile Generator
3   Copyright 2000-2009 Kitware, Inc., Insight Software Consortium
4
5   Distributed under the OSI-approved BSD License (the "License");
6   see accompanying file Copyright.txt for details.
7
8   This software is distributed WITHOUT ANY WARRANTY; without even the
9   implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
10   See the License for more information.
11 ============================================================================*/
12
13 #ifndef cmInstallCommandArguments_h
14 #define cmInstallCommandArguments_h
15
16 #include "cmStandardIncludes.h"
17 #include "cmCommandArgumentsHelper.h"
18
19 class cmInstallCommandArguments
20 {
21   public:
22     cmInstallCommandArguments(const std::string& defaultComponent);
23     void SetGenericArguments(cmInstallCommandArguments* args)
24                                                {this->GenericArguments = args;}
25     void Parse(const std::vector<std::string>* args,
26                std::vector<std::string>* unconsumedArgs);
27
28     // Compute destination path.and check permissions
29     bool Finalize();
30
31     const std::string& GetDestination() const;
32     const std::string& GetComponent() const;
33     const std::string& GetRename() const;
34     const std::string& GetPermissions() const;
35     const std::vector<std::string>& GetConfigurations() const;
36     bool GetOptional() const;
37     bool GetNamelinkOnly() const;
38     bool GetNamelinkSkip() const;
39
40     // once HandleDirectoryMode() is also switched to using
41     // cmInstallCommandArguments then these two functions can become non-static
42     // private member functions without arguments
43     static bool CheckPermissions(const std::string& onePerm,
44                                  std::string& perm);
45     cmCommandArgumentsHelper Parser;
46     cmCommandArgumentGroup ArgumentGroup;
47   private:
48     cmInstallCommandArguments(); // disabled
49     cmCAString Destination;
50     cmCAString Component;
51     cmCAString Rename;
52     cmCAStringVector Permissions;
53     cmCAStringVector Configurations;
54     cmCAEnabler Optional;
55     cmCAEnabler NamelinkOnly;
56     cmCAEnabler NamelinkSkip;
57
58     std::string DestinationString;
59     std::string PermissionsString;
60
61     cmInstallCommandArguments* GenericArguments;
62     static const char* PermissionsTable[];
63     static const std::string EmptyString;
64     std::string DefaultComponentName;
65     bool CheckPermissions();
66 };
67
68 #endif