cmInstalledFile.h 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  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. Property(const Property&) = delete;
  28. Property& operator=(const Property&) = delete;
  29. ExpressionVectorType ValueExpressions;
  30. };
  31. typedef std::map<std::string, Property> PropertyMapType;
  32. cmInstalledFile();
  33. ~cmInstalledFile();
  34. cmInstalledFile(const cmInstalledFile&) = delete;
  35. cmInstalledFile& operator=(const cmInstalledFile&) = delete;
  36. void RemoveProperty(const std::string& prop);
  37. void SetProperty(cmMakefile const* mf, const std::string& prop,
  38. const char* value);
  39. void AppendProperty(cmMakefile const* mf, const std::string& prop,
  40. const char* value, bool asString = false);
  41. bool HasProperty(const std::string& prop) const;
  42. bool GetProperty(const std::string& prop, std::string& value) const;
  43. bool GetPropertyAsBool(const std::string& prop) const;
  44. void GetPropertyAsList(const std::string& prop,
  45. std::vector<std::string>& list) const;
  46. void SetName(cmMakefile* mf, const std::string& name);
  47. std::string const& GetName() const;
  48. cmCompiledGeneratorExpression const& GetNameExpression() const;
  49. PropertyMapType const& GetProperties() const { return this->Properties; }
  50. private:
  51. std::string Name;
  52. cmCompiledGeneratorExpression* NameExpression = nullptr;
  53. PropertyMapType Properties;
  54. };
  55. #endif