Dynatrace OneAgent SDK for C/C++  1.7.1.1
Classes | Typedefs
Strings

See onesdk_string_t for more information about SDK strings. More...

Classes

struct  onesdk_string_t
 Represents a reference to string data in a user specified encoding. More...
 

Typedefs

typedef uint16_t onesdk_ccsid_t
 Used to store CCSID values.
 

CCSID Constants

#define ONESDK_CCSID_NULL   ((onesdk_ccsid_t) 0)
 Special "NULL" CCSID value. More...
 
#define ONESDK_CCSID_ASCII   ((onesdk_ccsid_t) 367)
 CCSID value for 7 bit ASCII text.
 
#define ONESDK_CCSID_ISO8859_1   ((onesdk_ccsid_t) 819)
 CCSID value for ISO/IEC 8859-1 aka Latin-1 encoded text.
 
#define ONESDK_CCSID_UTF8   ((onesdk_ccsid_t)1209)
 CCSID value for UTF-8 encoded text.
 
#define ONESDK_CCSID_UTF16_BE   ((onesdk_ccsid_t)1201)
 CCSID value for UTF-16 Big Endian encoded text.
 
#define ONESDK_CCSID_UTF16_LE   ((onesdk_ccsid_t)1203)
 CCSID value for UTF-16 Little Endian encoded text.
 
#define ONESDK_CCSID_UTF16_NATIVE
 CCSID for UTF-16 text with the native endianness (either ONESDK_CCSID_UTF16_LE or ONESDK_CCSID_UTF16_BE).
 

String Constructors

onesdk_string_t onesdk_str (void const *data, onesdk_size_t byte_length, onesdk_ccsid_t ccsid)
 Creates a onesdk_string_t. More...
 
onesdk_string_t onesdk_bytestr (char const *data, onesdk_ccsid_t ccsid)
 Creates a onesdk_string_t for a byte string. More...
 
onesdk_string_t onesdk_asciistr (char const *data)
 Creates a onesdk_string_t for an ASCII string. More...
 
onesdk_string_t onesdk_utf8str (char const *data)
 Creates a onesdk_string_t for a UTF-8 string. More...
 
onesdk_string_t onesdk_nullstr (void)
 Creates a onesdk_string_t designating a "null string". More...
 
onesdk_string_t onesdk_wstr (wchar_t const *data)
 Creates a onesdk_string_t for a wchar_t UTF-16 string using the native endianness. More...
 

Detailed Description

See onesdk_string_t for more information about SDK strings.

Macro Definition Documentation

◆ ONESDK_CCSID_NULL

#define ONESDK_CCSID_NULL   ((onesdk_ccsid_t) 0)

Special "NULL" CCSID value.

Used to build "NULL strings". If ONESDK_CCSID_NULL is used in a onesdk_string_t::ccsid, onesdk_string_t::byte_length must be zero.

See also
onesdk_string_t.

Function Documentation

◆ onesdk_asciistr()

onesdk_string_t onesdk_asciistr ( char const *  data)
inline

Creates a onesdk_string_t for an ASCII string.

Parameters
dataPointer to the ASCII string data. Must be NULL or point to a null-terminated buffer.
Returns
onesdk_bytestr(data, ONESDK_CCSID_ASCII)
See also
onesdk_bytestr

◆ onesdk_bytestr()

onesdk_string_t onesdk_bytestr ( char const *  data,
onesdk_ccsid_t  ccsid 
)
inline

Creates a onesdk_string_t for a byte string.

Parameters
dataPointer to the string data. Must be NULL or point to a null-terminated buffer.
ccsidSpecifies the encoding of the string data.
Returns
A onesdk_string_t that points to the string.

This function computes the length of the string as byte_length = strlen(data) and then builds the return value by calling onesdk_str(data, byte_length, ccsid).

See also
onesdk_str

◆ onesdk_nullstr()

onesdk_string_t onesdk_nullstr ( void  )
inline

Creates a onesdk_string_t designating a "null string".

Returns
onesdk_str(NULL, 0, ONESDK_CCSID_NULL)
See also
onesdk_str

◆ onesdk_str()

onesdk_string_t onesdk_str ( void const *  data,
onesdk_size_t  byte_length,
onesdk_ccsid_t  ccsid 
)
inline

Creates a onesdk_string_t.

Parameters
dataSee onesdk_string_t::data
byte_lengthSee onesdk_string_t::byte_length
ccsidSee onesdk_string_t::ccsid
Returns
A onesdk_string_t with the specified fields.
See also
onesdk_string_t.

◆ onesdk_utf8str()

onesdk_string_t onesdk_utf8str ( char const *  data)
inline

Creates a onesdk_string_t for a UTF-8 string.

Parameters
dataPointer to the UTF-8 string data. Must be NULL or point to a null-terminated buffer.
Returns
onesdk_bytestr(data, ONESDK_CCSID_UTF8)
See also
onesdk_bytestr

◆ onesdk_wstr()

onesdk_string_t onesdk_wstr ( wchar_t const *  data)
inline

Creates a onesdk_string_t for a wchar_t UTF-16 string using the native endianness.

Parameters
dataPointer to the UTF-16 string data. Must be NULL or point to a null-terminated buffer.
Returns
A onesdk_string_t that points to the string.

This function is only available on Windows.

This function computes the length of the string as byte_length = wcslen(data) * 2 and then builds the return value by calling onesdk_str(data, byte_length, ONESDK_CCSID_UTF16_NATIVE).

Note
The string pointed to by data must be terminated by a wchar_t with value zero (=two bytes with value zero).
See also
onesdk_str