cppbind: tweaking from_nasal/to_nasal.
This commit is contained in:
parent
0539aa38e5
commit
9fecb69b84
@ -166,6 +166,12 @@ namespace nasal
|
||||
return (*from_nasal_ptr<T>::get())(c, args[index]);
|
||||
}
|
||||
|
||||
template<class T>
|
||||
naRef to_nasal(T arg) const
|
||||
{
|
||||
return nasal::to_nasal(c, arg);
|
||||
}
|
||||
|
||||
naContext c;
|
||||
size_t argc;
|
||||
naRef *args;
|
||||
|
@ -53,6 +53,9 @@ namespace nasal
|
||||
std::string from_nasal_helper(naContext c, naRef ref, const std::string*)
|
||||
{
|
||||
naRef na_str = naStringValue(c, ref);
|
||||
if( !naIsString(na_str) )
|
||||
throw bad_nasal_cast("Not convertible to string");
|
||||
|
||||
return std::string(naStr_data(na_str), naStr_len(na_str));
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user