JSON decode functions.

Functions

EXTERNJSON int rtJsonDecAnyElem (OSCTXT *pctxt, OSUTF8CHAR **ppvalue)
 This function decodes an arbitrary block of JSON-encoded data into a string variable.
EXTERNJSON int rtJsonDecAnyElem2 (OSCTXT *pctxt, OSUTF8CHAR **ppvalue)
 This version of rtJsonDecAnyElem assumes the element name has been pushed on the element name stack in the context.
EXTERNJSON int rtJsonDecAnyType (OSCTXT *pctxt, OSUTF8CHAR **ppvalue)
 This function decodes an arbitrary block of JSON-encoded data into a string variable.
EXTERNJSON int rtJsonDecBase64Str (OSCTXT *pctxt, OSOCTET *pvalue, OSUINT32 *pnocts, size_t bufsize)
 This function decodes a contents of a Base64-encode binary string into a static memory structure.
EXTERNJSON int rtJsonDecDynBase64Str (OSCTXT *pctxt, OSDynOctStr *pvalue)
 This function decodes a contents of a Base64-encode binary string.
EXTERNJSON int rtJsonDecBool (OSCTXT *pctxt, OSBOOL *pvalue)
 This function decodes a variable of the boolean type.
EXTERNJSON int rtJsonDecDate (OSCTXT *pctxt, OSXSDDateTime *pvalue)
 This function decodes a variable of the XSD 'date' type.
EXTERNJSON int rtJsonDecTime (OSCTXT *pctxt, OSXSDDateTime *pvalue)
 This function decodes a variable of the XSD 'time' type.
EXTERNJSON int rtJsonDecDateTime (OSCTXT *pctxt, OSXSDDateTime *pvalue)
 This function decodes a variable of the XSD 'dateTime' type.
EXTERNJSON int rtJsonDecGYear (OSCTXT *pctxt, OSXSDDateTime *pvalue)
 This function decodes a variable of the XSD 'gYear' type.
EXTERNJSON int rtJsonDecGYearMonth (OSCTXT *pctxt, OSXSDDateTime *pvalue)
 This function decodes a variable of the XSD 'gYearMonth' type.
EXTERNJSON int rtJsonDecGMonth (OSCTXT *pctxt, OSXSDDateTime *pvalue)
 This function decodes a variable of the XSD 'gMonth' type.
EXTERNJSON int rtJsonDecGMonthDay (OSCTXT *pctxt, OSXSDDateTime *pvalue)
 This function decodes a variable of the XSD 'gMonthDay' type.
EXTERNJSON int rtJsonDecGDay (OSCTXT *pctxt, OSXSDDateTime *pvalue)
 This function decodes a variable of the XSD 'gDay' type.
EXTERNJSON int rtJsonDecDecimal (OSCTXT *pctxt, OSREAL *pvalue, int totalDigits, int fractionDigits)
 This function decodes the contents of a decimal data type.
EXTERNJSON int rtJsonDecDouble (OSCTXT *pctxt, OSREAL *pvalue)
 This function decodes the contents of a float or double data type.
EXTERNJSON int rtJsonDecHexStr (OSCTXT *pctxt, OSOCTET *pvalue, OSUINT32 *pnocts, size_t bufsize)
 This function decodes the contents of a hexBinary string into a static memory structure.
EXTERNJSON int rtJsonDecDynHexStr (OSCTXT *pctxt, OSDynOctStr *pvalue)
 This function decodes a contents of a hexBinary string.
EXTERNJSON int rtJsonDecDynBitStr (OSCTXT *pctxt, OSUINT32 *nbits, OSOCTET **data)
 This function decodes a variable of the ASN.1 Bit string type.
EXTERNJSON int rtJsonDecBitStrValue (OSCTXT *pctxt, OSUINT32 *nbits, OSOCTET *data, OSSIZE bufsize)
 This function decodes a variable of the ASN.1 Bit string type.
