#include <string.h>
#include "ion_platform_config.h"
#include "ion_types.h"
Go to the source code of this file.
◆ DEFAULT_STRING_LENGTH
| #define DEFAULT_STRING_LENGTH 8 |
default for minimum alloc, 8 is average from IBM study
◆ ION_STRING_ASSIGN
| #define ION_STRING_ASSIGN |
( |
| dst, |
|
|
| src ) |
Value:(dst)->length = (src)->length; (dst)->value = (src)->value
◆ ION_STRING_CHAR_AT
| #define ION_STRING_CHAR_AT |
( |
| str, |
|
|
| ii ) |
Value:((ii) < (str)->length ? (str)->value[ii] : -1)
◆ ION_STRING_EQUALS
| #define ION_STRING_EQUALS |
( |
| x, |
|
|
| y ) |
Value:(((x) == (y)) || (((x)->length == (y)->length) && (memcmp((x)->value, (y)->value, (x)->length) == 0)))
◆ ION_STRING_INIT
| #define ION_STRING_INIT |
( |
| x | ) |
|
Value:(x)->length = 0; (x)->value = NULL
◆ ION_STRING_IS_NULL
| #define ION_STRING_IS_NULL |
( |
| x | ) |
|
Value:((x) == NULL || ((x)->value == NULL))
◆ ion_string_get_byte()
| ION_API_EXPORT BYTE ion_string_get_byte |
( |
ION_STRING * | str, |
|
|
int | idx ) |
Returns -1 is idx is out of range or str is null
◆ ion_string_get_bytes()
| ION_API_EXPORT BYTE * ion_string_get_bytes |
( |
ION_STRING * | str | ) |
|
Gets a pointer to the UTF-8 bytes held by the string. The number of bytes in the string is determined via ion_string_get_length().
- Parameters
-
- Returns
- a pointer to the first UTF-8 byte in the string; may be null. The byte sequence is not null-terminated.
◆ ion_string_get_length()
| ION_API_EXPORT int ion_string_get_length |
( |
ION_STRING * | str | ) |
|
Gets the number of UTF-8 bytes held by the string.
- Parameters
-
- Returns
- may be zero.