Add String

Convenience Method

Declaration

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

Purpose

Add a field containing a string.

Remarks

The string cannot contain interior NULL bytes, because this method expects a NULL-terminated string. To add a string with interior NULL bytes, use the generic method TibrvMsg::addField().

Parameter

Description

fieldName

Create the new field with this name.

value

Add a new field that contains this string (which may be a literal or stored in a variable).

The method copies the data into the new field.

fieldId

Create the new 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.

It is illegal to add a field that has both a NULL field name, and a non-zero field identifier.