add mrb_string_type().

This commit is contained in:
Tomoyuki Sahara
2013-08-23 15:04:10 +09:00
parent aa099f7f7d
commit 53ff8172e5
2 changed files with 7 additions and 0 deletions
+1
View File
@@ -41,6 +41,7 @@ mrb_value mrb_ptr_to_str(mrb_state *, void *);
mrb_value mrb_obj_as_string(mrb_state *mrb, mrb_value obj);
mrb_value mrb_str_resize(mrb_state *mrb, mrb_value str, mrb_int len);
mrb_value mrb_str_substr(mrb_state *mrb, mrb_value str, mrb_int beg, mrb_int len);
mrb_value mrb_string_type(mrb_state *mrb, mrb_value str);
mrb_value mrb_check_string_type(mrb_state *mrb, mrb_value str);
mrb_value mrb_str_buf_new(mrb_state *mrb, mrb_int capa);
mrb_value mrb_str_buf_cat(mrb_state *mrb, mrb_value str, const char *ptr, size_t len);
+6
View File
@@ -1523,6 +1523,12 @@ mrb_ptr_to_str(mrb_state *mrb, void *p)
return mrb_obj_value(p_str);
}
mrb_value
mrb_string_type(mrb_state *mrb, mrb_value str)
{
return mrb_convert_type(mrb, str, MRB_TT_STRING, "String", "to_str");
}
mrb_value
mrb_check_string_type(mrb_state *mrb, mrb_value str)
{