cmProperty.cxx 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  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 "cmProperty.h"
  14. #include "cmSystemTools.h"
  15. void cmProperty::Set(const char *name, const char *value)
  16. {
  17. this->Name = name;
  18. this->Value = value;
  19. this->ValueHasBeenSet = true;
  20. }
  21. void cmProperty::Append(const char *name, const char *value)
  22. {
  23. this->Name = name;
  24. if(!this->Value.empty() && *value)
  25. {
  26. this->Value += ";";
  27. }
  28. this->Value += value;
  29. this->ValueHasBeenSet = true;
  30. }
  31. const char *cmProperty::GetValue() const
  32. {
  33. if (this->ValueHasBeenSet)
  34. {
  35. return this->Value.c_str();
  36. }
  37. return 0;
  38. }