cmInstalledFile.h 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  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 <map>
  7. #include <memory>
  8. #include <string>
  9. #include <vector>
  10. class cmCompiledGeneratorExpression;
  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. using CompiledGeneratorExpressionPtrType =
  21. std::unique_ptr<cmCompiledGeneratorExpression>;
  22. using ExpressionVectorType = std::vector<cmCompiledGeneratorExpression*>;
  23. struct Property
  24. {
  25. Property();
  26. ~Property();
  27. Property(const Property&) = delete;
  28. Property& operator=(const Property&) = delete;
  29. ExpressionVectorType ValueExpressions;
  30. };
  31. using PropertyMapType = std::map<std::string, Property>;
  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