Get String

Convenience Method

Declaration

TibrvStatus getString(
    const char*    fieldName,
    char*&         value,
    tibrv_u16      fieldId=0);

Purpose

Get the value of a field as a character string.

Remarks

This convenience method retrieves a field and extracts its data, automatically converting it to a string.

Programs can use this method to obtain a printable representation of field data. For most datatypes, this method formats the full value of the field to the output string; these types are exceptions:

TIBRVMSG_OPAQUE

This method abbreviates the value of an opaque field; for example, [472 opaque bytes].

TIBRVMSG_XML

This method abbreviates the value of an XML field; for example, [XML document: 472 bytes].

The size measures uncompressed data.

Pointer data extracted from the field remain valid until the message is destroyed; that is, even removing the field or updating the field’s value does not invalidate pointer data.

This method produces values that are read-only snapshots of the field data (see Pointer Snapshot). Programs must not modify the value string.

Parameter

Description

fieldName

Get a field with this name.

value

The program supplies a variable in this parameter, and the method stores a pointer to the field value in that variable.

fieldId

Get the field with this identifier. Zero is a special value that signifies no field identifier. All non-zero field identifiers must be unique within each message.

See Also

Validity of Data Extracted From Message Fields

Field Names and Field Identifiers

Datatype Conversion