GFXprim
2D bitmap graphics library with emphasis on speed and correctness
|
A dynamic C strings. More...
#include <string.h>
#include <core/gp_compiler.h>
#include <utils/gp_utf.h>
#include <utils/gp_vec.h>
Go to the source code of this file.
Functions | |
static char * | gp_vec_str_new (void) |
Allocated new string vector. | |
static size_t | gp_vec_strlen (const char *self) |
Returns string vector len. | |
static size_t | gp_vec_strsize (const char *self) |
Returns string vector size. | |
static char * | gp_vec_strdup (const char *src) |
Copies a string into newly allocated string vector. | |
static char * | gp_vec_strins (char *self, size_t off, const char *src) |
Inserts a string into a string vector at a given offset. | |
static char * | gp_vec_str_append (char *self, const char *str) |
Appends a string to a string vector. | |
static char * | gp_vec_chins (char *self, size_t off, char ch) |
Inserts a string into a string vector at a given offset. | |
static char * | gp_vec_ins_utf8 (char *self, size_t off, uint32_t unicode) |
Inserts an unicode character into an UTF-8 string. | |
static char * | gp_vec_strdel (char *self, size_t off, size_t len) |
Deletes len characters from a string vector at a given offset. | |
static char * | gp_vec_strclr (char *self) |
Clears the string. | |
char * | gp_vec_printf (char *self, const char *fmt,...) |
Printf into a string vector. | |
char * | gp_vec_vprintf (char *self, const char *fmt, va_list va) |
Printf va_list into a string vector. | |
A dynamic C strings.
Definition in file gp_vec_str.h.
|
inlinestatic |
Inserts a string into a string vector at a given offset.
self | A string vector. |
off | An offset in the string vector. |
src | A string to copy. |
Definition at line 125 of file gp_vec_str.h.
References gp_vec_ins().
|
inlinestatic |
Inserts an unicode character into an UTF-8 string.
self | A string vector. |
off | An offset in the string. @unicode An unicode character. |
Definition at line 146 of file gp_vec_str.h.
References gp_to_utf8(), gp_utf8_bytes(), and gp_vec_ins().
char * gp_vec_printf | ( | char * | self, |
const char * | fmt, | ||
... | |||
) |
Printf into a string vector.
self | A string vector. |
fmt | Printf format string. |
... | Printf parameters. |
|
inlinestatic |
Appends a string to a string vector.
self | A string vector. |
str | A string to append. |
Definition at line 104 of file gp_vec_str.h.
References gp_vec_len(), and gp_vec_strins().
|
inlinestatic |
Allocated new string vector.
Definition at line 27 of file gp_vec_str.h.
References gp_vec_new().
|
inlinestatic |
Clears the string.
self | A string vector. |
Definition at line 181 of file gp_vec_str.h.
References gp_vec_resize().
|
inlinestatic |
Deletes len characters from a string vector at a given offset.
self | A string vector. |
off | An offset in the string vector. |
len | Number of characters to delete. |
Definition at line 169 of file gp_vec_str.h.
References gp_vec_del().
|
inlinestatic |
Copies a string into newly allocated string vector.
src | A strint to duplicate. |
Definition at line 63 of file gp_vec_str.h.
References gp_vec_new().
|
inlinestatic |
Inserts a string into a string vector at a given offset.
self | A string vector. |
off | An offset in the string vector. |
src | A string to copy. |
Definition at line 84 of file gp_vec_str.h.
References gp_vec_ins().
Referenced by gp_vec_str_append().
|
inlinestatic |
Returns string vector len.
self | A string vector. |
Definition at line 39 of file gp_vec_str.h.
References gp_vec_len().
|
inlinestatic |
Returns string vector size.
self | A string vector. |
Definition at line 51 of file gp_vec_str.h.
References gp_vec_len().
char * gp_vec_vprintf | ( | char * | self, |
const char * | fmt, | ||
va_list | va | ||
) |
Printf va_list into a string vector.
self | A string vector. |
fmt | Printf format string. |
va | A va list. |