XBinder  Version 2.9.x
Functions
Text Reading and Writing Functions

These functions support working with a textual representation of values. More...

Functions

EXTERNRT int rtxTxtMatchChar (OSCTXT *pctxt, OSUTF8CHAR ch, OSBOOL skipWs)
 This function matches the given character or logs and returns an error. More...
 
EXTERNRT int rtxTxtMatchChars (OSCTXT *pctxt, const OSUTF8CHAR *chars, OSBOOL skipWs)
 This function matches the given characters or logs and returns an error. More...
 
EXTERNRT int rtxTxtPeekChar (OSCTXT *pctxt, OSUTF8CHAR *pch, OSBOOL skipWs)
 This function determines the next character in the input. More...
 
EXTERNRT char rtxTxtPeekChar2 (OSCTXT *pctxt, OSBOOL skipWs)
 This function determines the next character in the input. More...
 
EXTERNRT int rtxTxtSkipWhitespace (OSCTXT *pctxt)
 This function skips any whitespace in the input. More...
 
EXTERNRT int rtxTxtReadBigInt (OSCTXT *pctxt, char **ppvalue)
 This function reads an integer, using standard decimal notation, into a character string. More...
 
EXTERNRT int rtxTxtReadInt8 (OSCTXT *pctxt, OSINT8 *pvalue)
 This function reads an integer, using standard decimal notation, into an 8-bit signed integer. More...
 
EXTERNRT int rtxTxtReadInt16 (OSCTXT *pctxt, OSINT16 *pvalue)
 This function reads an integer, using standard decimal notation, into an 16-bit signed integer. More...
 
EXTERNRT int rtxTxtReadInt32 (OSCTXT *pctxt, OSINT32 *pvalue)
 This function reads an integer, using standard decimal notation, into an 32-bit signed integer. More...
 
EXTERNRT int rtxTxtReadInt64 (OSCTXT *pctxt, OSINT64 *pvalue)
 This function reads an integer, using standard decimal notation, into an 64-bit signed integer. More...
 
EXTERNRT int rtxTxtReadUInt8 (OSCTXT *pctxt, OSUINT8 *pvalue)
 This function reads an integer, using standard decimal notation, into an 8-bit unsigned integer. More...
 
EXTERNRT int rtxTxtReadUInt16 (OSCTXT *pctxt, OSUINT16 *pvalue)
 This function reads an integer, using standard decimal notation, into an 16-bit unsigned integer. More...
 
EXTERNRT int rtxTxtReadUInt32 (OSCTXT *pctxt, OSUINT32 *pvalue)
 This function reads an integer, using standard decimal notation, into an 32-bit unsigned integer. More...
 
EXTERNRT int rtxTxtReadUInt64 (OSCTXT *pctxt, OSUINT64 *pvalue)
 This function reads an integer, using standard decimal notation, into an 64-bit unsigned integer. More...
 
EXTERNRT int rtxTxtWriteInt (OSCTXT *pctxt, OSINT32 value)
 This writes a 32-bit signed integer to the buffer using standard decimal (base 10) notation. More...
 
EXTERNRT int rtxTxtWriteInt64 (OSCTXT *pctxt, OSINT64 value)
 This writes a 64-bit signed integer to the buffer using standard decimal (base 10) notation. More...
 
EXTERNRT int rtxTxtWriteUInt (OSCTXT *pctxt, OSUINT32 value)
 This writes a 32-bit unsigned integer to the buffer using standard decimal (base 10) notation. More...
 
EXTERNRT int rtxTxtWriteUInt64 (OSCTXT *pctxt, OSUINT64 value)
 This writes a 64-bit unsigned integer to the buffer using standard decimal (base 10) notation. More...
 

Detailed Description

These functions support working with a textual representation of values.

Values of various C/C++ types can be written to, or read from, the context buffer, with the buffer holding a text representation.

Function Documentation

◆ rtxTxtMatchChar()

EXTERNRT int rtxTxtMatchChar ( OSCTXT pctxt,
OSUTF8CHAR  ch,
OSBOOL  skipWs 
)

This function matches the given character or logs and returns an error.

You may optionally choose to skip any leading whitespace.

Parameters
pctxtPointer to context block structure.
chThe character to be matched.
skipWsIf TRUE, skip any leading whitespace.
Returns
Completion status of operation:
  • 0 = success,
  • RTERR_INVCHAR = different character found
  • negative return value is error.

