Header: mruby/string.h
Overview
String class
Function Summary collapse
- void mrb_str_modify(mrb_state*, struct RString*)
- void mrb_str_concat(mrb_state*, mrb_value, mrb_value)
-
mrb_value mrb_str_plus(mrb_state*, mrb_value, mrb_value)
Adds two strings together.
-
mrb_value mrb_ptr_to_str(mrb_state *, void*)
Converts pointer into a Ruby string.
-
mrb_value mrb_obj_as_string(mrb_state *, mrb_value)
Returns an object as a Ruby string.
-
mrb_value mrb_str_resize(mrb_state *, mrb_value, mrb_int)
Resizes the string's length.
-
mrb_value mrb_str_substr(mrb_state *, mrb_value, mrb_int, mrb_int)
Returns a sub string.
-
mrb_value mrb_string_type(mrb_state *, mrb_value)
Returns a Ruby string type.
- mrb_value mrb_check_string_type(mrb_state *, mrb_value)
- mrb_value mrb_str_buf_new(mrb_state *, size_t)
-
mrb_value mrb_str_dup(mrb_state *, mrb_value)
Duplicates a string object.
-
mrb_value mrb_str_intern(mrb_state *, mrb_value)
Returns a symbol from a passed in string.
- mrb_value mrb_str_to_inum(mrb_state *, mrb_value, mrb_int, mrb_bool)
- double mrb_str_to_dbl(mrb_state *, mrb_value, mrb_bool)
-
mrb_value mrb_str_to_str(mrb_state *, mrb_value)
Returns a converted string type.
-
mrb_bool mrb_str_equal(mrb_state *, mrb_value, mrb_value)
Returns true if the strings match and false if the strings don't match.
-
mrb_value mrb_str_cat(mrb_state *, mrb_value, const char *, size_t)
Returns a concated string comprised of a Ruby string and a C string.
-
mrb_value mrb_str_cat_cstr(mrb_state *, mrb_value, const char *)
Returns a concated string comprised of a Ruby string and a C string.
- mrb_value mrb_str_cat_str(mrb_state *, mrb_value, mrb_value)
-
mrb_value mrb_str_append(mrb_state *, mrb_value, mrb_value)
Adds str2 to the end of str1.
-
int mrb_str_cmp(mrb_state *, mrb_value, mrb_value)
Returns 0 if both Ruby strings are equal.
-
char * mrb_str_to_cstr(mrb_state *, mrb_value)
Returns a C string from a Ruby string.
Define Summary
- #define MRUBY_STRING_H
- #define RSTRING_EMBED_LEN_MAX
- #define RSTR_EMBED_P
- #define RSTR_SET_EMBED_FLAG
- #define RSTR_UNSET_EMBED_FLAG
- #define RSTR_SET_EMBED_LEN
- #define RSTR_SET_LEN
- #define RSTR_EMBED_LEN
- #define RSTR_PTR
- #define RSTR_LEN
- #define RSTR_CAPA
- #define RSTR_SHARED_P
- #define RSTR_SET_SHARED_FLAG
- #define RSTR_UNSET_SHARED_FLAG
- #define RSTR_NOFREE_P
- #define RSTR_SET_NOFREE_FLAG
- #define RSTR_UNSET_NOFREE_FLAG
- #define RSTR_FROZEN_P
- #define RSTR_SET_FROZEN_FLAG
- #define RSTR_UNSET_FROZEN_FLAG
- #define mrb_str_ptr
Returns a pointer from a Ruby string
- #define RSTRING
- #define RSTRING_PTR
- #define RSTRING_EMBED_LEN
- #define RSTRING_LEN
- #define RSTRING_CAPA
- #define RSTRING_END
- #define MRB_STR_SHARED
- #define MRB_STR_NOFREE
- #define MRB_STR_FROZEN
- #define MRB_STR_EMBED
- #define MRB_STR_EMBED_LEN_MASK
- #define MRB_STR_EMBED_LEN_SHIFT
- #define mrb_str_cat_lit
- #define mrb_str_cat2
For backward compatibility
- #define mrb_str_buf_cat
- #define mrb_str_buf_append
Function Details
void mrb_str_modify(mrb_state* , struct RString* )
void mrb_str_concat(mrb_state* , mrb_value , mrb_value )
mrb_value mrb_str_plus(mrb_state* , mrb_value , mrb_value )
Adds two strings together.
mrb_value mrb_ptr_to_str(mrb_state * , void* )
Converts pointer into a Ruby string.
mrb_value mrb_obj_as_string(mrb_state * mrb, mrb_value obj)
Returns an object as a Ruby string.
mrb_value mrb_str_resize(mrb_state * mrb, mrb_value str, mrb_int len)
Resizes the string's length.
mrb_value mrb_str_substr(mrb_state * mrb, mrb_value str, mrb_int beg, mrb_int len)
Returns a sub string.
mrb_value mrb_string_type(mrb_state * mrb, mrb_value str)
Returns a Ruby string type.
mrb_value mrb_check_string_type(mrb_state * mrb, mrb_value str)
mrb_value mrb_str_buf_new(mrb_state * mrb, size_t capa)
mrb_value mrb_str_dup(mrb_state * mrb, mrb_value str)
Duplicates a string object.
mrb_value mrb_str_intern(mrb_state * mrb, mrb_value self)
Returns a symbol from a passed in string.
mrb_value mrb_str_to_inum(mrb_state * mrb, mrb_value str, mrb_int base, mrb_bool badcheck)
double mrb_str_to_dbl(mrb_state * mrb, mrb_value str, mrb_bool badcheck)
mrb_value mrb_str_to_str(mrb_state * mrb, mrb_value str)
Returns a converted string type.
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_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_value mrb_str_cat_cstr(mrb_state * mrb, mrb_value str, const char * ptr)
Returns a concated string comprised of a Ruby string and a C string.
mrb_value mrb_str_cat_str(mrb_state * mrb, mrb_value str, mrb_value str2)
mrb_value mrb_str_append(mrb_state * mrb, mrb_value str, mrb_value str2)
Adds str2 to the end of str1.
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.
char * mrb_str_to_cstr(mrb_state * mrb, mrb_value str)
Returns a C string from a Ruby string.