WebSphere Message Service Clients for C/C++ and .NET, Version 1.2 Operating Systems: Linux, Windows

String

A String object encapsulates a string. This class is a helper class.

Inheritance hierarchy:
None

Constructors

Summary of constructors:
Constructor Description
String Create a String object that encapsulates a null string.
String Create a String object from an array of bytes.
String Create a String object from an array of characters.

String – Create String

Interface:
String();

Create a String object that encapsulates a null string.

Parameters:
None
Thread context:
Any
Exceptions:
  • XMS_X_GENERAL_EXCEPTION

String – Create String (from a byte array)

Interface:
String(const xmsSBYTE *value,
       const xmsINT length);

Create a String object from an array of bytes.

Parameters:
value (input)
The array of bytes that is copied to form the string encapsulated by the String object.
length (input)
The number of bytes in the array.
Thread context:
Any
Exceptions:
  • XMS_X_GENERAL_EXCEPTION

String – Create String (from a character array)

Interface:
String(const xmsCHAR *value);

Create a String object from an array of characters.

Parameters:
value (input)
The null terminated array of characters that is copied to form the string encapsulated by the String object.
Thread context:
Any
Exceptions:
  • XMS_X_GENERAL_EXCEPTION

Methods

Summary of methods:
Method Description
~String Delete the String object.
c_str Get a pointer to the string encapsulated by the String object.
concatenate Concatenate the string encapsulated by the String object with the string encapsulated by a second String object.
equalTo Determine whether the string encapsulated by the String object is equal to the string encapsulated by a second String object.
get Get the string encapsulated by the String object.
isNull Determine whether the String object is a null object.

~String – Delete String

Interface:
virtual ~String();

Delete the String object.

Parameters:
None
Thread context:
Any
Exceptions:
  • XMS_X_GENERAL_EXCEPTION

c_str – Get Pointer to String

Interface:
xmsCHAR * c_str() const;

Get a pointer to the string encapsulated by the String object.

Parameters:
None
Returns:
A pointer to the string encapsulated by the String object.
Thread context:
Any
Exceptions:
  • XMS_X_GENERAL_EXCEPTION

concatenate – Concatenate Strings

Interface:
String & concatenate(const String & string) const;

Concatenate the string encapsulated by the String object with the string encapsulated by a second String object.

Parameters:
string (input)
The second String object.
Returns:
The original String object encapsulating the concatenated strings.
Thread context:
Any
Exceptions:
  • XMS_X_GENERAL_EXCEPTION

equalTo – Compare Strings

Interface:
xmsBOOL equalTo(const String & string) const;

Determine whether the string encapsulated by the String object is equal to the string encapsulated by a second String object.

Parameters:
string (input)
The second String object.
Returns:
  • xmsTRUE, if the two strings are equal.
  • xmsFALSE, if the two strings are not equal.
Thread context:
Any
Exceptions:
  • XMS_X_GENERAL_EXCEPTION

get – Get String

Interface:
xmsVOID get(xmsSBYTE *value,
            const xmsINT length,
            xmsINT *actualLength) const;

Get the string encapsulated by the String object.

For more information about how to use this method, see C++ methods that return a byte array.

Parameters:
value (output)
The buffer to contain the string.
length (input)
The length of the buffer in bytes. If you specify XMSC_QUERY_SIZE instead, the string is not returned, but its length is returned in the actualLength parameter.
actualLength (output)
The length of the string in bytes. If you specify a null pointer on input, the length is not returned.
Returns:
Void
Thread context:
Any
Exceptions:
  • XMS_X_GENERAL_EXCEPTION

isNull – Check Whether Null

Interface:
xmsBOOL isNull() const;

Determine whether the String object is a null object.

Parameters:
None
Returns:
  • xmsTRUE, if the String object is a null object.
  • xmsFALSE, if the String object is not a null object.
Thread context:
Any
Exceptions:
  • XMS_X_GENERAL_EXCEPTION

Reference topic

Terms of Use | Rate this page

Last updated: 7 Dec 2005

© Copyright IBM Corporation 2005. All Rights Reserved.