◆ rtxTxtMatchChars()

EXTERNRT int rtxTxtMatchChars ( OSCTXT pctxt,
const OSUTF8CHAR *  chars,
OSBOOL  skipWs 
)

This function matches the given characters or logs and returns an error.

You may optionally choose to skip any leading whitespace.

Parameters
pctxtPointer to context block structure.
charsThe characters to be matched.
skipWsIf TRUE, skip any leading whitespace.
Returns
Completion status of operation:
  • 0 = success,
  • RTERR_INVCHAR = different character found
  • negative return value is error.

◆ rtxTxtPeekChar()

EXTERNRT int rtxTxtPeekChar ( OSCTXT pctxt,
OSUTF8CHAR *  pch,
OSBOOL  skipWs 
)

This function determines the next character in the input.

You may optionally skip any whitespace and peek at the first non-whitespace character. Skipping whitespace consumes it.

It is an error if EOF prevents a character from being returned.

Parameters
pctxtPointer to OSCTXT structure
pchA pointer to a variable to receive the next character.
Returns
Completion status of operation:
  • 0 = success,
  • negative return value is error.

◆ rtxTxtPeekChar2()

EXTERNRT char rtxTxtPeekChar2 ( OSCTXT pctxt,
OSBOOL  skipWs 
)

This function determines the next character in the input.

You may optionally skip any whitespace and peek at the first non-whitespace character. Skipping whitespace consumes it.

It is an error if EOF prevents a character from being returned.

Parameters
pctxtPointer to OSCTXT structure
Returns
The peeked character, or null if there is a failure. The error will be logged in the context.

◆ rtxTxtReadBigInt()

EXTERNRT int rtxTxtReadBigInt ( OSCTXT pctxt,
char **  ppvalue 
)

This function reads an integer, using standard decimal notation, into a character string.

Leading whitespace is consumed.

This recognizes an optional minus sign, followed by 1 or more digits, with no superfluous leading zeros.

Parameters
pctxtPointer to context block structure.
ppvaluePointer to string to receive newly allocated string with decoded result.
Returns
Completion status of operation:
  • 0 = success,
  • negative return value is error.

◆ rtxTxtReadInt16()

EXTERNRT int rtxTxtReadInt16 ( OSCTXT pctxt,
OSINT16 *  pvalue 
)

This function reads an integer, using standard decimal notation, into an 16-bit signed integer.

Leading whitespace is consumed.

This recognizes an optional minus sign, followed by 1 or more digits, with no superfluous leading zeros.

Parameters
pctxtPointer to context block structure.
pvaluePointer to 16-bit integer value to receive decoded result.
Returns
Completion status of operation:
  • 0 = success,
  • negative return value is error.

◆ rtxTxtReadInt32()

EXTERNRT int rtxTxtReadInt32 ( OSCTXT pctxt,
OSINT32 *  pvalue 
)

This function reads an integer, using standard decimal notation, into an 32-bit signed integer.

Leading whitespace is consumed.

This recognizes an optional minus sign, followed by 1 or more digits, with no superfluous leading zeros.

Parameters
pctxtPointer to context block structure.
pvaluePointer to 32-bit integer value to receive decoded result.
Returns
Completion status of operation:
  • 0 = success,
  • negative return value is error.

◆ rtxTxtReadInt64()

EXTERNRT int rtxTxtReadInt64 ( OSCTXT pctxt,
OSINT64 *  pvalue 
)

This function reads an integer, using standard decimal notation, into an 64-bit signed integer.

Leading whitespace is consumed.

This recognizes an optional minus sign, followed by 1 or more digits, with no superfluous leading zeros.

Parameters
pctxtPointer to context block structure.
pvaluePointer to 64-bit integer value to receive decoded result.
Returns
Completion status of operation:
  • 0 = success,
  • negative return value is error.

◆ rtxTxtReadInt8()

EXTERNRT int rtxTxtReadInt8 ( OSCTXT pctxt,
OSINT8 *  pvalue 
)

This function reads an integer, using standard decimal notation, into an 8-bit signed integer.

Leading whitespace is consumed.

This recognizes an optional minus sign, followed by 1 or more digits, with no superfluous leading zeros.

