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.
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.

Detailed Description

Definition in file rtxXmlStr.h.


Function Documentation

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:
pctxt Pointer to a context block
pStr Pointer to a character string to be copied.
cdata This indicates if this string should be encoded as a CDATA section in an XML document.
Returns:
The allocated and initialized instance of OSXMLSTRING type.
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:
pctxt Pointer to a context block
pStr Pointer to a character string to be assigned.
cdata This indicates if this string should be encoded as a CDATA section in an XML document.
Returns:
The allocated and initialized instance of OSXMLSTRING type.