XBinder
Version 2.9.x
|
#include "rtxsrc/rtxContext.h"
Go to the source code of this file.
Functions | |
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. More... | |
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. More... | |
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);
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. |
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.
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. |