log_get_rsrc_message

Formats and writes to a buffer the message resource identified by msgKey, and returns the length of the buffer required to hold the entire formatted message.

This method facilitates storing localized messages in the database. Call log_get_rsrc_message to format the identified resource message into the named buffer.
  • If the buffer is large enough to contain the formatted message, the value pointed to by bufferLen is updated to reflect the number of bytes used in the buffer.
  • If the buffer is not large enough, the message is truncated in the available space, and the value pointed to by bufferLen is set to the number of bytes required to avoid truncation.
  • If the buffer length is 0, then a NULL buffer can be passed in to determine the length of the required buffer for the message, excluding the NUL terminator.

Syntax

uint16_t log_get_rsrc_message_force(char * buffer, size_t * bufferLen, log_rb_id rsrc_id, const char * msgKey, va_list& args)

Parameters

Returns

uint16_t error_code

An error code or ERR_NONE (value 0).

When successful, bufferLen contains the number of bytes used in the buffer (return value less than or equal to input value). If the error code indicates that the buffer was too small to hold the formatted message, the value in bufferLen is the number of bytes required to format the message string, excluding the null terminator (return value greater than input value).