String Interface.
More...
String Interface.
◆ OSAPI_String_length()
Return length of ASCIIZ string.
Return length of ASCIIZ string not including \0.
- Parameters
-
| s | <<in>> Pointer to beginning of byte string. |
- Returns
- Length of string not including \0.
References RTI_INT32.
◆ OSAPI_String_cmp()
| RTI_INT32 OSAPI_String_cmp |
( |
const char * | left, |
|
|
const char * | right ) |
Compare two ASCIIZ strings.
Lexicographically compare the null-terminated strings left and right. The comparison is using unsigned arithmetic.
- Parameters
-
- Returns
- 0 if the strings are identical, a positive integer if left is greater then right, and a negative integer if left less then right.
References RTI_INT32.
◆ OSAPI_String_ncmp()
Compare at most num characters of two ASCII strings.
Lexicographically compare null-terminated strings left and right, including up to num characters (if the null terminator is not found before the specified number of characters has been compared). The comparison uses unsigned arithmetic.
- Parameters
-
| left | <<in>> Left side string. |
| right | <<in>> Right side string. |
| num | <<in>> Maximum number of characters to compare. |
- Returns
- 0 if the strings are identical, a positive integer if left is greater than right, and a negative integer if left is less than right.
◆ OSAPI_String_parse_unsigned_long()
| RTI_BOOL OSAPI_String_parse_unsigned_long |
( |
const char * | str, |
|
|
unsigned int * | result ) |
Parse an unsigned long integer from a string.
- Parameters
-
| [in] | str | Null-terminated string to parse. Cannot be NULL. |
| [out] | result | Pointer to store the parsed unsigned integer. Cannot be NULL. Only valid if RTI_TRUE is returned. |
- Returns
- RTI_TRUE if the string was successfully parsed, RTI_FALSE otherwise.
◆ OSAPI_String_parse_unsigned_long_long()
| RTI_BOOL OSAPI_String_parse_unsigned_long_long |
( |
const char * | str, |
|
|
unsigned long long int * | result ) |
Parse an unsigned long long integer from a string.
- Parameters
-
| [in] | str | Null-terminated string to parse. Cannot be NULL. |
| [out] | result | Pointer to store the parsed unsigned long long integer. Cannot be NULL. Only valid if RTI_TRUE is returned. |
- Returns
- RTI_TRUE if the string was successfully parsed, RTI_FALSE otherwise.
◆ OSAPI_String_char_to_lowercase()
| int OSAPI_String_char_to_lowercase |
( |
const int | c | ) |
|
Convert a character to lowercase.
- Parameters
-
| [in] | c | Character to convert. Must be representable as an unsigned char or equal to EOF. |
- Returns
- The lowercase equivalent of c if c is an uppercase letter, otherwise c is returned unchanged.
- MT Safety:
- SAFE
◆ OSAPI_String_strchr()
| char * OSAPI_String_strchr |
( |
const char * | s, |
|
|
int | c ) |
Locate character in string.
- Parameters
-
| [in] | s | Null-terminated string to search. Cannot be NULL. |
| [in] | c | Character to search for. |
- Returns
- Pointer to the first occurrence of c in s, or NULL if c is not found.
◆ OSAPI_String_length_w_max()
Return length of ASCII string with maximum limit.
Return the length of a null-terminated string.
- Parameters
-
| [in] | s | Pointer to beginning of byte string. Cannot be NULL. |
| [in] | max | Maximum number of characters to examine. |
- Returns
- Length of string not including '\0' if null terminator is found within max characters, otherwise max.
- MT Safety:
- SAFE