Vector-like memory management of a collection of characters.
More...
|
static void const size_t | sz |
|
cstl_STRING_char_t size_t | i |
|
static int const cstl_STRING_char_t *const | str |
|
static int const struct cstl_STRING *const | s2 |
|
void size_t | pos |
|
void size_t size_t | cnt |
|
void size_t size_t cstl_STRING_char_t | ch |
|
void size_t const cstl_STRING_char_t size_t | n |
|
static void size_t const struct cstl_STRING * | ins |
|
static void const cstl_STRING_char_t *const const size_t | len |
|
void size_t size_t struct cstl_STRING * | ss |
|
ssize_t const cstl_STRING_char_t * | ndl |
|
|
typedef struct cstl_string | cstl_string_t |
| String of narrow characters.
|
|
typedef struct cstl_wstring | cstl_wstring_t |
| String of wide characters.
|
|
Vector-like memory management of a collection of characters.
Unless otherwise noted, cstl_STRING
is a "templatized" parameter and should be replaced with the type of string object in use, e.g. cstl_string
, cstl_wstring
.
For example, the equivalent of
is
void cstl_string_init(struct cstl_string *);
void cstl_wstring_init(struct cstl_wstring *);
◆ CSTL_STRING_INITIALIZER
#define CSTL_STRING_INITIALIZER |
( |
|
CTYPE | ) |
|
Value: { \
}
#define CSTL_VECTOR_INITIALIZER(TYPE)
Constant initialization of a vector object.
Constant initialization of a string object.
Unlike the templatized functions, "STRING" is not a placeholder for a "templatized" name. This macro/function is called literally as CSTL_STRING_INITIALIZER() and the CTYPE
parameter is the type of character held by the string object, e.g. cstl_string_char_t
, cstl_wstring_char_t
- Parameters
-
CTYPE | The type of character that the string will hold |
Definition at line 81 of file string.h.
◆ DECLARE_CSTL_STRING
#define DECLARE_CSTL_STRING |
( |
|
TYPE, |
|
|
|
NAME |
|
) |
| |
Value: struct cstl_##TYPE NAME = \
CSTL_STRING_INITIALIZER(cstl_##TYPE##_char_t)
(Statically) declare and initialize a vector
Unlike the templatized functions, "STRING" is not a placeholder for a "templatized" name. This macro/function is called literally as DECLARE_CSTL_STRING() and the TYPE
parameter is the type of string object being declared without the cstl_
prefix, e.g.
#define DECLARE_CSTL_STRING(TYPE, NAME)
(Statically) declare and initialize a vector
- Parameters
-
TYPE | The type of string object being declared |
NAME | The name of the variable being declared |
Definition at line 101 of file string.h.
◆ cstl_string_t
String of narrow characters.
Definition at line 63 of file string.h.
◆ cstl_wstring_t
String of wide characters.
Definition at line 65 of file string.h.
◆ ch
ssize_t cstl_STRING_char_t ch |
◆ cnt
static void const size_t cnt |
const cstl_STRING_char_t size_t i |
◆ ins
◆ len
void const cstl_STRING_char_t* const const size_t len |
◆ ndl
◆ pos
static ssize_t const struct cstl_STRING *const const size_t pos |
◆ s2
◆ ss
◆ str
static void const cstl_STRING_char_t *const str |
Initial value:{
return STDSTRF(cmp, CSTL_TOKCAT(
cstl_STRING, _str )( s ), str)
Definition at line 209 of file _string.h.
◆ sz
Initial value:{
void cstl_vector_reserve(struct cstl_vector *v, size_t sz)
Request to increase the capacity of the vector.
Definition at line 121 of file _string.h.