mruby/c String class More...
Go to the source code of this file.
Data Structures | |
| struct | tr_pattern |
Functions | |
| static int | is_space (int ch) |
| mrbc_value | mrbc_string_new (struct VM *vm, const void *src, int len) |
| mrbc_value | mrbc_string_new_alloc (struct VM *vm, void *buf, int len) |
| void | mrbc_string_delete (mrbc_value *str) |
| void | mrbc_string_clear (mrbc_value *str) |
| mrbc_value | mrbc_string_dup (struct VM *vm, mrbc_value *s1) |
| mrbc_value | mrbc_string_add (struct VM *vm, const mrbc_value *s1, const mrbc_value *s2) |
| int | mrbc_string_append (mrbc_value *s1, const mrbc_value *s2) |
| int | mrbc_string_append_cbuf (mrbc_value *s1, const void *s2, int len2) |
| int | mrbc_string_index (const mrbc_value *src, const mrbc_value *pattern, int offset) |
| int | mrbc_string_strip (mrbc_value *src, int mode) |
| int | mrbc_string_chomp (mrbc_value *src) |
| int | mrbc_string_upcase (mrbc_value *str) |
| int | mrbc_string_downcase (mrbc_value *str) |
| static void | tr_free_pattern (struct tr_pattern *pat) |
| static struct tr_pattern * | tr_parse_pattern (struct VM *vm, const mrbc_value *v_pattern, int flag_reverse_enable) |
| static int | tr_find_character (const struct tr_pattern *pat, int ch) |
| static int | tr_get_character (const struct tr_pattern *pat, int n_th) |
| static int | tr_main (struct VM *vm, mrbc_value v[], int argc) |
mruby/c String class
Copyright (C) 2015- Kyushu Institute of Technology. Copyright (C) 2015- Shimane IT Open-Innovation Center. This file is distributed under BSD 3-Clause License.
Definition in file c_string.c.
|
static |
white space character test
| ch | character code. |
Definition at line 42 of file c_string.c.
| mrbc_value mrbc_string_add | ( | struct VM * | vm, |
| const mrbc_value * | s1, | ||
| const mrbc_value * | s2 ) |
add string (s1 + s2)
| vm | pointer to VM. |
| s1 | pointer to target value 1 |
| s2 | pointer to target value 2 |
Definition at line 188 of file c_string.c.
| int mrbc_string_append | ( | mrbc_value * | s1, |
| const mrbc_value * | s2 ) |
append string (s1 += s2)
| s1 | pointer to target value 1 |
| s2 | pointer to target value 2 |
Definition at line 210 of file c_string.c.
| int mrbc_string_append_cbuf | ( | mrbc_value * | s1, |
| const void * | s2, | ||
| int | len2 ) |
append c buffer (s1 += s2)
| s1 | pointer to target value 1 |
| s2 | pointer to buffer |
| len2 | buffer size |
Definition at line 240 of file c_string.c.
| int mrbc_string_chomp | ( | mrbc_value * | src | ) |
remove the CR,LF in myself
| src | pointer to target value |
Definition at line 334 of file c_string.c.
| void mrbc_string_clear | ( | mrbc_value * | str | ) |
| void mrbc_string_delete | ( | mrbc_value * | str | ) |
destructor
| str | pointer to target value |
Definition at line 129 of file c_string.c.
| int mrbc_string_downcase | ( | mrbc_value * | str | ) |
downcase myself
| str | pointer to target value |
Definition at line 385 of file c_string.c.
| mrbc_value mrbc_string_dup | ( | struct VM * | vm, |
| mrbc_value * | s1 ) |
duplicate string
| vm | pointer to VM. |
| s1 | pointer to target value |
Definition at line 167 of file c_string.c.
| int mrbc_string_index | ( | const mrbc_value * | src, |
| const mrbc_value * | pattern, | ||
| int | offset ) |
locate a substring in a string
| src | pointer to target string |
| pattern | pointer to substring |
| offset | search offset |
Definition at line 269 of file c_string.c.
| mrbc_value mrbc_string_new | ( | struct VM * | vm, |
| const void * | src, | ||
| int | len ) |
constructor
| vm | pointer to VM. |
| src | source string or NULL |
| len | source length |
Definition at line 62 of file c_string.c.
| mrbc_value mrbc_string_new_alloc | ( | struct VM * | vm, |
| void * | buf, | ||
| int | len ) |
constructor by allocated buffer
| vm | pointer to VM. |
| buf | pointer to allocated buffer |
| len | length |
Definition at line 105 of file c_string.c.
| int mrbc_string_strip | ( | mrbc_value * | src, |
| int | mode ) |
remove the whitespace in myself
| src | pointer to target value |
| mode | 1:left-side, 2:right-side, 3:each |
Definition at line 294 of file c_string.c.
| int mrbc_string_upcase | ( | mrbc_value * | str | ) |
upcase myself
| str | pointer to target value |
Definition at line 363 of file c_string.c.
|
static |
|
static |
Definition at line 1131 of file c_string.c.
|
static |
|
static |
|
static |
Definition at line 1140 of file c_string.c.