cmInstalledFile.h 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  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. /** \class cmInstalledFile
  14. * \brief Represents a file intended for installation.
  15. *
  16. * cmInstalledFile represents a file intended for installation.
  17. */
  18. class cmInstalledFile
  19. {
  20. public:
  21. typedef cmsys::auto_ptr<cmCompiledGeneratorExpression>
  22. CompiledGeneratorExpressionPtrType;
  23. typedef std::vector<cmCompiledGeneratorExpression*>
  24. ExpressionVectorType;
  25. struct Property
  26. {
  27. Property()
  28. {
  29. }
  30. ~Property()
  31. {
  32. for(ExpressionVectorType::iterator i = ValueExpressions.begin();
  33. i != ValueExpressions.end(); ++i)
  34. {
  35. delete *i;
  36. }
  37. }
  38. ExpressionVectorType ValueExpressions;
  39. };
  40. typedef std::map<std::string, Property> PropertyMapType;
  41. cmInstalledFile();
  42. ~cmInstalledFile();
  43. void RemoveProperty(const std::string& prop);
  44. void SetProperty(cmMakefile const* mf,
  45. const std::string& prop, const char *value);
  46. void AppendProperty(cmMakefile const* mf,
  47. const std::string& prop, const char* value,bool asString=false);
  48. bool GetProperty(const std::string& prop, std::string& value) const;
  49. bool GetPropertyAsBool(const std::string& prop) 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