home *** CD-ROM | disk | FTP | other *** search
/ Dynamic HTML in Action / Dynamicke-HTML-v-akci-covermount.bin / XML / PARSER / XMLINST.EXE / classes / com / ms / xml / xmlstream / XMLURLStream / XMLStream.h < prev    next >
Encoding:
C/C++ Source or Header  |  1997-10-22  |  1.2 KB  |  53 lines

  1. // XMLStream.h : Declaration of the CXMLStream
  2.  
  3. #ifndef __XMLSTREAM_H_
  4. #define __XMLSTREAM_H_
  5.  
  6. #include "resource.h"       // main symbols
  7.  
  8. #define  SIZE 4096
  9.  
  10. const int UTF8  = 0;
  11. const int ASCII = 1;
  12. const int UCS2  = 2;
  13. const int UCS4  = 3;
  14. const int EBCDIC= 4;
  15. const int W1252 = 5;
  16.  
  17. /////////////////////////////////////////////////////////////////////////////
  18. // CXMLStream
  19. class ATL_NO_VTABLE CXMLStream : 
  20.     public CComObjectRootEx<CComSingleThreadModel>,
  21.     public CComCoClass<CXMLStream, &CLSID_XMLStream>,
  22.     public IDispatchImpl<IXMLStream, &IID_IXMLStream, &LIBID_XMLURLSTREAMLib>
  23. {
  24. public:
  25.     CXMLStream()
  26.     {
  27.     }
  28.  
  29. DECLARE_REGISTRY_RESOURCEID(IDR_XMLSTREAM)
  30.  
  31. BEGIN_COM_MAP(CXMLStream)
  32.     COM_INTERFACE_ENTRY(IXMLStream)
  33.     COM_INTERFACE_ENTRY(IDispatch)
  34. END_COM_MAP()
  35.  
  36. // IXMLStream
  37. public:
  38.     STDMETHOD(SetEncoding)(/*[in]*/ int encoding, /*[in]*/ int offset);
  39.     STDMETHOD(Read)(/*[out]*/ int * buf, /*[in]*/ int len, /*[out, retval]*/ int * al);
  40.     STDMETHOD(Open)(/*[in]*/ BSTR url, /*[out, retval]*/ int * outEncoding);
  41.     STDMETHOD(Close)();
  42. private:
  43.     bool littleendian;
  44.     bool byteOrderMark;
  45.     IStream * pStream;
  46.     unsigned char buffer[SIZE];
  47.     int index;
  48.     int size;
  49.     int encoding;
  50. };
  51.  
  52. #endif //__XMLSTREAM_H_
  53.