cmCursesForm.cxx 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. /*=========================================================================
  2. Program: Insight Segmentation & Registration Toolkit
  3. Module: $RCSfile$
  4. Language: C++
  5. Date: $Date$
  6. Version: $Revision$
  7. Copyright (c) 2002 Insight Consortium. All rights reserved.
  8. See ITKCopyright.txt or http://www.itk.org/HTML/Copyright.htm 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 "cmCursesForm.h"
  14. std::ofstream cmCursesForm::DebugFile;
  15. bool cmCursesForm::Debug = false;
  16. cmCursesForm::cmCursesForm()
  17. {
  18. m_Form = 0;
  19. }
  20. cmCursesForm::~cmCursesForm()
  21. {
  22. if (m_Form)
  23. {
  24. unpost_form(m_Form);
  25. free_form(m_Form);
  26. m_Form = 0;
  27. }
  28. }
  29. void cmCursesForm::DebugStart()
  30. {
  31. cmCursesForm::Debug = true;
  32. cmCursesForm::DebugFile.open("ccmakelog.txt");
  33. }
  34. void cmCursesForm::DebugEnd()
  35. {
  36. if (!cmCursesForm::Debug)
  37. {
  38. return;
  39. }
  40. cmCursesForm::Debug = false;
  41. cmCursesForm::DebugFile.close();
  42. }
  43. void cmCursesForm::LogMessage(const char* msg)
  44. {
  45. if (!cmCursesForm::Debug)
  46. {
  47. return;
  48. }
  49. cmCursesForm::DebugFile << msg << std::endl;
  50. }