Leaked source code of windows server 2003
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.

99 lines
2.2 KiB

  1. /*++
  2. Copyright (C) 1996-2001 Microsoft Corporation
  3. Module Name:
  4. ActualParse.H
  5. Abstract:
  6. Declares the object path parser engine.
  7. History:
  8. a-davj 11-feb-00 Created.
  9. --*/
  10. #ifndef _ACTUALPARSE_H_
  11. #define _ACTUALPARSE_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 CActualPathParser
  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();
  39. int ns_or_server();
  40. int ns_or_class();
  41. int optional_scope_class_list();
  42. int objref();
  43. int ns_list();
  44. int ident_becomes_ns();
  45. int ident_becomes_class();
  46. int objref_rest();
  47. int ns_list_rest();
  48. int key_const();
  49. int keyref_list();
  50. int keyref();
  51. int keyref_term();
  52. int propname();
  53. int optional_objref();
  54. int NextToken();
  55. public:
  56. enum { NoError, SyntaxError, InvalidParameter, NoMemory };
  57. friend class AutoClear;
  58. CActualPathParser(DWORD eFlags);
  59. ~CActualPathParser();
  60. int Parse(LPCWSTR RawPath, CDefPathParser & Output);
  61. static LPWSTR GetRelativePath(LPWSTR wszFullPath);
  62. };
  63. class AutoClear
  64. {
  65. private:
  66. CActualPathParser * m_pToBeCleared;
  67. public:
  68. AutoClear(CActualPathParser * pToBeCleared){m_pToBeCleared = pToBeCleared;};
  69. ~AutoClear()
  70. {
  71. if(m_pToBeCleared)
  72. {
  73. m_pToBeCleared->Empty();
  74. m_pToBeCleared->Zero();
  75. }
  76. };
  77. };
  78. #endif