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.

116 lines
2.6 KiB

  1. /*
  2. * X P R S . H
  3. *
  4. * XML push-model parsing
  5. *
  6. * Copyright 1986-1997 Microsoft Corporation, All Rights Reserved
  7. */
  8. #ifndef _XPRS_H_
  9. #define _XPRS_H_
  10. #include <ex\xprs.h>
  11. // class CXMLOut -------------------------------------------------------------
  12. //
  13. // Contstruction of XML text from parsed input
  14. //
  15. class CXMLOut
  16. {
  17. StringBuffer<WCHAR>& m_sb;
  18. BOOL m_fElementNeedsClosing;
  19. UINT m_lDepth;
  20. BOOL m_fAddNamespaceDecl;
  21. VOID CloseElementDecl (
  22. /* [in] */ BOOL fEmptyNode);
  23. // non-implemented
  24. //
  25. CXMLOut(const CXMLOut& p);
  26. CXMLOut& operator=(const CXMLOut& p);
  27. public:
  28. CXMLOut(StringBuffer<WCHAR>& sb)
  29. : m_sb(sb),
  30. m_fElementNeedsClosing(FALSE),
  31. m_fAddNamespaceDecl(FALSE),
  32. m_lDepth(0)
  33. {
  34. }
  35. VOID EndAttributesOut (
  36. /* [in] */ DWORD dwType);
  37. VOID EndChildrenOut (
  38. /* [in] */ BOOL fEmptyNode,
  39. /* [in] */ DWORD dwType,
  40. /* [in] */ const WCHAR __RPC_FAR *pwcText,
  41. /* [in] */ ULONG ulLen);
  42. VOID CreateNodeAttrOut (
  43. /* [in] */ const WCHAR __RPC_FAR *pwszAttr,
  44. /* [in] */ const WCHAR __RPC_FAR *pwcText,
  45. /* [in] */ ULONG ulLen);
  46. VOID CreateNodeOut(
  47. /* [in] */ DWORD dwType,
  48. /* [in] */ BOOL fTerminal,
  49. /* [in] */ const WCHAR __RPC_FAR *pwcText,
  50. /* [in] */ ULONG ulLen);
  51. BOOL FAddNamespaceDecl() const { return m_fAddNamespaceDecl; }
  52. UINT LDepth() const { return m_lDepth; }
  53. // When CompleteAttribute here, we have started processing
  54. // the out node attributes and all cached namespaces have
  55. // been added.
  56. //
  57. VOID CompleteAttribute() {m_fAddNamespaceDecl = TRUE; }
  58. VOID CompleteCreateNode (/* [in] */ DWORD dwType)
  59. {
  60. EndAttributesOut (dwType);
  61. }
  62. SCODE ScCompleteChildren (
  63. /* [in] */ BOOL fEmptyNode,
  64. /* [in] */ DWORD dwType,
  65. /* [in] */ const WCHAR __RPC_FAR *pwcText,
  66. /* [in] */ ULONG ulLen);
  67. SCODE ScHandleNode (
  68. /* [in] */ DWORD dwType,
  69. /* [in] */ DWORD dwSubType,
  70. /* [in] */ BOOL fTerminal,
  71. /* [in] */ const WCHAR __RPC_FAR *pwcText,
  72. /* [in] */ ULONG ulLen,
  73. /* [in] */ ULONG ulNamespaceLen,
  74. /* [in] */ const WCHAR __RPC_FAR *pwcNamespace,
  75. /* [in] */ const ULONG ulNsPrefixLen);
  76. };
  77. // Namespace emitting ----------------------------------------------------
  78. //
  79. class CEmitNmspc : public CNmspcCache::NmspcCache::IOp
  80. {
  81. CXMLOut& m_xo;
  82. // non-implemented
  83. //
  84. CEmitNmspc(const CEmitNmspc& c);
  85. CEmitNmspc& operator=(const CEmitNmspc&);
  86. public:
  87. CEmitNmspc(CXMLOut& xo) :
  88. m_xo(xo)
  89. {
  90. }
  91. virtual BOOL operator()(const CRCWszN&, const auto_ref_ptr<CNmspc>& pns);
  92. };
  93. #endif // _XPRS_H_