cmCursesForm.cxx 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. /*============================================================================
  2. CMake - Cross Platform Makefile Generator
  3. Copyright 2000-2009 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. #include "cmCursesForm.h"
  11. cmsys::ofstream cmCursesForm::DebugFile;
  12. bool cmCursesForm::Debug = false;
  13. cmCursesForm::cmCursesForm()
  14. {
  15. this->Form = 0;
  16. }
  17. cmCursesForm::~cmCursesForm()
  18. {
  19. if (this->Form)
  20. {
  21. unpost_form(this->Form);
  22. free_form(this->Form);
  23. this->Form = 0;
  24. }
  25. }
  26. void cmCursesForm::DebugStart()
  27. {
  28. cmCursesForm::Debug = true;
  29. cmCursesForm::DebugFile.open("ccmakelog.txt");
  30. }
  31. void cmCursesForm::DebugEnd()
  32. {
  33. if (!cmCursesForm::Debug)
  34. {
  35. return;
  36. }
  37. cmCursesForm::Debug = false;
  38. cmCursesForm::DebugFile.close();
  39. }
  40. void cmCursesForm::LogMessage(const char* msg)
  41. {
  42. if (!cmCursesForm::Debug)
  43. {
  44. return;
  45. }
  46. cmCursesForm::DebugFile << msg << std::endl;
  47. }