diff options
Diffstat (limited to 'c++/tools/c_gen_iface.hpp')
| -rw-r--r-- | c++/tools/c_gen_iface.hpp | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/c++/tools/c_gen_iface.hpp b/c++/tools/c_gen_iface.hpp index 7e2e396..68c8779 100644 --- a/c++/tools/c_gen_iface.hpp +++ b/c++/tools/c_gen_iface.hpp @@ -20,6 +20,7 @@ struct c_types { struct c_member { std::string key; std::string name; + bool is_primitive; }; struct c_param { @@ -184,12 +185,29 @@ struct c_data_translater<schema::Array<T,Dim>> { return make_error<err::critical>(); } + str.translate_to_c_source = "int translate_"; + str.translate_to_c_source += type_str; + str.translate_to_c_source += "(const saw::data<"; + str.translate_to_c_source += str.cpp_schema; + str.translate_to_c_source += ","; + str.translate_to_c_source += c_state.encoding; + str.translate_to_c_source += ">& cpp_data, struct "; + str.translate_to_c_source += type_str; + str.translate_to_c_source += "* c_data"; + + + str.translate_to_c_source += "int translate_"; + str.translate_to_c_source += inner_type_str; + str.translate_to_c_source += "(; + + { c_types::c_member memb; memb.key = inner_type_str; memb.name = "data"; - memb.is_primitive - fn.members.emplace_back(std::move(memb)); + memb.is_primitive = c_is_primitive<T>::value; + // fn.members.emplace_back(std::move(memb)); + str.members.emplace_back(std::move(memb)); } str.def = "struct "; |
