cmake/Source/cmInstalledFile.h

77 lines
2.0 KiB
C
Raw Normal View History

2016-10-30 18:24:19 +01:00
/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
file Copyright.txt or https://cmake.org/licensing for details. */
2021-09-14 00:13:48 +02:00
#pragma once
2015-04-27 22:25:09 +02:00
2017-07-20 19:35:53 +02:00
#include "cmConfigure.h" // IWYU pragma: keep
2016-10-30 18:24:19 +01:00
#include <map>
2020-02-01 23:06:01 +01:00
#include <memory>
2016-10-30 18:24:19 +01:00
#include <string>
#include <vector>
2020-02-01 23:06:01 +01:00
class cmCompiledGeneratorExpression;
2016-10-30 18:24:19 +01:00
class cmMakefile;
2015-04-27 22:25:09 +02:00
/** \class cmInstalledFile
* \brief Represents a file intended for installation.
*
* cmInstalledFile represents a file intended for installation.
*/
class cmInstalledFile
{
public:
2020-02-01 23:06:01 +01:00
using CompiledGeneratorExpressionPtrType =
std::unique_ptr<cmCompiledGeneratorExpression>;
2015-04-27 22:25:09 +02:00
2020-08-30 11:54:41 +02:00
using ExpressionVectorType = std::vector<CompiledGeneratorExpressionPtrType>;
2015-04-27 22:25:09 +02:00
struct Property
{
2015-08-17 11:37:30 +02:00
Property();
~Property();
2015-04-27 22:25:09 +02:00
2019-11-11 23:01:05 +01:00
Property(const Property&) = delete;
Property& operator=(const Property&) = delete;
2015-04-27 22:25:09 +02:00
ExpressionVectorType ValueExpressions;
};
2020-02-01 23:06:01 +01:00
using PropertyMapType = std::map<std::string, Property>;
2015-04-27 22:25:09 +02:00
cmInstalledFile();
~cmInstalledFile();
2019-11-11 23:01:05 +01:00
cmInstalledFile(const cmInstalledFile&) = delete;
cmInstalledFile& operator=(const cmInstalledFile&) = delete;
2015-04-27 22:25:09 +02:00
void RemoveProperty(const std::string& prop);
2016-07-09 11:21:54 +02:00
void SetProperty(cmMakefile const* mf, const std::string& prop,
2020-08-30 11:54:41 +02:00
const std::string& value);
2015-04-27 22:25:09 +02:00
2016-07-09 11:21:54 +02:00
void AppendProperty(cmMakefile const* mf, const std::string& prop,
2020-08-30 11:54:41 +02:00
const std::string& value, bool asString = false);
2015-04-27 22:25:09 +02:00
bool HasProperty(const std::string& prop) const;
bool GetProperty(const std::string& prop, std::string& value) const;
bool GetPropertyAsBool(const std::string& prop) const;
2023-07-02 19:51:09 +02:00
std::vector<std::string> GetPropertyAsList(const std::string& prop) const;
2015-04-27 22:25:09 +02:00
void SetName(cmMakefile* mf, const std::string& name);
std::string const& GetName() const;
cmCompiledGeneratorExpression const& GetNameExpression() const;
PropertyMapType const& GetProperties() const { return this->Properties; }
private:
std::string Name;
2020-08-30 11:54:41 +02:00
CompiledGeneratorExpressionPtrType NameExpression;
2015-04-27 22:25:09 +02:00
PropertyMapType Properties;
};