EXTERNJSON int rtJsonDecInt8Value (OSCTXT *pctxt, OSINT8 *pvalue)
 This function decodes the contents of an 8-bit integer data type (i.e.
EXTERNJSON int rtJsonDecInt16Value (OSCTXT *pctxt, OSINT16 *pvalue)
 This function decodes the contents of a 16-bit integer data type.
EXTERNJSON int rtJsonDecInt32Value (OSCTXT *pctxt, OSINT32 *pvalue)
 This function decodes the contents of a 32-bit integer data type.
EXTERNJSON int rtJsonDecInt64Value (OSCTXT *pctxt, OSINT64 *pvalue)
 This function decodes the contents of a 64-bit integer data type.
EXTERNJSON int rtJsonDecUInt8Value (OSCTXT *pctxt, OSUINT8 *pvalue)
 This function decodes the contents of an unsigned 8-bit integer data type (i.e.
EXTERNJSON int rtJsonDecUInt16Value (OSCTXT *pctxt, OSUINT16 *pvalue)
 This function decodes the contents of an unsigned 16-bit integer data type.
EXTERNJSON int rtJsonDecUInt32Value (OSCTXT *pctxt, OSUINT32 *pvalue)
 This function decodes the contents of an unsigned 32-bit integer data type.
EXTERNJSON int rtJsonDecUInt64Value (OSCTXT *pctxt, OSUINT64 *pvalue)
 This function decodes the contents of an unsigned 64-bit integer data type.
EXTERNJSON int rtJsonDecMatchChar (OSCTXT *pctxt, OSUTF8CHAR ch)
 This function parses the next byte and matches it with given character.
EXTERNJSON int rtJsonDecMatchObjectStart (OSCTXT *pctxt, const OSUTF8NameAndLen *nameArray, size_t numNames)
 This function parses the next object start tag that matches with one of the names in the given name array.
EXTERNJSON int rtJsonDecMatchToken (OSCTXT *pctxt, const OSUTF8CHAR *token)
 This function decodes a JSON string and matches with a given token.
EXTERNJSON int rtJsonDecMatchToken2 (OSCTXT *pctxt, const OSUTF8CHAR *token, size_t tokenLen)
 This function decodes a JSON string and matches with a given token.
EXTERNJSON int rtJsonDecNameValuePair (OSCTXT *pctxt, OSUTF8NVP *pvalue)
 This function decodes a name/value pair.
EXTERNJSON int rtJsonDecNumberString (OSCTXT *pctxt, char **ppCharStr)
 This function decodes a JSON number into a character string variable.
EXTERNJSON int rtJsonDecPeekChar (OSCTXT *pctxt, OSUTF8CHAR *pch)
 This function read the next character.
EXTERNJSON char rtJsonDecPeekChar2 (OSCTXT *pctxt)
 This function read the next character.
EXTERNJSON int rtJsonDecStringObject (OSCTXT *pctxt, const OSUTF8CHAR *name, OSUTF8CHAR **ppvalue)
 This function decodes the contents of a JSON object containing a character string.
EXTERNJSON int rtJsonDecStringValue (OSCTXT *pctxt, OSUTF8CHAR **ppvalue)
 This function decodes the contents of a string data type.
EXTERNJSON int rtJsonDecXmlStringValue (OSCTXT *pctxt, OSXMLSTRING *pvalue)
 This function decodes the contents of an XML string data type.
EXTERNJSON int rtJsonDecUCS2String (OSCTXT *pctxt, OSUNICHAR **ppstr, OSSIZE *pnchars)
 This function is used to decode input UTF-8 data into a UCS-2 / UTF-16 character string.
EXTERNJSON int rtJsonDecUCS4String (OSCTXT *pctxt, OS32BITCHAR **ppstr, OSSIZE *pnchars)
 This function is used to decode input UTF-8 data into a UCS-4 / UTF-32 character string.
EXTERNJSON size_t rtJsonGetElemIdx (OSCTXT *pctxt, const OSUTF8NameAndLen nameArray[], size_t nrows)
 This function parses the next start tag and finds the index of the element name in the descriptor table.

Function Documentation

EXTERNJSON int rtJsonDecAnyElem ( OSCTXT *  pctxt,
OSUTF8CHAR **  ppvalue 
)

This function decodes an arbitrary block of JSON-encoded data into a string variable.

In this case, the expected format is element name : JSON encoded data.

Parameters:
pctxt A pointer to a context structure. This provides a storage area for the function to store all working variables that must be maintained between function calls.
ppvalue A pointer to a variable to receive the decoded JSON text.
Returns:
Completion status of operation:
  • 0 = success,
  • negative return value is error.
EXTERNJSON int rtJsonDecAnyElem2 ( OSCTXT *  pctxt,
OSUTF8CHAR **  ppvalue 
)

This version of rtJsonDecAnyElem assumes the element name has been pushed on the element name stack in the context.

This will be the case if rtJsonGetElemIdx is called prior to calling this function.

Parameters:
pctxt A pointer to a context structure. This provides a storage area for the function to store all working variables that must be maintained between function calls.
ppvalue A pointer to a variable to receive the decoded JSON text.
Returns:
Completion status of operation:
  • 0 = success,
  • negative return value is error.
EXTERNJSON int rtJsonDecAnyType ( OSCTXT *  pctxt,
OSUTF8CHAR **  ppvalue 
)

This function decodes an arbitrary block of JSON-encoded data into a string variable.

In this case, the expected format is a complete JSON encoded data fragment.

Parameters:
pctxt A pointer to a context structure. This provides a storage area for the function to store all working variables that must be maintained between function calls.
ppvalue A pointer to a variable to receive the decoded JSON text.
Returns:
Completion status of operation:
  • 0 = success,
  • negative return value is error.
EXTERNJSON int rtJsonDecBase64Str ( OSCTXT *  pctxt,
OSOCTET *  pvalue,
OSUINT32 *  pnocts,
size_t  bufsize 
)

This function decodes a contents of a Base64-encode binary string into a static memory structure.

The octet string must be Base64 encoded. This function call is used to decode a sized base64Binary string production.

Parameters:
pctxt A pointer to a context structure. This provides a storage area for the function to store all working variables that must be maintained between function calls.
pvalue A pointer to a variable to receive the decoded bit string. This is assumed to be a static array large enough to hold the number of octets specified in the bufsize input parameter.
pnocts A pointer to an integer value to receive the decoded number of octets.
bufsize The size (in octets) of the sized octet string. An error will occur if the number of octets in the decoded string is larger than this value.
Returns:
Completion status of operation:
  • 0 = success,
  • negative return value is error.
EXTERNJSON int rtJsonDecBitStrValue ( OSCTXT *  pctxt,
OSUINT32 *  nbits,
OSOCTET *  data,
OSSIZE  bufsize 
)

This function decodes a variable of the ASN.1 Bit string type.

Parameters:
pctxt Pointer to context block structure.
nbits A pointer to an unsigned integer to receive the number of bits in the bit string.
data A pointer to an OSOCTET array that will receive the decoded bit string. The array must be preallocated.
bufsize Size of the static buffer in bytes into which the data is to be decoded.
Returns:
Completion status of operation:
  • 0 = success,
  • negative return value is error.
EXTERNJSON int rtJsonDecBool ( OSCTXT *  pctxt,
OSBOOL *  pvalue 
)

This function decodes a variable of the boolean type.

Parameters:
pctxt Pointer to context block structure.
pvalue Pointer to a variable to receive the decoded boolean value.
Returns:
Completion status of operation:
  • 0 = success,
  • negative return value is error.
EXTERNJSON int rtJsonDecDate ( OSCTXT *  pctxt,
OSXSDDateTime *  pvalue 
)

This function decodes a variable of the XSD 'date' type.

Input is expected to be a string of characters returned by a JSON parser. The string should have CCYY-MM-DD format.

Parameters:
pctxt Pointer to context block structure.
pvalue OSXSDDateTime type pointer points to a OSXSDDateTime value to receive decoded result.
Returns:
Completion status of operation:
  • 0 = success,
  • negative return value is error.
EXTERNJSON int rtJsonDecDateTime ( OSCTXT *  pctxt,
OSXSDDateTime *  pvalue 
)

This function decodes a variable of the XSD 'dateTime' type.

Input is expected to be a string of characters returned by an JSON parser.

Parameters:
pctxt Pointer to context block structure.
pvalue OSXSDDateTime type pointer points to a OSXSDDateTime value to receive decoded result.
Returns:
Completion status of operation:
  • 0 = success,
  • negative return value is error.
EXTERNJSON int rtJsonDecDecimal ( OSCTXT *  pctxt,
OSREAL *  pvalue,
int  totalDigits,
int  fractionDigits 
)

This function decodes the contents of a decimal data type.

Input is expected to be a string of OSUTF8CHAR characters returned by a JSON parser.

Parameters:
pctxt Pointer to context block structure.
pvalue Pointer to 64-bit double value to receive decoded result.
totalDigits The total number of digits in the decimal value.
fractionDigits The number of fractional digits in the decimal value.
Returns:
Completion status of operation:
  • 0 = success,
  • negative return value is error.
EXTERNJSON int rtJsonDecDouble ( OSCTXT *  pctxt,
OSREAL *  pvalue 
)

This function decodes the contents of a float or double data type.

Input is expected to be a string of OSUTF8CHAR characters returned by a JSON parser.

Parameters:
pctxt Pointer to context block structure.
pvalue Pointer to 64-bit double value to receive decoded result.
Returns:
Completion status of operation:
  • 0 = success,
  • negative return value is error.
EXTERNJSON int rtJsonDecDynBase64Str ( OSCTXT *  pctxt,
OSDynOctStr *  pvalue 
)

This function decodes a contents of a Base64-encode binary string.

The octet string must be Base64 encoded. This function will allocate dynamic memory to store the decoded result.

Parameters:
pctxt A pointer to a context structure. This provides a storage area for the function to store all working variables that must be maintained between function calls.
pvalue A pointer to a dynamic octet string structure to receive the decoded octet string. Dynamic memory is allocated for the string using the rtxMemAlloc function.
Returns:
Completion status of operation:
  • 0 = success,
  • negative return value is error.
EXTERNJSON int rtJsonDecDynBitStr ( OSCTXT *  pctxt,
OSUINT32 *  nbits,
OSOCTET **  data 
)

This function decodes a variable of the ASN.1 Bit string type.

Parameters:
pctxt Pointer to context block structure.
nbits A pointer to an unsigned integer to receive the number of bits in the bit string.
data A pointer to an OSOCTET array that will receive the decoded bit string; the array will be allocated by the decoding function.
Returns:
Completion status of operation:
  • 0 = success,
  • negative return value is error.
EXTERNJSON int rtJsonDecDynHexStr ( OSCTXT *  pctxt,
OSDynOctStr *  pvalue 
)

This function decodes a contents of a hexBinary string.

This function will allocate dynamic memory to store the decoded result. Input is expected to be a string of OSUTF8CHAR characters returned by a JSON parser.

Parameters:
pctxt A pointer to a context structure. This provides a storage area for the function to store all working variables that must be maintained between function calls.
pvalue A pointer to a dynamic octet string structure to receive the decoded octet string. Dynamic memory is allocated to hold the string using the rtxMemAlloc function.
Returns:
Completion status of operation:
  • 0 = success,
  • negative return value is error.
EXTERNJSON int rtJsonDecGDay ( OSCTXT *  pctxt,
OSXSDDateTime *  pvalue 
)

This function decodes a variable of the XSD 'gDay' type.

Input is expected to be a string of characters returned by a JSON parser. The string should have ---DD[-+hh:mm|Z] format.

Parameters:
pctxt Pointer to context block structure.
pvalue OSXSDDateTime type pointer points to a OSXSDDateTime value to receive decoded result.
Returns:
Completion status of operation:
  • 0 = success,
  • negative return value is error.
EXTERNJSON int rtJsonDecGMonth ( OSCTXT *  pctxt,
OSXSDDateTime *  pvalue 
)

This function decodes a variable of the XSD 'gMonth' type.

Input is expected to be a string of characters returned by a JSON parser. The string should have --MM[-+hh:mm|Z] format.

Parameters:
pctxt Pointer to context block structure.
pvalue OSXSDDateTime type pointer points to a OSXSDDateTime value to receive decoded result.
Returns:
Completion status of operation:
  • 0 = success,
  • negative return value is error.
EXTERNJSON int rtJsonDecGMonthDay ( OSCTXT *  pctxt,
OSXSDDateTime *  pvalue 
)

This function decodes a variable of the XSD 'gMonthDay' type.

Input is expected to be a string of characters returned by a JSON parser. The string should have --MM-DD[-+hh:mm|Z] format.

Parameters:
pctxt Pointer to context block structure.
pvalue OSXSDDateTime type pointer points to a OSXSDDateTime value to receive decoded result.
Returns:
Completion status of operation:
  • 0 = success,
  • negative return value is error.
EXTERNJSON int rtJsonDecGYear ( OSCTXT *  pctxt,
OSXSDDateTime *  pvalue 
)

This function decodes a variable of the XSD 'gYear' type.

Input is expected to be a string of characters returned by a JSON parser. The string should have CCYY[-+hh:mm|Z] format.

Parameters:
pctxt Pointer to context block structure.
pvalue OSXSDDateTime type pointer points to a OSXSDDateTime value to receive decoded result.
Returns:
Completion status of operation:
  • 0 = success,
  • negative return value is error.
EXTERNJSON int rtJsonDecGYearMonth ( OSCTXT *  pctxt,
OSXSDDateTime *  pvalue 
)

This function decodes a variable of the XSD 'gYearMonth' type.

Input is expected to be a string of characters returned by a JSON parser. The string should have CCYY-MM[-+hh:mm|Z] format.

Parameters:
pctxt Pointer to context block structure.
pvalue OSXSDDateTime type pointer points to a OSXSDDateTime value to receive decoded result.
Returns:
Completion status of operation:
  • 0 = success,
  • negative return value is error.
EXTERNJSON int rtJsonDecHexStr ( OSCTXT *  pctxt,
OSOCTET *  pvalue,
OSUINT32 *  pnocts,
size_t  bufsize 
)

This function decodes the contents of a hexBinary string into a static memory structure.

Input is expected to be a string of OSUTF8CHAR characters returned by a JSON parser.

Parameters:
pctxt A pointer to a context structure. This provides a storage area for the function to store all working variables that must be maintained between function calls.
pvalue A pointer to a variable to receive the decoded bit string. This is assumed to be a static array large enough to hold the number of octets specified in the bufsize input parameter.
pnocts A pointer to an integer value to receive the decoded number of octets.
bufsize The size (in octets) of the sized octet string. An error will occur if the number of octets in the decoded string is larger than this value.
Returns:
Completion status of operation:
  • 0 = success,
  • negative return value is error.
EXTERNJSON int rtJsonDecInt16Value ( OSCTXT *  pctxt,
OSINT16 *  pvalue 
)

This function decodes the contents of a 16-bit integer data type.

Input is expected to be a string of OSUTF8CHAR characters returned by a JSON parser.

Parameters:
pctxt Pointer to context block structure.
pvalue Pointer to 16-bit integer value to receive decoded result.
Returns:
Completion status of operation:
  • 0 = success,
  • negative return value is error.
EXTERNJSON int rtJsonDecInt32Value ( OSCTXT *  pctxt,
OSINT32 *  pvalue 
)

This function decodes the contents of a 32-bit integer data type.

Input is expected to be a string of OSUTF8CHAR characters returned by a JSON parser.

Parameters:
pctxt Pointer to context block structure.
pvalue Pointer to 32-bit integer value to receive decoded result.
Returns:
Completion status of operation:
  • 0 = success,
  • negative return value is error.
EXTERNJSON int rtJsonDecInt64Value ( OSCTXT *  pctxt,
OSINT64 *  pvalue 
)

This function decodes the contents of a 64-bit integer data type.

Input is expected to be a string of OSUTF8CHAR characters returned by a JSON parser.

Parameters:
pctxt Pointer to context block structure.
pvalue Pointer to 64-bit integer value to receive decoded result.
Returns:
Completion status of operation:
  • 0 = success,
  • negative return value is error.
EXTERNJSON int rtJsonDecInt8Value ( OSCTXT *  pctxt,
OSINT8 *  pvalue 
)

This function decodes the contents of an 8-bit integer data type (i.e.

a signed byte type in the range of -128 to 127). Input is expected to be a string of OSUTF8CHAR characters returned by a JSON parser.

Parameters:
pctxt Pointer to context block structure.
pvalue Pointer to 8-bit integer value to receive decoded result.
Returns:
Completion status of operation:
  • 0 = success,
  • negative return value is error.
EXTERNJSON int rtJsonDecMatchChar ( OSCTXT *  pctxt,
OSUTF8CHAR  ch 
)

This function parses the next byte and matches it with given character.

Parameters:
pctxt Pointer to context block structure.
ch The character to be matched.
Returns:
Completion status of operation:
  • 0 = success,
  • negative return value is error.
EXTERNJSON int rtJsonDecMatchObjectStart ( OSCTXT *  pctxt,
const OSUTF8NameAndLen *  nameArray,
size_t  numNames 
)

This function parses the next object start tag that matches with one of the names in the given name array.

It also matches the the leading '{' of the object and ':' character after the name.

Parameters:
pctxt Pointer to context block structure.
nameArray Array of names to be matched.
numNames Number of names in the name array
Returns:
Completion status of operation:
  • 0 = success,
  • negative return value is error.
EXTERNJSON int rtJsonDecMatchToken ( OSCTXT *  pctxt,
const OSUTF8CHAR *  token 
)

This function decodes a JSON string and matches with a given token.

Parameters:
pctxt A pointer to a context structure. This provides a storage area for the function to store all working variables that must be maintained between function calls.
token The token to be matched.
Returns:
Completion status of operation:
  • 0 = success,
  • negative return value is error.
EXTERNJSON int rtJsonDecMatchToken2 ( OSCTXT *  pctxt,
const OSUTF8CHAR *  token,
size_t  tokenLen 
)

This function decodes a JSON string and matches with a given token.

Parameters:
pctxt A pointer to a context structure. This provides a storage area for the function to store all working variables that must be maintained between function calls.
token The token to be matched.
tokenLen The length of the token to be matched.
Returns:
Completion status of operation:
  • 0 = success,
  • negative return value is error.
EXTERNJSON int rtJsonDecNameValuePair ( OSCTXT *  pctxt,
OSUTF8NVP *  pvalue 
)

This function decodes a name/value pair.

Parameters:
pctxt Pointer to context block structure.
pvalue Pointer to an structure to receive the decoded name and value.
Returns:
Completion status of operation:
  • 0 = success,
  • negative return value is error.
EXTERNJSON int rtJsonDecNumberString ( OSCTXT *  pctxt,
char **  ppCharStr 
)

This function decodes a JSON number into a character string variable.

Parameters:
pctxt Pointer to context block structure.
ppCharStr Pointer to character string pointer to receive decoded value. Dynamic memory is allocated for the string using the rtxMemAlloc function.
Returns:
Completion status of operation:
  • 0 = success,
  • negative return value is error.
EXTERNJSON int rtJsonDecPeekChar ( OSCTXT *  pctxt,
OSUTF8CHAR *  pch 
)

This function read the next character.

It does not decode the value.

Parameters:
pctxt Pointer to OSCTXT structure
pch A pointer to a variable to receive the next character.
Returns:
Completion status of operation:
  • 0 = success,
  • negative return value is error.
EXTERNJSON char rtJsonDecPeekChar2 ( OSCTXT *  pctxt  ) 

This function read the next character.

It does not decode the value.

Parameters:
pctxt Pointer to OSCTXT structure
Returns:
The peeked character, or null if there is a failure. The error will be logged in the context.
EXTERNJSON int rtJsonDecStringObject ( OSCTXT *  pctxt,
const OSUTF8CHAR *  name,
OSUTF8CHAR **  ppvalue 
)

This function decodes the contents of a JSON object containing a character string.

Input is expected to be a complete JSON object returned by a JSON parser.

Parameters:
pctxt Pointer to context block structure.
name The name token.
ppvalue Pointer to an string structure to receive the decoded string. Memory is allocated for the string using the run-time memory manager.
Returns:
Completion status of operation:
  • 0 = success,
  • negative return value is error.
EXTERNJSON int rtJsonDecStringValue ( OSCTXT *  pctxt,
OSUTF8CHAR **  ppvalue 
)

This function decodes the contents of a string data type.

This type contains a pointer to a UTF-8 characer string. Input is expected to be a string of UTF-8 characters returned by a JSON parser.

Parameters:
pctxt Pointer to context block structure.
ppvalue Pointer to an string structure to receive the decoded string. Memory is allocated for the string using the run-time memory manager.
Returns:
Completion status of operation:
  • 0 = success,
  • negative return value is error.
EXTERNJSON int rtJsonDecTime ( OSCTXT *  pctxt,
OSXSDDateTime *  pvalue 
)

This function decodes a variable of the XSD 'time' type.

Input is expected to be a string of characters returned by a JSON parser. The string should have one of following formats:

(1) hh-mm-ss.ss used if tz_flag = false (2) hh-mm-ss.ssZ used if tz_flag = false and tzo = 0 (3) hh-mm-ss.ss+HH:MM if tz_flag = false and tzo > 0 (4) hh-mm-ss.ss-HH:MM-HH:MM if tz_flag = false and tzo < 0

Parameters:
pctxt Pointer to context block structure.
pvalue OSXSDDateTime type pointer points to a OSXSDDateTime value to receive decoded result.
Returns:
Completion status of operation:
  • 0 = success,
  • negative return value is error.
EXTERNJSON int rtJsonDecUCS2String ( OSCTXT *  pctxt,
OSUNICHAR **  ppstr,
OSSIZE *  pnchars 
)

This function is used to decode input UTF-8 data into a UCS-2 / UTF-16 character string.

Parameters:
pctxt A pointer to the context block structure.
ppstr A pointer to a UTF-16 string; memory will be allocated to hold the string using the run-time memory manager.
pnchars A pointer to an integer to hold the number of characters in the string. (The number of octets may be found by multiplying by two.)
Returns:
0 on success; less than zero on error.
EXTERNJSON int rtJsonDecUCS4String ( OSCTXT *  pctxt,
OS32BITCHAR **  ppstr,
OSSIZE *  pnchars 
)

This function is used to decode input UTF-8 data into a UCS-4 / UTF-32 character string.

Parameters:
pctxt A pointer to the context block structure.
ppstr A pointer to a UTF-32 string; memory will be allocated to hold the string using the run-time memory manager.
pnchars A pointer to an integer to hold the number of characters in the string. (The number of octets may be found by multiplying by two.)
Returns:
0 on success; less than zero on error.
EXTERNJSON int rtJsonDecUInt16Value ( OSCTXT *  pctxt,
OSUINT16 *  pvalue 
)

This function decodes the contents of an unsigned 16-bit integer data type.

Input is expected to be a string of OSUTF8CHAR characters returned by a JSON parser.

Parameters:
pctxt Pointer to context block structure.
pvalue Pointer to unsigned 16-bit integer value to receive decoded result.
Returns:
Completion status of operation:
  • 0 = success,
  • negative return value is error.
EXTERNJSON int rtJsonDecUInt32Value ( OSCTXT *  pctxt,
OSUINT32 *  pvalue 
)

This function decodes the contents of an unsigned 32-bit integer data type.

Input is expected to be a string of OSUTF8CHAR characters returned by a JSON parser.

Parameters:
pctxt Pointer to context block structure.
pvalue Pointer to unsigned 32-bit integer value to receive decoded result.
Returns:
Completion status of operation:
  • 0 = success,
  • negative return value is error.
EXTERNJSON int rtJsonDecUInt64Value ( OSCTXT *  pctxt,
OSUINT64 *  pvalue 
)

This function decodes the contents of an unsigned 64-bit integer data type.

Input is expected to be a string of OSUTF8CHAR characters returned by a JSON parser.

Parameters:
pctxt Pointer to context block structure.
pvalue Pointer to unsigned 64-bit integer value to receive decoded result.
Returns:
Completion status of operation:
  • 0 = success,
  • negative return value is error.
EXTERNJSON int rtJsonDecUInt8Value ( OSCTXT *  pctxt,
OSUINT8 *  pvalue 
)

This function decodes the contents of an unsigned 8-bit integer data type (i.e.

a signed byte type in the range of 0 to 255). Input is expected to be a string of OSUTF8CHAR characters returned by a JSON parser.

Parameters:
pctxt Pointer to context block structure.
pvalue Pointer to unsigned 8-bit integer value to receive decoded result.
Returns:
Completion status of operation:
  • 0 = success,
  • negative return value is error.
EXTERNJSON int rtJsonDecXmlStringValue ( OSCTXT *  pctxt,
OSXMLSTRING *  pvalue 
)

This function decodes the contents of an XML string data type.

This type contains a pointer to a UTF-8 characer string plus flags that can be set to alter the encoding of the string (for example, the cdata flag allows the string to be encoded in a CDATA section). Input is expected to be a string of UTF-8 characters returned by a JSON parser.

Parameters:
pctxt Pointer to context block structure.
pvalue Pointer to an XML string structure to receive the decoded string. Memory is allocated for the string using the run-time memory manager.
Returns:
Completion status of operation:
  • 0 = success,
  • negative return value is error.
EXTERNJSON size_t rtJsonGetElemIdx ( OSCTXT *  pctxt,
const OSUTF8NameAndLen  nameArray[],
size_t  nrows 
)

This function parses the next start tag and finds the index of the element name in the descriptor table.

Parameters:
pctxt Pointer to context block structure.
nameArray Elements descriptor table.
nrows Number of descriptors in table.
Returns:
Completion status of operation:
  • positive or zero value is element identifier,
  • negative return value is error.