Max's string object is a simple wrapper for c-strings, useful when working with Max's t_dictionary, t_linklist, or t_hashtab.
More...
Max's string object is a simple wrapper for c-strings, useful when working with Max's t_dictionary, t_linklist, or t_hashtab.
- See also
- Dictionary
◆ string_append()
void string_append |
( |
t_string * |
x, |
|
|
const char * |
s |
|
) |
| |
Append a C-string onto the existing string maintained by a t_string object.
Memory allocation for the string will grow as needed to hold the concatenated string.
- Parameters
-
x | The string object instance. |
s | A string to append/concatenate with the existing string. |
◆ string_chop()
void string_chop |
( |
t_string * |
x, |
|
|
long |
numchars |
|
) |
| |
Shorten a string by eliminating N characters from the end.
- Parameters
-
x | The string object instance. |
numchars | The number of characters to chop from the end of the string. |
◆ string_getptr()
const char* string_getptr |
( |
t_string * |
x | ) |
|
Fetch a pointer to a string object's internal C-string.
- Parameters
-
x | The string object instance. |
- Returns
- A pointer to the internally maintained C-string.
◆ string_new()
t_string* string_new |
( |
const char * |
psz | ) |
|
Create a new string object.
- Parameters
-
psz | Pointer to a C-string that will be copied to memory internal to this string object instance. |
- Returns
- The new string object instance pointer.
◆ string_reserve()
void string_reserve |
( |
t_string * |
x, |
|
|
long |
numbytes |
|
) |
| |
Reserve additional memory for future string growth.
- Parameters
-
x | The string object instance. |
numbytes | The total number of bytes to allocate for this string object. |