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.

79 lines
2.1 KiB

  1. /****************************************************************************
  2. Copyright information : Copyright (c) 1998-1999 Microsoft Corporation
  3. File Name : CmdTokenizer.h
  4. Project Name : WMI Command Line
  5. Author Name : Ch. Sriramachandramurthy
  6. Date of Creation (dd/mm/yy) : 27th-September-2000
  7. Version Number : 1.0
  8. Brief Description : This file consist of class declaration of
  9. class CmdTokenizer
  10. Revision History :
  11. Last Modified By : Ch. Sriramachandramurthy
  12. Last Modified Date : 23th-February-2001
  13. ****************************************************************************/
  14. /*-------------------------------------------------------------------
  15. Class Name : CCmdTokenizer
  16. Class Type : Concrete
  17. Brief Description : This class encapsulates the functionality needed
  18. for tokenizing the command line string passed as
  19. input to the wmic.exe
  20. Super Classes : None
  21. Sub Classes : None
  22. Classes Used : None
  23. Interfaces Used : None
  24. --------------------------------------------------------------------*/
  25. /////////////////////////////////////////////////////////////////////////////
  26. // CCmdTokenizer
  27. class CCmdTokenizer
  28. {
  29. public:
  30. // Construction
  31. CCmdTokenizer();
  32. // Destruction
  33. ~CCmdTokenizer();
  34. // Restrict Assignment
  35. CCmdTokenizer& operator=(CCmdTokenizer& rCmdTknzr);
  36. // Attributes
  37. private:
  38. // command string
  39. _TCHAR* m_pszCommandLine;
  40. // token-offset counter
  41. WMICLIINT m_nTokenOffSet;
  42. // token-start counter
  43. WMICLIINT m_nTokenStart;
  44. // token vector
  45. CHARVECTOR m_cvTokens;
  46. // Escape sequence flag
  47. BOOL m_bEscapeSeq;
  48. // Format switch
  49. BOOL m_bFormatToken;
  50. // Operations
  51. private:
  52. //Extracts token and adds it to the token vector.
  53. _TCHAR* Token();
  54. //Identify the Next token to be extracted by adjusting
  55. //m_nTokenStart and m_nTokenOffset
  56. _TCHAR* NextToken();
  57. public:
  58. // returns the reference to token vector.
  59. CHARVECTOR& GetTokenVector();
  60. // tokenize the command using the pre-defined
  61. // delimiters
  62. BOOL TokenizeCommand(_TCHAR* pszCommandInput);
  63. // Free the member variables
  64. void Uninitialize();
  65. };