XBinder XML Runtime  XBinder Version 3.0.x
OSXMLEncodeBuffer.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2003-2022 Objective Systems, Inc.
3  *
4  * This software is furnished under a license and may be used and copied
5  * only in accordance with the terms of such license and with the
6  * inclusion of the above copyright notice. This software or any other
7  * copies thereof may not be provided or otherwise made available to any
8  * other person. No title to and ownership of the software is hereby
9  * transferred.
10  *
11  * The information in this software is subject to change without notice
12  * and should not be construed as a commitment by Objective Systems, Inc.
13  *
14  * PROPRIETARY NOTICE
15  *
16  * This software is an unpublished work subject to a confidentiality agreement
17  * and is protected by copyright and trade secret law. Unauthorized copying,
18  * redistribution or other use of this work is prohibited.
19  *
20  * The above notice of copyright on this source code product does not indicate
21  * any actual or intended publication of such source code.
22  *
23  *****************************************************************************/
28 #ifndef _OSXMLENCODEBUFFER_H_
29 #define _OSXMLENCODEBUFFER_H_
30 
32 
38 class EXTXMLCLASS OSXMLEncodeBuffer : public OSXMLEncodeBase {
39  protected:
40  OSXMLEncodeBuffer (OSRTContext* pContext) :
41  OSXMLEncodeBase (pContext) {}
42  public:
46  EXTXMLMETHOD OSXMLEncodeBuffer ();
47 
58  EXTXMLMETHOD OSXMLEncodeBuffer (OSOCTET* pMsgBuf, size_t msgBufLen);
59 
69  int addXMLHeader (const OSUTF8CHAR* version = OSUTF8("1.0"),
70  const OSUTF8CHAR* encoding = OSUTF8(OSXMLHDRUTF8),
71  OSBOOL newLine = TRUE);
72 
82  EXTXMLMETHOD int addXMLText (const OSUTF8CHAR* text);
83 
90  virtual size_t getMsgLen () {
91  return getByteIndex();
92  }
93 
101  EXTXMLMETHOD virtual int init ();
102 
118  virtual OSBOOL isA (Type bufferType) {
119  return bufferType == XMLEncode;
120  }
121 
126  inline void nullTerminate () {
127  OSRTZTERM (getCtxtPtr());
128  }
129 
135  EXTXMLMETHOD void setFragment (OSBOOL value = TRUE);
136 
147  EXTXMLMETHOD virtual long write (const char* filename);
148 
160  EXTXMLMETHOD virtual long write (FILE* fp);
161 } ;
162 
163 #endif
164 
void nullTerminate()
This method adds a null-terminator character ('\0') at the current buffer position.
virtual size_t getMsgLen()
This method returns the length of a previously encoded XML message.
The OSXMLEncodeBuffer class is derived from the OSXMLEncodeBase class.
virtual OSBOOL isA(Type bufferType)
This is a virtual method that must be overridden by derived classes to allow identification of the cl...
EXTXMLMETHOD OSXMLEncodeBase(OSRTContext *pContext=0)
The protected constructor creates a new context and sets the buffer class type.
XML encode/decode buffer and stream base class.
OSXMLEncodeBase is a base class for the XML encode buffer and stream classes, OSXMLEncodeBuffer and O...