home *** CD-ROM | disk | FTP | other *** search
/ Chip 1998 February / CHIP_2_98.iso / software / pelne / optionp / iis4_07.cab / state.h < prev    next >
C/C++ Source or Header  |  1997-10-25  |  1KB  |  61 lines

  1. #ifndef __STATE_H__
  2. #define __STATE_H__
  3.  
  4. #include <vector>
  5. #include <stack>
  6.  
  7. #include "Notify.h"
  8. #include "debug.h"
  9.  
  10. // Needed for STL on Visual C++ 5.0
  11. #if _MSC_VER>=1100
  12. using namespace std;
  13. #endif
  14.  
  15.  
  16. enum PARSESTATE {
  17.     INVALID = -1,
  18.     TEXT = 1,
  19.     COMMENT,  // <!-- ... -->
  20.     COMMENT2, // <comment> ... </comment>
  21.     ANCHOR,
  22.     AREA,
  23.     HREF,
  24. };
  25.  
  26.  
  27.  
  28. class CStateStack : public stack< PARSESTATE, vector<PARSESTATE> >
  29. {
  30. public:
  31.     CStateStack()
  32.         : m_fInTag(FALSE),
  33.           m_fInComment(FALSE),
  34.           m_fInComment2(FALSE)
  35.     {
  36.         *m_szSessionID = '\0';
  37.         push(TEXT);
  38.     }
  39.  
  40.     CStateStack(
  41.         LPCTSTR ptszSessionID)
  42.         : m_fInTag(FALSE),
  43.           m_fInComment(FALSE),
  44.           m_fInComment2(FALSE)
  45.     {
  46.         strcpy(m_szSessionID, ptszSessionID);
  47.         push(TEXT);
  48.     }
  49.  
  50.     ~CStateStack()
  51.     {
  52.     }
  53.  
  54.     BOOL    m_fInTag;
  55.     BOOL    m_fInComment;
  56.     BOOL    m_fInComment2;
  57.     CHAR    m_szSessionID[ MAX_SESSION_ID_SIZE ];
  58. };
  59.  
  60. #endif // __STATE_H__
  61.