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.

80 lines
1.9 KiB

  1. #ifndef __DAVPARSE_H_
  2. #define __DAVPARSE_H_
  3. #include "davprops.h"
  4. #define DAV_STR_LEN(name) \
  5. c_szwDAV##name, ulDAV##name##Len
  6. typedef struct tagHMDICTINFO
  7. {
  8. DWORD dwNamespaceID;
  9. const char* pszName;
  10. } HMDICTINFO, *LPHMDICTINFO;
  11. EXTERN_C const HMDICTINFO rgHTTPMailDictionary[];
  12. class CXMLNamespace
  13. {
  14. public:
  15. CXMLNamespace(CXMLNamespace *pParent = NULL);
  16. ULONG AddRef(void);
  17. ULONG Release(void);
  18. private:
  19. ~CXMLNamespace(void);
  20. // unimplemented
  21. CXMLNamespace(const CXMLNamespace& other);
  22. CXMLNamespace& operator=(const CXMLNamespace& other);
  23. public:
  24. HRESULT Init(
  25. const WCHAR *pwcNamespace,
  26. ULONG ulNsLen,
  27. const WCHAR* pwcPrefix,
  28. ULONG ulPrefix);
  29. HRESULT SetNamespace(const WCHAR *pwcNamespace, ULONG ulNsLen);
  30. HRESULT SetPrefix(const WCHAR *pwcPrefix, ULONG ulPrefix);
  31. DWORD MapPrefix(
  32. const WCHAR *pwcPrefix,
  33. ULONG ulPrefixLen)
  34. {
  35. return _MapPrefix(pwcPrefix, ulPrefixLen);
  36. }
  37. void SetParent(CXMLNamespace* pParent)
  38. {
  39. SafeRelease(m_pParent);
  40. m_pParent = pParent;
  41. if (m_pParent)
  42. m_pParent->AddRef();
  43. }
  44. CXMLNamespace* GetParent(void)
  45. {
  46. if (m_pParent)
  47. m_pParent->AddRef();
  48. return m_pParent;
  49. }
  50. private:
  51. DWORD _MapPrefix(const WCHAR *pwcPrefix, ULONG ulPrefixLen, BOOL *pbFoundDefault = NULL);
  52. private:
  53. ULONG m_cRef;
  54. CXMLNamespace *m_pParent;
  55. WCHAR *m_pwcPrefix;
  56. ULONG m_ulPrefixLen;
  57. DWORD m_dwNsID;
  58. };
  59. HMELE XMLElementToID(
  60. const WCHAR *pwcText,
  61. ULONG ulLen,
  62. ULONG ulNamespaceLen,
  63. CXMLNamespace *pNamespace);
  64. #endif // __DAVPARSE_H_