summaryrefslogtreecommitdiffstats
path: root/Source/cmFileInstaller.h
diff options
context:
space:
mode:
authorBryon Bean <bryon.bean@kitware.com>2019-03-13 15:51:12 (GMT)
committerBrad King <brad.king@kitware.com>2019-03-13 18:06:32 (GMT)
commite2e8f6b132967844a8bafc866d6cb5c90342af08 (patch)
tree1535349b1d7539c9a307469d7dbeaf4ab2cde2e1 /Source/cmFileInstaller.h
parent80b761b9244d5ab9047082be40ebeee256be95ef (diff)
downloadCMake-e2e8f6b132967844a8bafc866d6cb5c90342af08.zip
CMake-e2e8f6b132967844a8bafc866d6cb5c90342af08.tar.gz
CMake-e2e8f6b132967844a8bafc866d6cb5c90342af08.tar.bz2
cmFileCommand: Factor out cmFileCopier and cmFileInstaller
Split these classes out into their own sources.
Diffstat (limited to 'Source/cmFileInstaller.h')
-rw-r--r--Source/cmFileInstaller.h55
1 files changed, 55 insertions, 0 deletions
diff --git a/Source/cmFileInstaller.h b/Source/cmFileInstaller.h
new file mode 100644
index 0000000..312529a
--- /dev/null
+++ b/Source/cmFileInstaller.h
@@ -0,0 +1,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