cmCursesForm.cxx 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  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 = CM_NULLPTR;
  16. }
  17. cmCursesForm::~cmCursesForm()
  18. {
  19. if (this->Form) {
  20. unpost_form(this->Form);
  21. free_form(this->Form);
  22. this->Form = CM_NULLPTR;
  23. }
  24. }
  25. void cmCursesForm::DebugStart()
  26. {
  27. cmCursesForm::Debug = true;
  28. cmCursesForm::DebugFile.open("ccmakelog.txt");
  29. }
  30. void cmCursesForm::DebugEnd()
  31. {
  32. if (!cmCursesForm::Debug) {
  33. return;
  34. }
  35. cmCursesForm::Debug = false;
  36. cmCursesForm::DebugFile.close();
  37. }
  38. void cmCursesForm::LogMessage(const char* msg)
  39. {
  40. if (!cmCursesForm::Debug) {
  41. return;
  42. }
  43. cmCursesForm::DebugFile << msg << std::endl;
  44. }