Parameters
pctxtPointer to context block structure.
pvaluePointer to 8-bit integer value to receive decoded result.
Returns
Completion status of operation:
  • 0 = success,
  • negative return value is error.

◆ rtxTxtReadUInt16()

EXTERNRT int rtxTxtReadUInt16 ( OSCTXT pctxt,
OSUINT16 *  pvalue 
)

This function reads an integer, using standard decimal notation, into an 16-bit unsigned integer.

Leading whitespace is consumed.

This recognizes 1 or more digits, with no superfluous leading zeros.

Parameters
pctxtPointer to context block structure.
pvaluePointer to 16-bit unsigned integer value to receive decoded result.
Returns
Completion status of operation:
  • 0 = success,
  • negative return value is error.

◆ rtxTxtReadUInt32()

EXTERNRT int rtxTxtReadUInt32 ( OSCTXT pctxt,
OSUINT32 *  pvalue 
)

This function reads an integer, using standard decimal notation, into an 32-bit unsigned integer.

Leading whitespace is consumed.

This recognizes 1 or more digits, with no superfluous leading zeros.

Parameters
pctxtPointer to context block structure.
pvaluePointer to 32-bit unsigned integer value to receive decoded result.
Returns
Completion status of operation:
  • 0 = success,
  • negative return value is error.

◆ rtxTxtReadUInt64()

EXTERNRT int rtxTxtReadUInt64 ( OSCTXT pctxt,
OSUINT64 *  pvalue 
)

This function reads an integer, using standard decimal notation, into an 64-bit unsigned integer.

Leading whitespace is consumed.

This recognizes 1 or more digits, with no superfluous leading zeros.

Parameters
pctxtPointer to context block structure.
pvaluePointer to 64-bit unsigned integer value to receive decoded result.
Returns
Completion status of operation:
  • 0 = success,
  • negative return value is error.

◆ rtxTxtReadUInt8()

EXTERNRT int rtxTxtReadUInt8 ( OSCTXT pctxt,
OSUINT8 *  pvalue 
)

This function reads an integer, using standard decimal notation, into an 8-bit unsigned integer.

Leading whitespace is consumed.

This recognizes 1 or more digits, with no superfluous leading zeros.

Parameters
pctxtPointer to context block structure.
pvaluePointer to 8-bit unsigned integer value to receive decoded result.
Returns
Completion status of operation:
  • 0 = success,
  • negative return value is error.

◆ rtxTxtSkipWhitespace()

EXTERNRT int rtxTxtSkipWhitespace ( OSCTXT pctxt)

This function skips any whitespace in the input.

Parameters
pctxtPointer to OSCTXT structure
Returns
Completion status of operation:
  • 0 = success,
  • negative return value is error.

◆ rtxTxtWriteInt()

EXTERNRT int rtxTxtWriteInt ( OSCTXT pctxt,
OSINT32  value 
)

This writes a 32-bit signed integer to the buffer using standard decimal (base 10) notation.

A sign is used only for negative values.

Parameters
pctxtPointer to context block structure.
valueValue to be encoded.
Returns
Completion status of operation:
  • 0 = success,
  • negative return value is error.

◆ rtxTxtWriteInt64()

EXTERNRT int rtxTxtWriteInt64 ( OSCTXT pctxt,
OSINT64  value 
)

This writes a 64-bit signed integer to the buffer using standard decimal (base 10) notation.

A sign is used only for negative values.

Parameters
pctxtPointer to context block structure.
valueValue to be encoded.
Returns
Completion status of operation:
  • 0 = success,
  • negative return value is error.

◆ rtxTxtWriteUInt()

EXTERNRT int rtxTxtWriteUInt ( OSCTXT pctxt,
OSUINT32  value 
)

This writes a 32-bit unsigned integer to the buffer using standard decimal (base 10) notation.

No sign is used.

Parameters
pctxtPointer to context block structure.
valueValue to be encoded.
Returns
Completion status of operation:
  • 0 = success,
  • negative return value is error.

◆ rtxTxtWriteUInt64()

EXTERNRT int rtxTxtWriteUInt64 ( OSCTXT pctxt,
OSUINT64  value 
)

This writes a 64-bit unsigned integer to the buffer using standard decimal (base 10) notation.

No sign is used.

Parameters
pctxtPointer to context block structure.
valueValue to be encoded.
Returns
Completion status of operation:
  • 0 = success,
  • negative return value is error.