cmInstalledFile.h 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. /*============================================================================
  2. CMake - Cross Platform Makefile Generator
  3. Copyright 2014 Kitware, Inc., Insight Software Consortium
  4. Distributed under the OSI-approved BSD License (the "License");
  5. see accompanying file Copyright.txt for details.
  6. This software is distributed WITHOUT ANY WARRANTY; without even the
  7. implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  8. See the License for more information.
  9. ============================================================================*/
  10. #ifndef cmInstalledFile_h
  11. #define cmInstalledFile_h
  12. #include "cmGeneratorExpression.h"
  13. #include "cmAlgorithms.h"
  14. /** \class cmInstalledFile
  15. * \brief Represents a file intended for installation.
  16. *
  17. * cmInstalledFile represents a file intended for installation.
  18. */
  19. class cmInstalledFile
  20. {
  21. public:
  22. typedef cmsys::auto_ptr<cmCompiledGeneratorExpression>
  23. CompiledGeneratorExpressionPtrType;
  24. typedef std::vector<cmCompiledGeneratorExpression*>
  25. ExpressionVectorType;
  26. struct Property
  27. {
  28. Property()
  29. {
  30. }
  31. ~Property()
  32. {
  33. cmDeleteAll(this->ValueExpressions);
  34. }
  35. ExpressionVectorType ValueExpressions;
  36. };
  37. typedef std::map<std::string, Property> PropertyMapType;
  38. cmInstalledFile();
  39. ~cmInstalledFile();
  40. void RemoveProperty(const std::string& prop);
  41. void SetProperty(cmMakefile const* mf,
  42. const std::string& prop, const char *value);
  43. void AppendProperty(cmMakefile const* mf,
  44. const std::string& prop, const char* value,bool asString=false);
  45. bool HasProperty(const std::string& prop) const;
  46. bool GetProperty(const std::string& prop, std::string& value) const;
  47. bool GetPropertyAsBool(const std::string& prop) const;
  48. void GetPropertyAsList(const std::string& prop,
  49. std::vector<std::string>& list) const;
  50. void SetName(cmMakefile* mf, const std::string& name);
  51. std::string const& GetName() const;
  52. cmCompiledGeneratorExpression const& GetNameExpression() const;
  53. PropertyMapType const& GetProperties() const { return this->Properties; }
  54. private:
  55. std::string Name;
  56. cmCompiledGeneratorExpression* NameExpression;
  57. PropertyMapType Properties;
  58. };
  59. #endif