cmake/Source/cmInstalledFile.h

82 lines
2.1 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. */
2015-04-27 22:25:09 +02:00
#ifndef cmInstalledFile_h
#define cmInstalledFile_h
2017-07-20 19:35:53 +02:00
#include "cmConfigure.h" // IWYU pragma: keep
2015-04-27 22:25:09 +02:00
#include "cmGeneratorExpression.h"
2016-10-30 18:24:19 +01:00
#include <map>
2018-01-26 17:06:56 +01:00
#include <memory> // IWYU pragma: keep
2016-10-30 18:24:19 +01:00
#include <string>
#include <vector>
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:
2018-01-26 17:06:56 +01:00
typedef std::unique_ptr<cmCompiledGeneratorExpression>
2015-04-27 22:25:09 +02:00
CompiledGeneratorExpressionPtrType;
2016-07-09 11:21:54 +02:00
typedef std::vector<cmCompiledGeneratorExpression*> ExpressionVectorType;
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;
};
typedef std::map<std::string, Property> PropertyMapType;
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,
const char* 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,
const char* 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;
void GetPropertyAsList(const std::string& prop,
2016-07-09 11:21:54 +02:00
std::vector<std::string>& list) 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;
2019-11-11 23:01:05 +01:00
cmCompiledGeneratorExpression* NameExpression = nullptr;
2015-04-27 22:25:09 +02:00
PropertyMapType Properties;
};
#endif