resolve cyclic dependency with zstd
[platform/upstream/cmake.git] / Source / cmInstalledFile.h
1 /* Distributed under the OSI-approved BSD 3-Clause License.  See accompanying
2    file Copyright.txt or https://cmake.org/licensing for details.  */
3 #pragma once
4
5 #include "cmConfigure.h" // IWYU pragma: keep
6
7 #include <map>
8 #include <memory>
9 #include <string>
10 #include <vector>
11
12 class cmCompiledGeneratorExpression;
13 class cmMakefile;
14
15 /** \class cmInstalledFile
16  * \brief Represents a file intended for installation.
17  *
18  * cmInstalledFile represents a file intended for installation.
19  */
20 class cmInstalledFile
21 {
22 public:
23   using CompiledGeneratorExpressionPtrType =
24     std::unique_ptr<cmCompiledGeneratorExpression>;
25
26   using ExpressionVectorType = std::vector<CompiledGeneratorExpressionPtrType>;
27
28   struct Property
29   {
30     Property();
31     ~Property();
32
33     Property(const Property&) = delete;
34     Property& operator=(const Property&) = delete;
35
36     ExpressionVectorType ValueExpressions;
37   };
38
39   using PropertyMapType = std::map<std::string, Property>;
40
41   cmInstalledFile();
42
43   ~cmInstalledFile();
44
45   cmInstalledFile(const cmInstalledFile&) = delete;
46   cmInstalledFile& operator=(const cmInstalledFile&) = delete;
47
48   void RemoveProperty(const std::string& prop);
49
50   void SetProperty(cmMakefile const* mf, const std::string& prop,
51                    const std::string& value);
52
53   void AppendProperty(cmMakefile const* mf, const std::string& prop,
54                       const std::string& value, bool asString = false);
55
56   bool HasProperty(const std::string& prop) const;
57
58   bool GetProperty(const std::string& prop, std::string& value) const;
59
60   bool GetPropertyAsBool(const std::string& prop) const;
61
62   void GetPropertyAsList(const std::string& prop,
63                          std::vector<std::string>& list) const;
64
65   void SetName(cmMakefile* mf, const std::string& name);
66
67   std::string const& GetName() const;
68
69   cmCompiledGeneratorExpression const& GetNameExpression() const;
70
71   PropertyMapType const& GetProperties() const { return this->Properties; }
72
73 private:
74   std::string Name;
75   CompiledGeneratorExpressionPtrType NameExpression;
76   PropertyMapType Properties;
77 };