summaryrefslogtreecommitdiff
path: root/Source/cmFileInstaller.h
blob: 312529aa849a49446b0e5bdd4095dce2d84f6251 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
/* Distributed under the OSI-approved BSD 3-Clause License.  See accompanying
   file Copyright.txt or https://cmake.org/licensing for details.  */
#ifndef cmFileInstaller_h
#define cmFileInstaller_h

#include "cmConfigure.h" // IWYU pragma: keep

#include "cmFileCopier.h"

#include "cmInstallType.h"

#include <string>
#include <vector>

class cmFileCommand;

struct cmFileInstaller : public cmFileCopier
{
  cmFileInstaller(cmFileCommand* command);
  ~cmFileInstaller() override;

protected:
  cmInstallType InstallType;
  bool Optional;
  bool MessageAlways;
  bool MessageLazy;
  bool MessageNever;
  int DestDirLength;
  std::string Rename;

  std::string Manifest;
  void ManifestAppend(std::string const& file);

  std::string const& ToName(std::string const& fromName) override;

  void ReportCopy(const std::string& toFile, Type type, bool copy) override;
  bool ReportMissing(const std::string& fromFile) override;
  bool Install(const std::string& fromFile,
               const std::string& toFile) override;

  bool Parse(std::vector<std::string> const& args) override;
  enum
  {
    DoingType = DoingLast1,
    DoingRename,
    DoingLast2
  };
  bool CheckKeyword(std::string const& arg) override;
  bool CheckValue(std::string const& arg) override;
  void DefaultFilePermissions() override;
  bool GetTargetTypeFromString(const std::string& stype);
  bool HandleInstallDestination();
};

#endif