cmCursesForm.cxx 859 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. /* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
  2. file Copyright.txt or https://cmake.org/licensing for details. */
  3. #include "cmCursesForm.h"
  4. cmsys::ofstream cmCursesForm::DebugFile;
  5. bool cmCursesForm::Debug = false;
  6. cmCursesForm::cmCursesForm()
  7. {
  8. this->Form = nullptr;
  9. }
  10. cmCursesForm::~cmCursesForm()
  11. {
  12. if (this->Form) {
  13. unpost_form(this->Form);
  14. free_form(this->Form);
  15. this->Form = nullptr;
  16. }
  17. }
  18. void cmCursesForm::DebugStart()
  19. {
  20. cmCursesForm::Debug = true;
  21. cmCursesForm::DebugFile.open("ccmakelog.txt");
  22. }
  23. void cmCursesForm::DebugEnd()
  24. {
  25. if (!cmCursesForm::Debug) {
  26. return;
  27. }
  28. cmCursesForm::Debug = false;
  29. cmCursesForm::DebugFile.close();
  30. }
  31. void cmCursesForm::LogMessage(const char* msg)
  32. {
  33. if (!cmCursesForm::Debug) {
  34. return;
  35. }
  36. cmCursesForm::DebugFile << msg << std::endl;
  37. }