cmInstallCommandArguments.h 2.4 KB
Newer Older
1 2 3
/*============================================================================
  CMake - Cross Platform Makefile Generator
  Copyright 2000-2009 Kitware, Inc., Insight Software Consortium
Alexander Neundorf's avatar
 
Alexander Neundorf committed
4

5 6
  Distributed under the OSI-approved BSD License (the "License");
  see accompanying file Copyright.txt for details.
Alexander Neundorf's avatar
 
Alexander Neundorf committed
7

8 9 10 11
  This software is distributed WITHOUT ANY WARRANTY; without even the
  implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  See the License for more information.
============================================================================*/
Alexander Neundorf's avatar
 
Alexander Neundorf committed
12 13 14 15 16 17 18

#ifndef cmInstallCommandArguments_h
#define cmInstallCommandArguments_h

#include "cmStandardIncludes.h"
#include "cmCommandArgumentsHelper.h"

Alexander Neundorf's avatar
 
Alexander Neundorf committed
19
class cmInstallCommandArguments
Alexander Neundorf's avatar
 
Alexander Neundorf committed
20 21
{
  public:
22
    cmInstallCommandArguments(const std::string& defaultComponent);
23
    void SetGenericArguments(cmInstallCommandArguments* args)
Alexander Neundorf's avatar
 
Alexander Neundorf committed
24
                                               {this->GenericArguments = args;}
25
    void Parse(const std::vector<std::string>* args,
Alexander Neundorf's avatar
 
Alexander Neundorf committed
26 27 28
               std::vector<std::string>* unconsumedArgs);

    // Compute destination path.and check permissions
Alexander Neundorf's avatar
 
Alexander Neundorf committed
29 30 31 32 33 34 35 36
    bool Finalize();

    const std::string& GetDestination() const;
    const std::string& GetComponent() const;
    const std::string& GetRename() const;
    const std::string& GetPermissions() const;
    const std::vector<std::string>& GetConfigurations() const;
    bool GetOptional() const;
37 38
    bool GetNamelinkOnly() const;
    bool GetNamelinkSkip() const;
Alexander Neundorf's avatar
 
Alexander Neundorf committed
39

40
    // once HandleDirectoryMode() is also switched to using
Alexander Neundorf's avatar
 
Alexander Neundorf committed
41 42
    // cmInstallCommandArguments then these two functions can become non-static
    // private member functions without arguments
43
    static bool CheckPermissions(const std::string& onePerm,
Alexander Neundorf's avatar
 
Alexander Neundorf committed
44
                                 std::string& perm);
Alexander Neundorf's avatar
 
Alexander Neundorf committed
45 46
    cmCommandArgumentsHelper Parser;
    cmCommandArgumentGroup ArgumentGroup;
Alexander Neundorf's avatar
 
Alexander Neundorf committed
47
  private:
48
    cmInstallCommandArguments(); // disabled
Alexander Neundorf's avatar
 
Alexander Neundorf committed
49 50 51 52 53 54
    cmCAString Destination;
    cmCAString Component;
    cmCAString Rename;
    cmCAStringVector Permissions;
    cmCAStringVector Configurations;
    cmCAEnabler Optional;
55 56
    cmCAEnabler NamelinkOnly;
    cmCAEnabler NamelinkSkip;
Alexander Neundorf's avatar
 
Alexander Neundorf committed
57

58
    std::string DestinationString;
Alexander Neundorf's avatar
 
Alexander Neundorf committed
59 60 61 62 63
    std::string PermissionsString;

    cmInstallCommandArguments* GenericArguments;
    static const char* PermissionsTable[];
    static const std::string EmptyString;
Brad King's avatar
Brad King committed
64
    std::string DefaultComponentName;
Alexander Neundorf's avatar
 
Alexander Neundorf committed
65 66 67 68
    bool CheckPermissions();
};

#endif