cmInstalledFile.h 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. /* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
  2. file Copyright.txt or https://cmake.org/licensing for details. */
  3. #ifndef cmInstalledFile_h
  4. #define cmInstalledFile_h
  5. #include "cmConfigure.h" // IWYU pragma: keep
  6. #include "cmGeneratorExpression.h"
  7. #include <map>
  8. #include <memory> // IWYU pragma: keep
  9. #include <string>
  10. #include <vector>
  11. class cmMakefile;
  12. /** \class cmInstalledFile
  13. * \brief Represents a file intended for installation.
  14. *
  15. * cmInstalledFile represents a file intended for installation.
  16. */
  17. class cmInstalledFile
  18. {
  19. public:
  20. typedef std::unique_ptr<cmCompiledGeneratorExpression>
  21. CompiledGeneratorExpressionPtrType;
  22. typedef std::vector<cmCompiledGeneratorExpression*> ExpressionVectorType;
  23. struct Property
  24. {
  25. Property();
  26. ~Property();
  27. ExpressionVectorType ValueExpressions;
  28. };
  29. typedef std::map<std::string, Property> PropertyMapType;
  30. cmInstalledFile();
  31. ~cmInstalledFile();
  32. void RemoveProperty(const std::string& prop);
  33. void SetProperty(cmMakefile const* mf, const std::string& prop,
  34. const char* value);
  35. void AppendProperty(cmMakefile const* mf, const std::string& prop,
  36. const char* value, bool asString = false);
  37. bool HasProperty(const std::string& prop) const;
  38. bool GetProperty(const std::string& prop, std::string& value) const;
  39. bool GetPropertyAsBool(const std::string& prop) const;
  40. void GetPropertyAsList(const std::string& prop,
  41. std::vector<std::string>& list) const;
  42. void SetName(cmMakefile* mf, const std::string& name);
  43. std::string const& GetName() const;
  44. cmCompiledGeneratorExpression const& GetNameExpression() const;
  45. PropertyMapType const& GetProperties() const { return this->Properties; }
  46. private:
  47. std::string Name;
  48. cmCompiledGeneratorExpression* NameExpression;
  49. PropertyMapType Properties;
  50. };
  51. #endif