Coverage Report

Created: 2026-02-09 06:05

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/CMake/Source/cmInstalledFile.h
Line
Count
Source
1
/* Distributed under the OSI-approved BSD 3-Clause License.  See accompanying
2
   file LICENSE.rst 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
#include "cmGeneratorExpression.h"
13
14
class cmMakefile;
15
16
/** \class cmInstalledFile
17
 * \brief Represents a file intended for installation.
18
 *
19
 * cmInstalledFile represents a file intended for installation.
20
 */
21
class cmInstalledFile
22
{
23
public:
24
  using CompiledGeneratorExpressionPtrType =
25
    std::unique_ptr<cmCompiledGeneratorExpression>;
26
27
  using ExpressionVectorType = std::vector<CompiledGeneratorExpressionPtrType>;
28
29
  struct Property
30
  {
31
    Property();
32
    ~Property();
33
34
    Property(Property const&) = delete;
35
    Property& operator=(Property const&) = delete;
36
37
    ExpressionVectorType ValueExpressions;
38
  };
39
40
  using PropertyMapType = std::map<std::string, Property>;
41
42
  cmInstalledFile();
43
44
  ~cmInstalledFile();
45
46
  cmInstalledFile(cmInstalledFile const&) = delete;
47
  cmInstalledFile& operator=(cmInstalledFile const&) = delete;
48
49
  void RemoveProperty(std::string const& prop);
50
51
  void SetProperty(cmMakefile const* mf, std::string const& prop,
52
                   std::string const& value);
53
54
  void AppendProperty(cmMakefile const* mf, std::string const& prop,
55
                      std::string const& value, bool asString = false);
56
57
  bool HasProperty(std::string const& prop) const;
58
59
  bool GetProperty(std::string const& prop, std::string& value) const;
60
61
  bool GetPropertyAsBool(std::string const& prop) const;
62
63
  std::vector<std::string> GetPropertyAsList(std::string const& prop) const;
64
65
  void SetName(cmMakefile* mf, std::string const& name);
66
67
  std::string const& GetName() const;
68
69
  cmCompiledGeneratorExpression const& GetNameExpression() const;
70
71
0
  PropertyMapType const& GetProperties() const { return this->Properties; }
72
73
private:
74
  std::string Name;
75
  CompiledGeneratorExpressionPtrType NameExpression;
76
  PropertyMapType Properties;
77
};