rtxXmlQName.h File Reference

XML QName type definition and associated utility functions. More...

#include "rtxsrc/rtxContext.h"

Go to the source code of this file.

Classes

struct  OSXMLFullQName
 This version of QName contains complete namespace info (prefix + URI). More...

Functions

EXTERNRT OSXMLFullQNamertxNewFullQName (OSCTXT *pctxt, const OSUTF8CHAR *localName, const OSUTF8CHAR *prefix, const OSUTF8CHAR *nsuri)
 This function creates a new full QName structure given the parts.
EXTERNRT OSXMLFullQNamertxNewFullQNameDeepCopy (OSCTXT *pctxt, const OSXMLFullQName *pqname)
 This function allocates a new QName instance and makes a deep copy of the given QName including the strings inside.
EXTERNRT void rtxQNameDeepCopy (OSCTXT *pctxt, OSXMLFullQName *pdest, const OSXMLFullQName *psrc)
 This function makes a deep copy of the given QName including the strings inside.
EXTERNRT void rtxQNameFreeMem (OSCTXT *pctxt, OSXMLFullQName *pqname, OSBOOL dynamic)
 This function frees all memory within a QName structure,.
EXTERNRT OSUINT32 rtxQNameHash (const OSXMLFullQName *pqname)
 This function computes a hash code for the given QName.
EXTERNRT OSBOOL rtxQNamesEqual (const OSXMLFullQName *pqname1, const OSXMLFullQName *pqname2)
 This function tests 2 QNames for equality.
EXTERNRT const OSUTF8CHAR * rtxQNameToString (const OSXMLFullQName *pqname, OSUTF8CHAR *buffer, OSUINT32 bufsiz)
 This function returns the QName in the following stringified format: {uri}/localName.

Detailed Description

XML QName type definition and associated utility functions.

Definition in file rtxXmlQName.h.


Function Documentation

EXTERNRT OSXMLFullQName* rtxNewFullQName ( OSCTXT pctxt,
const OSUTF8CHAR *  localName,
const OSUTF8CHAR *  prefix,
const OSUTF8CHAR *  nsuri 
)

This function creates a new full QName structure given the parts.

Memory is allocated for the structure using rtxMemAlloc. Copies are not made of the string variables - the pointers are stored.

Parameters:
pctxt Pointer to a context structure.
localName Element local name.
prefix Namespace prefix.
nsuri Namespace URI.
Returns:
QName value. Memory for the value will have been allocated by rtxMemAlloc and thus must be freed using one of the rtxMemFree functions. The value will be NULL if no dynamic memory was available.
EXTERNRT OSXMLFullQName* rtxNewFullQNameDeepCopy ( OSCTXT pctxt,
const OSXMLFullQName pqname 
)

This function allocates a new QName instance and makes a deep copy of the given QName including the strings inside.

Parameters:
pctxt Pointer to a context structure.
pqname Pointer to QName to be copied.
Returns:
Deep copy of QName structure.
EXTERNRT void rtxQNameDeepCopy ( OSCTXT pctxt,
OSXMLFullQName pdest,
const OSXMLFullQName psrc 
)

This function makes a deep copy of the given QName including the strings inside.

Parameters:
pctxt Pointer to a context structure.
pdest Pointer to QName to receive copied data.
psrc Pointer to QName to be copied.
EXTERNRT void rtxQNameFreeMem ( OSCTXT pctxt,
OSXMLFullQName pqname,
OSBOOL  dynamic 
)

This function frees all memory within a QName structure,.

Parameters:
pctxt Pointer to a context structure.
pqname Pointer to QName in which memory will be freed.
dynamic Boolean indicating if pqname is dynamic. If true, the memory for pqname is freed.
EXTERNRT OSUINT32 rtxQNameHash ( const OSXMLFullQName pqname  ) 

This function computes a hash code for the given QName.

Parameters:
pqname Pointer to QName structure.
Returns:
Computed hash code.
EXTERNRT OSBOOL rtxQNamesEqual ( const OSXMLFullQName pqname1,
const OSXMLFullQName pqname2 
)

This function tests 2 QNames for equality.

Parameters:
pqname1 Pointer to QName structure.
pqname2 Pointer to QName structure.
Returns:
True if names equal; false, otherwise.
EXTERNRT const OSUTF8CHAR* rtxQNameToString ( const OSXMLFullQName pqname,
OSUTF8CHAR *  buffer,
OSUINT32  bufsiz 
)

This function returns the QName in the following stringified format: {uri}/localName.

Parameters:
pqname Pointer to QName structure.
buffer Buffer into which to return name.
bufsiz Size of buffer into which name is to be returned. If name will not fit in buffer, it is truncated.
Returns:
Pointer to string (address of 'buffer' argument).