Add string.c_str() and string.data() methods.
This commit is contained in:
@@ -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_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(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;
|
return m;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
6
unittests/string_charptr.chai
Normal file
6
unittests/string_charptr.chai
Normal 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())
|
||||||
|
|
Reference in New Issue
Block a user