cmCursesForm.cxx 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  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. #include <cmConfigure.h>
  12. cmsys::ofstream cmCursesForm::DebugFile;
  13. bool cmCursesForm::Debug = false;
  14. cmCursesForm::cmCursesForm()
  15. {
  16. this->Form = CM_NULLPTR;
  17. }
  18. cmCursesForm::~cmCursesForm()
  19. {
  20. if (this->Form) {
  21. unpost_form(this->Form);
  22. free_form(this->Form);
  23. this->Form = CM_NULLPTR;
  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. return;
  35. }
  36. cmCursesForm::Debug = false;
  37. cmCursesForm::DebugFile.close();
  38. }
  39. void cmCursesForm::LogMessage(const char* msg)
  40. {
  41. if (!cmCursesForm::Debug) {
  42. return;
  43. }
  44. cmCursesForm::DebugFile << msg << std::endl;
  45. }