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.

77 lines
1.6 KiB

  1. /*++
  2. Copyright (C) 1996-2001 Microsoft Corporation
  3. Module Name:
  4. UMIParse.H
  5. Abstract:
  6. Declares the object path parser engine.
  7. History:
  8. a-davj 11-feb-00 Created.
  9. --*/
  10. #ifndef _UMIPARSE_H_
  11. #define _UMIPARSE_H_
  12. #include "genlex.h"
  13. #include "opathlex2.h"
  14. #include <wmiutils.h>
  15. //#include "wbemutil.h"
  16. #include "wbemcli.h"
  17. #include "flexarry.h"
  18. // NOTE:
  19. // The m_vValue in the CKeyRef may not be of the expected type, i.e., the parser
  20. // cannot distinguish 16 bit integers from 32 bit integers if they fall within the
  21. // legal subrange of a 16 bit value. Therefore, the parser only uses the following
  22. // types for keys:
  23. // VT_I4, VT_R8, VT_BSTR
  24. // If the underlying type is different, the user of this parser must do appropriate
  25. // type conversion.
  26. //
  27. class CUmiPathParser
  28. {
  29. LPWSTR m_pInitialIdent;
  30. int m_nCurrentToken;
  31. CGenLexer *m_pLexer;
  32. CDefPathParser *m_pOutput;
  33. CKeyRef *m_pTmpKeyRef;
  34. DWORD m_eFlags;
  35. private:
  36. void Zero();
  37. void Empty();
  38. int begin_parse(bool bRelative);
  39. int locator();
  40. int ns_root_selector();
  41. int component_list();
  42. int component_list_rest();
  43. int component();
  44. int def_starts_with_ident(LPWSTR pwsLeadingName, CParsedComponent * pComp);
  45. int guid_path(CParsedComponent * pComp);
  46. int key_list(CParsedComponent * pComp);
  47. int key_list_rest(CParsedComponent * pComp);
  48. int key(CParsedComponent * pComp);
  49. int NextToken();
  50. public:
  51. enum { NoError, SyntaxError, InvalidParameter, NoMemory };
  52. CUmiPathParser(DWORD eFlags);
  53. ~CUmiPathParser();
  54. int Parse(LPCWSTR RawPath, CDefPathParser & Output);
  55. static LPWSTR GetRelativePath(LPWSTR wszFullPath);
  56. };
  57. #endif