cmPropertyDefinitionMap.cxx 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. /*=========================================================================
  2. Program: CMake - Cross-Platform Makefile Generator
  3. Module: $RCSfile$
  4. Language: C++
  5. Date: $Date$
  6. Version: $Revision$
  7. Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved.
  8. See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details.
  9. This software is distributed WITHOUT ANY WARRANTY; without even
  10. the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
  11. PURPOSE. See the above copyright notices for more information.
  12. =========================================================================*/
  13. #include "cmPropertyDefinitionMap.h"
  14. #include "cmSystemTools.h"
  15. void cmPropertyDefinitionMap
  16. ::DefineProperty(const char *name, cmProperty::ScopeType scope,
  17. const char *ShortDescription,
  18. const char *FullDescription,
  19. bool chain)
  20. {
  21. if (!name)
  22. {
  23. return;
  24. }
  25. cmPropertyDefinitionMap::iterator it = this->find(name);
  26. cmPropertyDefinition *prop;
  27. if (it == this->end())
  28. {
  29. prop = &(*this)[name];
  30. prop->DefineProperty(name,scope,ShortDescription, FullDescription, chain);
  31. }
  32. }
  33. void cmPropertyDefinitionMap
  34. ::GetPropertiesDocumentation(std::vector<cmDocumentationEntry>& v) const
  35. {
  36. for(cmPropertyDefinitionMap::const_iterator j = this->begin();
  37. j != this->end(); ++j)
  38. {
  39. cmDocumentationEntry e = j->second.GetDocumentation();
  40. if (e.brief)
  41. {
  42. v.push_back(e);
  43. }
  44. }
  45. }
  46. bool cmPropertyDefinitionMap::IsPropertyDefined(const char *name)
  47. {
  48. if (!name)
  49. {
  50. return false;
  51. }
  52. cmPropertyDefinitionMap::iterator it = this->find(name);
  53. if (it == this->end())
  54. {
  55. return false;
  56. }
  57. return true;
  58. }
  59. bool cmPropertyDefinitionMap::IsPropertyChained(const char *name)
  60. {
  61. if (!name)
  62. {
  63. return false;
  64. }
  65. cmPropertyDefinitionMap::iterator it = this->find(name);
  66. if (it == this->end())
  67. {
  68. return false;
  69. }
  70. return it->second.IsChained();
  71. }