XBinder  Version 2.9.x
Classes | Functions
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...
 
struct  OSXMLQNameValue
 This version of QName models the value space for XML Schema QNames, which consists of just a namespace URI and a local name. 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. More...
 
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. More...
 
EXTERNRT void rtxQNameDeepCopy (OSCTXT *pctxt, OSXMLFullQName *pdest, const OSXMLFullQName *psrc)
 This function makes a deep copy of the given QName including the strings inside. More...
 
EXTERNRT void rtxQNameFreeMem (OSCTXT *pctxt, OSXMLFullQName *pqname, OSBOOL dynamic)
 This function frees all memory within a QName structure,. More...
 
EXTERNRT OSUINT32 rtxQNameHash (const OSXMLFullQName *pqname)
 This function computes a hash code for the given QName. More...
 
EXTERNRT OSBOOL rtxQNamesEqual (const OSXMLFullQName *pqname1, const OSXMLFullQName *pqname2)
 This function tests 2 QNames for equality. More...
 
EXTERNRT const OSUTF8CHAR * rtxQNameToString (const OSXMLFullQName *pqname, OSUTF8CHAR *buffer, OSUINT32 bufsiz)
 This function returns the QName in the following stringified format: {uri}/localName. More...
 
EXTERNRT OSSIZE rtxQNameValueArraySearch (OSXMLQNameValue *pValue, OSXMLQNameValue *pArray, OSSIZE arraySize)
 Function to do a binary search on a sorted array of QNames. More...
 

Detailed Description

XML QName type definition and associated utility functions.

Definition in file rtxXmlQName.h.

Function Documentation

◆ rtxNewFullQName()

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
pctxtPointer to a context structure.
localNameElement local name.
prefixNamespace prefix.
nsuriNamespace 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.

◆ rtxNewFullQNameDeepCopy()

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
pctxtPointer to a context structure.
pqnamePointer to QName to be copied.
Returns
Deep copy of QName structure.

◆ rtxQNameDeepCopy()

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
pctxtPointer to a context structure.
pdestPointer to QName to receive copied data.
psrcPointer to QName to be copied.

◆ rtxQNameFreeMem()

EXTERNRT void rtxQNameFreeMem ( OSCTXT pctxt,
OSXMLFullQName pqname,
OSBOOL  dynamic 
)

This function frees all memory within a QName structure,.

Parameters
pctxtPointer to a context structure.
pqnamePointer to QName in which memory will be freed.
dynamicBoolean indicating if pqname is dynamic. If true, the memory for pqname is freed.

◆ rtxQNameHash()

EXTERNRT OSUINT32 rtxQNameHash ( const OSXMLFullQName pqname)

This function computes a hash code for the given QName.

Parameters
pqnamePointer to QName structure.
Returns
Computed hash code.

◆ rtxQNamesEqual()

EXTERNRT OSBOOL rtxQNamesEqual ( const OSXMLFullQName pqname1,
const OSXMLFullQName pqname2 
)

This function tests 2 QNames for equality.

Parameters
pqname1Pointer to QName structure.
pqname2Pointer to QName structure.
Returns
True if names equal; false, otherwise.

◆ rtxQNameToString()

EXTERNRT const OSUTF8CHAR* rtxQNameToString ( const OSXMLFullQName pqname,
OSUTF8CHAR *  buffer,
OSUINT32  bufsiz 
)

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

Parameters
pqnamePointer to QName structure.
bufferBuffer into which to return name.
bufsizSize 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).

◆ rtxQNameValueArraySearch()

EXTERNRT OSSIZE rtxQNameValueArraySearch ( OSXMLQNameValue pValue,
OSXMLQNameValue pArray,
OSSIZE  arraySize 
)

Function to do a binary search on a sorted array of QNames.

Parameters
pValueValue to search for.
pArrayArray to search. It must be sorted by localName then nsURI, with null nsURI (no namespace) being less than non-null nsURI (non empty namespace).
arraySizeSize of the array
Returns
index of matching element. If multiple elements match pValue, the index of the smallest such element is returned. If there is no match, (OSSIZE)-1 is returned.