mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
@@ -1,3 +1,7 @@
|
||||
## Macros
|
||||
### mrb_str_ptr(s)
|
||||
Returns a pointer from a Ruby string.
|
||||
## Functions
|
||||
### mrb_str_plus
|
||||
```C
|
||||
mrb_value mrb_str_plus(mrb_state*, mrb_value, mrb_value);
|
||||
@@ -43,3 +47,45 @@ Duplicates a string object.
|
||||
mrb_value mrb_str_intern(mrb_state *mrb, mrb_value self);
|
||||
```
|
||||
Returns a symbol from a passed in string.
|
||||
### mrb_str_to_str
|
||||
```C
|
||||
mrb_value mrb_str_to_str(mrb_state *mrb, mrb_value str);
|
||||
```
|
||||
Returns a converted string type.
|
||||
### mrb_str_equal
|
||||
```C
|
||||
mrb_bool mrb_str_equal(mrb_state *mrb, mrb_value str1, mrb_value str2);
|
||||
```
|
||||
Returns true if the strings match and false if the strings don't match.
|
||||
### mrb_str_cat
|
||||
```C
|
||||
mrb_value mrb_str_cat(mrb_state *mrb, mrb_value str, const char *ptr, size_t len);
|
||||
```
|
||||
Returns a concated string comprised of a Ruby string and a C string.
|
||||
### mrb_str_cat_cstr
|
||||
```C
|
||||
mrb_value mrb_str_cat_str(mrb_state *mrb, mrb_value str, mrb_value str2);
|
||||
```
|
||||
Returns a concated string comprised of a Ruby string and a C string(A shorter alternative to mrb_str_cat).
|
||||
### mrb_str_append
|
||||
```C
|
||||
mrb_value mrb_str_append(mrb_state *mrb, mrb_value str, mrb_value str2);
|
||||
```
|
||||
Adds str2 to the end of str1.
|
||||
### mrb_str_cmp
|
||||
```C
|
||||
int mrb_str_cmp(mrb_state *mrb, mrb_value str1, mrb_value str2);
|
||||
```
|
||||
Returns 0 if both Ruby strings are equal.
|
||||
Returns a value < 0 if Ruby str1 is less than Ruby str2.
|
||||
Returns a value > 0 if Ruby str2 is greater than Ruby str1.
|
||||
### mrb_str_to_cstr
|
||||
```C
|
||||
char *mrb_str_to_cstr(mrb_state *mrb, mrb_value str);
|
||||
```
|
||||
Returns a C string from a Ruby string.
|
||||
### mrb_str_inspect
|
||||
```C
|
||||
mrb_str_inspect(mrb_state *mrb, mrb_value str);
|
||||
```
|
||||
Returns a printable version of str, surrounded by quote marks, with special characters escaped.
|
||||
|
||||
Reference in New Issue
Block a user