XBinder  Version 2.6.x
Functions
rtxXmlStr.h File Reference
#include "rtxsrc/rtxContext.h"

Go to the source code of this file.

Functions

EXTERNRT OSXMLSTRINGrtxCreateXmlStr (OSCTXT *pctxt, const OSUTF8CHAR *pStr, OSBOOL cdata)
 This function creates an instance of XML UTF-8 character string structure (OSXMLSTRING type) and initializes it by the passed values. More...
 
EXTERNRT OSXMLSTRINGrtxCreateCopyXmlStr (OSCTXT *pctxt, const OSUTF8CHAR *pStr, OSBOOL cdata)
 This function creates an instance of XML UTF-8 character string structure (OSXMLSTRING type) and initializes it by the passed values. More...
 

Function Documentation

◆ rtxCreateCopyXmlStr()

EXTERNRT OSXMLSTRING* rtxCreateCopyXmlStr ( OSCTXT pctxt,
const OSUTF8CHAR *  pStr,
OSBOOL  cdata 
)

This function creates an instance of XML UTF-8 character string structure (OSXMLSTRING type) and initializes it by the passed values.

In contrary to rtxCreateXmlStr function, the string value is copied. This function uses rtxMemAlloc to allocate the memory for the OSXMLSTRING structure and for the string value being copied. To free memory, rtxMemFreePtr function may be used for both value and structure itself:

OSXMLSTRING* pStr = rtxCreateCopyXmlStr (....);

....

rtxMemFreePtr (pctxt, pStr->value);

rtxMemFreePtr (pctxt, pStr);

Parameters
pctxtPointer to a context block
pStrPointer to a character string to be copied.
cdataThis indicates if this string should be encoded as a CDATA section in an XML document.
Returns
The allocated and initialized instance of OSXMLSTRING type.

◆ rtxCreateXmlStr()

EXTERNRT OSXMLSTRING* rtxCreateXmlStr ( OSCTXT pctxt,
const OSUTF8CHAR *  pStr,
OSBOOL  cdata 
)

This function creates an instance of XML UTF-8 character string structure (OSXMLSTRING type) and initializes it by the passed values.

This function uses rtxMemAlloc to allocate the memory for the OSXMLSTRING structure. String pStr is not copied: the pointer will be assigned to "value" member of OSXMLSTRING structure. To free memory, rtxMemFreePtr function may be used:

OSXMLSTRING* pStr = rtxCreateXmlStr (....);

....

rtxMemFreePtr (pctxt, pStr);

Note, user is responsible to free pStr->value if it is not static and was allocated dynamically.

Parameters
pctxtPointer to a context block
pStrPointer to a character string to be assigned.
cdataThis indicates if this string should be encoded as a CDATA section in an XML document.
Returns
The allocated and initialized instance of OSXMLSTRING type.