Add string.c_str() and string.data() methods.

This commit is contained in:
Jason Turner 2010-08-05 13:38:11 +00:00
parent ea93903884
commit f215cae866
2 changed files with 10 additions and 0 deletions

View File

@ -449,6 +449,10 @@ namespace chaiscript
m->add(fun(find_func(boost::mem_fn(static_cast<find_func_ptr>(&String::find_first_not_of)))), "find_first_not_of");
m->add(fun(find_func(boost::mem_fn(static_cast<find_func_ptr>(&String::find_last_not_of)))), "find_last_not_of");
m->add(fun(&String::c_str), "c_str");
m->add(fun(&String::data), "data");
return m;
}
}

View File

@ -0,0 +1,6 @@
assert_equal(true, "hello".c_str().is_var_const())
assert_equal("char", "hello".c_str().type_name())
assert_equal(true, "hello".data().is_var_const())
assert_equal("char", "hello".data().type_name())