Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

74 lines
1.7 KiB

  1. // apgtshtiscan.cpp: implementation of the CAPGTSHTIScanner class.
  2. //
  3. //////////////////////////////////////////////////////////////////////
  4. #include "stdafx.h"
  5. #include "event.h"
  6. #include "apgtshtiscan.h"
  7. #ifdef _DEBUG
  8. #undef THIS_FILE
  9. static char THIS_FILE[]=__FILE__;
  10. #define new DEBUG_NEW
  11. #endif
  12. //////////////////////////////////////////////////////////////////////
  13. // Construction/Destruction
  14. //////////////////////////////////////////////////////////////////////
  15. CAPGTSHTIScanner::CAPGTSHTIScanner(CPhysicalFileReader * pPhysicalFileReader, LPCTSTR szDefaultContents /*= NULL*/)
  16. : CAPGTSHTIReader(pPhysicalFileReader, szDefaultContents)
  17. {
  18. }
  19. CAPGTSHTIScanner::CAPGTSHTIScanner(const CAPGTSHTIReader& htiReader)
  20. : CAPGTSHTIReader(htiReader)
  21. {
  22. }
  23. CAPGTSHTIScanner::~CAPGTSHTIScanner()
  24. {
  25. }
  26. void CAPGTSHTIScanner::Scan(const CHTMLFragments& fragments)
  27. {
  28. LOCKOBJECT();
  29. try
  30. {
  31. m_pFragments = &fragments;
  32. InitializeInterpreted();
  33. ////Interpret(); - NO interpretation here, we are scanning data,
  34. //// which is read from HTI file and not modified
  35. ParseInterpreted();
  36. SetOutputToInterpreted();
  37. }
  38. catch (...)
  39. {
  40. // Catch any other exception thrown.
  41. CBuildSrcFileLinenoStr SrcLoc( __FILE__, __LINE__ );
  42. CEvent::ReportWFEvent( SrcLoc.GetSrcFileLineStr(),
  43. SrcLoc.GetSrcFileLineStr(),
  44. _T(""), _T(""),
  45. EV_GTS_GEN_EXCEPTION );
  46. }
  47. UNLOCKOBJECT();
  48. }
  49. void CAPGTSHTIScanner::ParseInterpreted()
  50. {
  51. for (vector<CString>::iterator i = m_arrInterpreted.begin(); i < m_arrInterpreted.end(); i++)
  52. {
  53. CString command;
  54. if (GetCommand(*i, command))
  55. {
  56. if (command == COMMAND_VALUE)
  57. {
  58. CString variable;
  59. if (GetVariable(*i, variable))
  60. const_cast<CHTMLFragments*>(m_pFragments)->SetValue(variable);
  61. }
  62. }
  63. }
  64. }