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.

77 lines
2.2 KiB

  1. /*
  2. * X M L . H
  3. *
  4. * XML Document processing
  5. *
  6. * Copyright 1986-1997 Microsoft Corporation, All Rights Reserved
  7. */
  8. #ifndef _XML_H_
  9. #define _XML_H_
  10. #include <caldbg.h>
  11. #include <ex\refcnt.h>
  12. // Debugging -----------------------------------------------------------------
  13. //
  14. DEFINE_TRACE(Xml);
  15. #define XmlTrace DO_TRACE(Xml)
  16. // Property name escaping/unescaping -----------------------------------------
  17. //
  18. VOID UnescapePropertyName (LPCWSTR wszEscaped, LPWSTR wszProp);
  19. SCODE ScEscapePropertyName (LPCWSTR wszProp, UINT cch, LPWSTR pwszEscaped, UINT* pcch, BOOL fRestrictFirstCharacter);
  20. // Property construction helpers ---------------------------------------------
  21. //
  22. SCODE ScVariantTypeFromString (LPCWSTR pwszType, USHORT& vt);
  23. SCODE ScVariantValueFromString (PROPVARIANT& var, LPCWSTR pwszValue);
  24. enum
  25. {
  26. //$REVIEW: Define an proper body part size. It's used in CXMLBodyPartMgr
  27. //$REVIEW: to control when a body part is to be added to the body part list.
  28. //$REVIEW: Acutally, because it is not predictable how big the next piece is.
  29. //$REVIEW: the max size of xml body part can be (CB_XMLBODYPART_SIZE * 2 - 1)
  30. //$REVIEW: It is also used in ScSetValue to break over-size value into
  31. //$REVIEW: smaller pieces.
  32. //
  33. //$REVIEW: Don't confuse this to the largest chunk size CB_WSABUFS_MAX (8174).
  34. //$REVIEW: CB_XMLBODYPART_SIZE is not meant to control chunks
  35. //
  36. CB_XMLBODYPART_SIZE = 4 * 1024 // 4K
  37. };
  38. // class IXMLBody ------------------------------------------------------------
  39. //
  40. // This is the XML body building interface, it is to be inherited in either
  41. // IIS and/or store size, to allow XML emitting
  42. //
  43. class IXMLBody : private CRefCountedObject,
  44. public IRefCounted
  45. {
  46. // NOT IMPLEMENTED
  47. //
  48. IXMLBody(const IXMLBody& p);
  49. IXMLBody& operator=( const IXMLBody& );
  50. protected:
  51. IXMLBody()
  52. {
  53. AddRef(); // use com-style refcounting
  54. }
  55. public:
  56. virtual SCODE ScAddTextBytes ( UINT cbText, LPCSTR lpszText ) = 0;
  57. virtual VOID Done() = 0;
  58. // RefCounting -- forward all reconting requests to our refcounting
  59. // implementation base class: CRefCountedObject
  60. //
  61. void AddRef() { CRefCountedObject::AddRef(); }
  62. void Release() { CRefCountedObject::Release(); }
  63. };
  64. #endif // _XML_H_