JSON encode functions.
Functions | |
EXTERNJSON int | rtJsonEncAnyAttr (OSCTXT *pctxt, const OSRTDList *pvalue) |
This function encodes a list of OSAnyAttr attributes in which the name and value are given as a UTF-8 string. | |
EXTERNJSON int | rtJsonEncIntValue (OSCTXT *pctxt, OSINT32 value) |
This function encodes a variable of the XSD integer type. | |
EXTERNJSON int | rtJsonEncInt64Value (OSCTXT *pctxt, OSINT64 value) |
This function encodes a variable of the XSD integer type. | |
EXTERNJSON int | rtJsonEncBase64StrValue (OSCTXT *pctxt, OSUINT32 nocts, const OSOCTET *value) |
This function encodes a variable of the XSD base64Binary type. | |
EXTERNJSON int | rtJsonEncBoolValue (OSCTXT *pctxt, OSBOOL value) |
This function encodes a variable of the XSD boolean type. | |
EXTERNJSON int | rtJsonEncGYear (OSCTXT *pctxt, const OSXSDDateTime *pvalue) |
This function encodes a numeric gYear value into a JSON string representation. | |
EXTERNJSON int | rtJsonEncGYearMonth (OSCTXT *pctxt, const OSXSDDateTime *pvalue) |
This function encodes a numeric gYearMonth value into a JSON string representation. | |
EXTERNJSON int | rtJsonEncGMonth (OSCTXT *pctxt, const OSXSDDateTime *pvalue) |
This function encodes a numeric gMonth value into a JSON string representation. | |
EXTERNJSON int | rtJsonEncGMonthDay (OSCTXT *pctxt, const OSXSDDateTime *pvalue) |
This function encodes a numeric gMonthDay value into a JSON string representation. | |
EXTERNJSON int | rtJsonEncGDay (OSCTXT *pctxt, const OSXSDDateTime *pvalue) |
This function encodes a numeric gDay value into a JSON string representation. | |
EXTERNJSON int | rtJsonEncDate (OSCTXT *pctxt, const OSXSDDateTime *pvalue) |
This function encodes a variable of the XSD 'date' type as a string. | |
EXTERNJSON int | rtJsonEncTime (OSCTXT *pctxt, const OSXSDDateTime *pvalue) |
This function encodes a variable of the XSD 'time' type as a JSON string. | |
EXTERNJSON int | rtJsonEncDateTime (OSCTXT *pctxt, const OSXSDDateTime *pvalue) |
This function encodes a numeric date/time value into a string representation. | |
EXTERNJSON int | rtJsonEncDecimalValue (OSCTXT *pctxt, OSREAL value, const OSDecimalFmt *pFmtSpec) |
This function encodes a value of the XSD decimal type. | |
EXTERNJSON int | rtJsonEncDoubleValue (OSCTXT *pctxt, OSREAL value, const OSDoubleFmt *pFmtSpec) |
This function encodes a value of the XSD double or float type. | |
EXTERNJSON int | rtJsonEncFloatValue (OSCTXT *pctxt, OSREAL value, const OSDoubleFmt *pFmtSpec) |
This function encodes a variable of the XSD float type. | |
EXTERNJSON int | rtJsonEncHexStr (OSCTXT *pctxt, OSUINT32 nocts, const OSOCTET *data) |
This function encodes a variable of the XSD hexBinary type. | |
EXTERNJSON int | rtJsonEncIndent (OSCTXT *pctxt) |
This function adds indentation whitespace to the output stream. | |
EXTERNJSON int | rtJsonEncStringObject (OSCTXT *pctxt, const OSUTF8CHAR *name, const OSUTF8CHAR *value) |
This function encodes a JSON object containing a string value. | |
EXTERNJSON int | rtJsonEncStringObject2 (OSCTXT *pctxt, const OSUTF8CHAR *name, size_t nameLen, const OSUTF8CHAR *value, size_t valueLen) |
This function encodes a JSON object containing a string value. | |
EXTERNJSON int | rtJsonEncStringPair (OSCTXT *pctxt, const OSUTF8CHAR *name, const OSUTF8CHAR *value) |
This function encodes a name/value pair. | |
EXTERNJSON int | rtJsonEncStringPair2 (OSCTXT *pctxt, const OSUTF8CHAR *name, size_t nameLen, const OSUTF8CHAR *value, size_t valueLen) |
This function encodes a name/value pair. | |
EXTERNJSON int | rtJsonEncStringValue (OSCTXT *pctxt, const OSUTF8CHAR *value) |
This function encodes a variable of the XSD string type. | |
EXTERNJSON int | rtJsonEncStringValue2 (OSCTXT *pctxt, const OSUTF8CHAR *value, size_t valueLen) |
This function encodes a variable of the XSD string type. | |
EXTERNJSON int | rtJsonEncUnicodeData (OSCTXT *pctxt, const OSUNICHAR *value, OSUINT32 nchars) |
This function encodes a variable of Unicode value. | |
EXTERNJSON int | rtJsonEncUIntValue (OSCTXT *pctxt, OSUINT32 value) |
This function encodes a variable of the XSD unsigned integer type. | |
EXTERNJSON int | rtJsonEncUInt64Value (OSCTXT *pctxt, OSUINT64 value) |
This function encodes a variable of the XSD integer type. |
Function Documentation
EXTERNJSON int rtJsonEncAnyAttr | ( | OSCTXT * | pctxt, | |
const OSRTDList * | pvalue | |||
) |
This function encodes a list of OSAnyAttr attributes in which the name and value are given as a UTF-8 string.
- Parameters:
-
pctxt Pointer to context block structure. pvalue List of attributes.
- Returns:
- Completion status of operation:
- 0 = success,
- negative return value is error.
EXTERNJSON int rtJsonEncBase64StrValue | ( | OSCTXT * | pctxt, | |
OSUINT32 | nocts, | |||
const OSOCTET * | value | |||
) |
This function encodes a variable of the XSD base64Binary type.
- Parameters:
-
pctxt Pointer to context block structure. nocts Number of octets in the value string. value Value to be encoded.
- Returns:
- Completion status of operation:
- 0 = success,
- negative return value is error.
EXTERNJSON int rtJsonEncBoolValue | ( | OSCTXT * | pctxt, | |
OSBOOL | value | |||
) |
This function encodes a variable of the XSD boolean type.
- Parameters:
-
pctxt Pointer to context block structure. value Boolean value to be encoded.
- Returns:
- Completion status of operation:
- 0 = success,
- negative return value is error.
EXTERNJSON int rtJsonEncDate | ( | OSCTXT * | pctxt, | |
const OSXSDDateTime * | pvalue | |||
) |
This function encodes a variable of the XSD 'date' type as a string.
This version of the function is used to encode an OSXSDDateTime value into CCYY-MM-DD format.
- Parameters:
-
pctxt Pointer to context block structure. pvalue OSXSDDateTime type pointer points to a OSXSDDateTime value to be encoded.
- Returns:
- Completion status of operation:
- 0 = success,
- negative return value is error.
EXTERNJSON int rtJsonEncDateTime | ( | OSCTXT * | pctxt, | |
const OSXSDDateTime * | pvalue | |||
) |
This function encodes a numeric date/time value into a string representation.
- Parameters:
-
pctxt Pointer to context block structure. pvalue Pointer to value to be encoded.
- Returns:
- Completion status of operation:
- 0 = success,
- negative return value is error.
EXTERNJSON int rtJsonEncDecimalValue | ( | OSCTXT * | pctxt, | |
OSREAL | value, | |||
const OSDecimalFmt * | pFmtSpec | |||
) |
This function encodes a value of the XSD decimal type.
- Parameters:
-
pctxt Pointer to context block structure. value Value to be encoded. pFmtSpec Pointer to format specification structure.
- Returns:
- Completion status of operation:
- 0 = success,
- negative return value is error.
EXTERNJSON int rtJsonEncDoubleValue | ( | OSCTXT * | pctxt, | |
OSREAL | value, | |||
const OSDoubleFmt * | pFmtSpec | |||
) |
This function encodes a value of the XSD double or float type.
- Parameters:
-
pctxt Pointer to context block structure. value Value to be encoded. pFmtSpec Pointer to format specification structure.
- Returns:
- Completion status of operation:
- 0 = success,
- negative return value is error.
EXTERNJSON int rtJsonEncFloatValue | ( | OSCTXT * | pctxt, | |
OSREAL | value, | |||
const OSDoubleFmt * | pFmtSpec | |||
) |
This function encodes a variable of the XSD float type.
- Parameters:
-
pctxt Pointer to context block structure. value Value to be encoded. pFmtSpec Pointer to format specification structure.
- Returns:
- Completion status of operation:
- 0 = success,
- negative return value is error.
EXTERNJSON int rtJsonEncGDay | ( | OSCTXT * | pctxt, | |
const OSXSDDateTime * | pvalue | |||
) |
This function encodes a numeric gDay value into a JSON string representation.
- Parameters:
-
pctxt Pointer to context block structure. pvalue Pointer to value to be encoded.
- Returns:
- Completion status of operation:
- 0 = success,
- negative return value is error.
EXTERNJSON int rtJsonEncGMonth | ( | OSCTXT * | pctxt, | |
const OSXSDDateTime * | pvalue | |||
) |
This function encodes a numeric gMonth value into a JSON string representation.
- Parameters:
-
pctxt Pointer to context block structure. pvalue Pointer to value to be encoded.
- Returns:
- Completion status of operation:
- 0 = success,
- negative return value is error.
EXTERNJSON int rtJsonEncGMonthDay | ( | OSCTXT * | pctxt, | |
const OSXSDDateTime * | pvalue | |||
) |
This function encodes a numeric gMonthDay value into a JSON string representation.
- Parameters:
-
pctxt Pointer to context block structure. pvalue Pointer to value to be encoded.
- Returns:
- Completion status of operation:
- 0 = success,
- negative return value is error.
EXTERNJSON int rtJsonEncGYear | ( | OSCTXT * | pctxt, | |
const OSXSDDateTime * | pvalue | |||
) |
This function encodes a numeric gYear value into a JSON string representation.
- Parameters:
-
pctxt Pointer to context block structure. pvalue Pointer to value to be encoded.
- Returns:
- Completion status of operation:
- 0 = success,
- negative return value is error.
EXTERNJSON int rtJsonEncGYearMonth | ( | OSCTXT * | pctxt, | |
const OSXSDDateTime * | pvalue | |||
) |
This function encodes a numeric gYearMonth value into a JSON string representation.
- Parameters:
-
pctxt Pointer to context block structure. pvalue Pointer to value to be encoded.
- Returns:
- Completion status of operation:
- 0 = success,
- negative return value is error.
EXTERNJSON int rtJsonEncHexStr | ( | OSCTXT * | pctxt, | |
OSUINT32 | nocts, | |||
const OSOCTET * | data | |||
) |
This function encodes a variable of the XSD hexBinary type.
- Parameters:
-
pctxt Pointer to context block structure. nocts Number of octets in the value string. data Value to be encoded.
- Returns:
- Completion status of operation:
- 0 = success,
- negative return value is error.
EXTERNJSON int rtJsonEncIndent | ( | OSCTXT * | pctxt | ) |
This function adds indentation whitespace to the output stream.
The amount of indentation to add is determined by the level member variable in the context structure and the OSXMLINDENT constant value.
- Parameters:
-
pctxt Pointer to context block structure.
- Returns:
- Completion status of operation:
- 0 = success,
- negative return value is error.
EXTERNJSON int rtJsonEncInt64Value | ( | OSCTXT * | pctxt, | |
OSINT64 | value | |||
) |
This function encodes a variable of the XSD integer type.
This version of the function is used for 64-bit integer values.
- Parameters:
-
pctxt Pointer to context block structure. value Value to be encoded.
- Returns:
- Completion status of operation:
- 0 = success,
- negative return value is error.
EXTERNJSON int rtJsonEncIntValue | ( | OSCTXT * | pctxt, | |
OSINT32 | value | |||
) |
This function encodes a variable of the XSD integer type.
- Parameters:
-
pctxt Pointer to context block structure. value Value to be encoded.
- Returns:
- Completion status of operation:
- 0 = success,
- negative return value is error.
EXTERNJSON int rtJsonEncStringObject | ( | OSCTXT * | pctxt, | |
const OSUTF8CHAR * | name, | |||
const OSUTF8CHAR * | value | |||
) |
This function encodes a JSON object containing a string value.
- Parameters:
-
pctxt Pointer to context block structure. name Name token to be encoded. value Value as a character string to be encoded.
- Returns:
- Completion status of operation:
- 0 = success,
- negative return value is error.
EXTERNJSON int rtJsonEncStringObject2 | ( | OSCTXT * | pctxt, | |
const OSUTF8CHAR * | name, | |||
size_t | nameLen, | |||
const OSUTF8CHAR * | value, | |||
size_t | valueLen | |||
) |
This function encodes a JSON object containing a string value.
- Parameters:
-
pctxt Pointer to context block structure. name Name token to be encoded. nameLen Length of the name token to be encoded. value Value as a character string to be encoded. valueLen Length of the value to be encoded.
- Returns:
- Completion status of operation:
- 0 = success,
- negative return value is error.
EXTERNJSON int rtJsonEncStringPair | ( | OSCTXT * | pctxt, | |
const OSUTF8CHAR * | name, | |||
const OSUTF8CHAR * | value | |||
) |
This function encodes a name/value pair.
The value is a character string.
- Parameters:
-
pctxt Pointer to context block structure. name Name token to be encoded. value Value as a character string to be encoded.
- Returns:
- Completion status of operation:
- 0 = success,
- negative return value is error.
EXTERNJSON int rtJsonEncStringPair2 | ( | OSCTXT * | pctxt, | |
const OSUTF8CHAR * | name, | |||
size_t | nameLen, | |||
const OSUTF8CHAR * | value, | |||
size_t | valueLen | |||
) |
This function encodes a name/value pair.
The value is a character string.
- Parameters:
-
pctxt Pointer to context block structure. name Name token to be encoded. nameLen Length of the name token to be encoded. value Value as a character string to be encoded. valueLen Length of the value to be encoded.
- Returns:
- Completion status of operation:
- 0 = success,
- negative return value is error.
EXTERNJSON int rtJsonEncStringValue | ( | OSCTXT * | pctxt, | |
const OSUTF8CHAR * | value | |||
) |
This function encodes a variable of the XSD string type.
- Parameters:
-
pctxt Pointer to context block structure. value XML string value to be encoded.
- Returns:
- Completion status of operation:
- 0 = success,
- negative return value is error.
EXTERNJSON int rtJsonEncStringValue2 | ( | OSCTXT * | pctxt, | |
const OSUTF8CHAR * | value, | |||
size_t | valueLen | |||
) |
This function encodes a variable of the XSD string type.
- Parameters:
-
pctxt Pointer to context block structure. value XML string value to be encoded. valueLen Length of the XML string to be encoded.
- Returns:
- Completion status of operation:
- 0 = success,
- negative return value is error.
EXTERNJSON int rtJsonEncTime | ( | OSCTXT * | pctxt, | |
const OSXSDDateTime * | pvalue | |||
) |
This function encodes a variable of the XSD 'time' type as a JSON string.
- Parameters:
-
pctxt Pointer to context block structure. pvalue OSXSDDateTime type pointer points to a OSXSDDateTime value to be encoded.
- Returns:
- Completion status of operation:
- 0 = success,
- negative return value is error.
EXTERNJSON int rtJsonEncUInt64Value | ( | OSCTXT * | pctxt, | |
OSUINT64 | value | |||
) |
This function encodes a variable of the XSD integer type.
This version of the function is used when constraints cause an unsigned 64-bit integer variable to be used.
- Parameters:
-
pctxt Pointer to context block structure. value Value to be encoded.
- Returns:
- Completion status of operation:
- 0 = success,
- negative return value is error.
EXTERNJSON int rtJsonEncUIntValue | ( | OSCTXT * | pctxt, | |
OSUINT32 | value | |||
) |
This function encodes a variable of the XSD unsigned integer type.
- Parameters:
-
pctxt Pointer to context block structure. value Value to be encoded.
- Returns:
- Completion status of operation:
- 0 = success,
- negative return value is error.
EXTERNJSON int rtJsonEncUnicodeData | ( | OSCTXT * | pctxt, | |
const OSUNICHAR * | value, | |||
OSUINT32 | nchars | |||
) |
This function encodes a variable of Unicode value.
- Parameters:
-
pctxt Pointer to context block structure. value Unicode characters to be encoded. nchars Number of Unicode characters to be encoded.
- Returns:
- Completion status of operation:
- 0 = success,
- negative return value is error.