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 _OSJSONENCODEBUFFER_H_
00029 #define _OSJSONENCODEBUFFER_H_
00030
00031 #include "rtjsonsrc/OSJSONMessageBuffer.h"
00032
00038 class EXTJSONCLASS OSJSONEncodeBuffer : public OSJSONMessageBuffer {
00039 protected:
00040 OSJSONEncodeBuffer (OSRTContext* pContext) :
00041 OSJSONMessageBuffer (JSONEncode, pContext) {}
00042
00043 public:
00047 EXTJSONMETHOD OSJSONEncodeBuffer ();
00048
00059 EXTJSONMETHOD OSJSONEncodeBuffer (OSOCTET* pMsgBuf, size_t msgBufLen);
00060
00067 virtual size_t getMsgLen () {
00068 return getByteIndex();
00069 }
00070
00078 EXTJSONMETHOD virtual int init ();
00079
00095 virtual OSBOOL isA (Type bufferType) {
00096 return bufferType == JSONEncode;
00097 }
00098
00103 inline void nullTerminate () {
00104 OSRTZTERM (getCtxtPtr());
00105 }
00106
00117 EXTJSONMETHOD virtual long write (const char* filename);
00118
00130 EXTJSONMETHOD virtual long write (FILE* fp);
00131 } ;
00132
00133 #endif
00134