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 _OSJSONENCODESTREAM_H_
00029 #define _OSJSONENCODESTREAM_H_
00030
00031 #include "rtxsrc/OSRTOutputStream.h"
00032 #include "rtjsonsrc/OSJSONMessageBuffer.h"
00033
00040 class EXTJSONCLASS OSJSONEncodeStream : public OSJSONMessageBuffer {
00041 protected:
00043 OSRTOutputStream* mpStream;
00044
00047 OSBOOL mbOwnStream;
00048
00051 OSCTXT* mpCtxt;
00052
00053 public:
00061 EXTJSONMETHOD OSJSONEncodeStream (OSRTOutputStream& outputStream);
00062
00072 OSJSONEncodeStream (OSRTOutputStream* pOutputStream,
00073 OSBOOL ownStream = TRUE);
00074
00075 ~OSJSONEncodeStream ();
00076
00087 EXTJSONMETHOD int encodeAttr
00088 (const OSUTF8CHAR* name, const OSUTF8CHAR* value);
00089
00100 EXTJSONMETHOD int encodeText (const OSUTF8CHAR* value);
00101
00107 virtual EXTJSONMETHOD int init ();
00108
00124 virtual OSBOOL isA (int bufferType) {
00125 return bufferType == JSONEncode;
00126 }
00127
00135 virtual const OSOCTET* getMsgPtr () { return 0; }
00136
00142 inline OSRTOutputStream* getStream () const { return mpStream; }
00143
00144 } ;
00145
00146 #endif
00147