Binary and character strings in C++

The ImqString class encapsulates the traditional char * data format. The ImqBinary class encapsulates the binary byte array. Some methods that set character data might truncate the data.

Methods that set character ( char * ) data always take a copy of the data, but some methods might truncate the copy, because certain limits are imposed by IBM MQ .

The ImqString class (see ImqString C++ class ) encapsulates the traditional char * and provides support for:

  • Comparison
  • Concatenation
  • Copy
  • Integer-to-text and text-to-integer conversion
  • Token (word) extraction
  • Uppercase translation

The ImqBinary class (see ImqBinary C++ class ) encapsulates binary byte arrays of arbitrary size. In particular, it is used to hold the following attributes:

  • accounting token (MQBYTE32)
  • connection tag (MQBYTE128)
  • correlation id (MQBYTE24)
  • facility token (MQBYTE8)
  • group id (MQBYTE24)
  • instance id (MQBYTE24)
  • message id (MQBYTE24)
  • message token (MQBYTE16)
  • transaction instance id (MQBYTE16)

Where these attributes belong to objects of the following classes:

The ImqBinary class also provides support for comparison and copying. Parent topic: C++ language considerations