00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00028 #ifndef _OSXMLENCODESTREAM_H_
00029 #define _OSXMLENCODESTREAM_H_
00030
00031 #include "rtxsrc/OSRTOutputStream.h"
00032 #include "rtxmlsrc/OSXMLMessageBuffer.h"
00033
00040 class EXTXMLCLASS OSXMLEncodeStream : public OSXMLMessageBuffer {
00041 protected:
00043 OSRTOutputStream* mpStream;
00044
00047 OSBOOL mbOwnStream;
00048
00051 OSCTXT* mpCtxt;
00052
00053 public:
00061 EXTXMLMETHOD OSXMLEncodeStream (OSRTOutputStream& outputStream);
00062
00072 OSXMLEncodeStream (OSRTOutputStream* pOutputStream,
00073 OSBOOL ownStream = TRUE);
00074
00075 ~OSXMLEncodeStream ();
00076
00087 EXTXMLMETHOD int encodeAttr
00088 (const OSUTF8CHAR* name, const OSUTF8CHAR* value);
00089
00101 EXTXMLMETHOD int encodeText (const OSUTF8CHAR* value);
00102
00107 EXTXMLMETHOD int endDocument ();
00108
00118 EXTXMLMETHOD int endElement
00119 (const OSUTF8CHAR* elemName, OSXMLNamespace* pNS = 0);
00120
00126 virtual EXTXMLMETHOD int init ();
00127
00143 virtual OSBOOL isA (int bufferType) {
00144 return bufferType == XMLEncode;
00145 }
00146
00154 virtual const OSOCTET* getMsgPtr () { return 0; }
00155
00161 inline OSRTOutputStream* getStream () const { return mpStream; }
00162
00167 EXTXMLMETHOD int startDocument ();
00168
00184 EXTXMLMETHOD int startElement
00185 (const OSUTF8CHAR* elemName, OSXMLNamespace* pNS = 0,
00186 OSRTDList* pNSAttrs = 0, OSBOOL terminate = FALSE);
00187
00200 EXTXMLMETHOD int termStartElement ();
00201
00202 } ;
00203
00204 #endif
00205