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.

70 lines
1.9 KiB

  1. #if !defined(_FUSION_INC_XMLNS_H_INCLUDED_)
  2. #define _FUSION_INC_XMLNS_H_INCLUDED_
  3. #pragma once
  4. #include <ole2.h>
  5. #include <xmlparser.h>
  6. #include "fusionhash.h"
  7. #include "fusionheap.h"
  8. #include "fusionchartraits.h"
  9. #include "smartptr.h"
  10. class CXMLNamespaceManager
  11. {
  12. public:
  13. CXMLNamespaceManager();
  14. ~CXMLNamespaceManager();
  15. BOOL Initialize();
  16. // To get things to track, call these functions in your IXMLNodeFactory before your own processing.
  17. HRESULT OnCreateNode(IXMLNodeSource *pSource, PVOID pNodeParent, USHORT cNumRecs, XML_NODE_INFO **apNodeInfo);
  18. HRESULT OnBeginChildren(IXMLNodeSource *pSource, XML_NODE_INFO *pNodeInfo);
  19. HRESULT OnEndChildren(IXMLNodeSource *pSource, BOOL fEmpty, XML_NODE_INFO *pNodeInfo);
  20. enum MapFlags
  21. {
  22. eMapFlag_DoNotApplyDefaultNamespace = 0x00000001,
  23. };
  24. HRESULT Map(
  25. DWORD dwMapFlags,
  26. const XML_NODE_INFO *pNodeInfo,
  27. CBaseStringBuffer *pbuffNamespace,
  28. SIZE_T *pcchNamespacePrefix
  29. );
  30. class CNamespacePrefix
  31. {
  32. public:
  33. CNamespacePrefix();
  34. ~CNamespacePrefix();
  35. CNamespacePrefix *m_Previous;
  36. CSmallStringBuffer m_NamespaceURI;
  37. ULONG m_Depth;
  38. private:
  39. CNamespacePrefix(const CNamespacePrefix &);
  40. void operator =(const CNamespacePrefix &);
  41. };
  42. protected:
  43. BOOL InsertOrUpdateIfCallback(
  44. CNamespacePrefix *pPrefixNew,
  45. CNamespacePrefix * const &rpPrefixCurrent,
  46. InsertOrUpdateIfDisposition &Disposition
  47. );
  48. CStringPtrTable<CNamespacePrefix, CUnicodeCharTraits> m_NamespacePrefixes;
  49. ULONG m_CurrentDepth;
  50. CNamespacePrefix *m_DefaultNamespacePrefix;
  51. private:
  52. CXMLNamespaceManager(const CXMLNamespaceManager &r);
  53. void operator =(const CXMLNamespaceManager &r);
  54. };
  55. #endif // !defined(_FUSION_INC_XMLNS_H_INCLUDED_)