Added test for and corrected get_bayes_info

This commit is contained in:
lmat
2017-11-03 21:27:48 -04:00
parent 9d7ec35ce5
commit 2cda65e012
4 changed files with 65 additions and 55 deletions

View File

@@ -1353,6 +1353,17 @@ qof_instance_slot_delete_if_empty (const QofInstance *inst, const char *path)
}
}
std::vector <std::pair <std::string, KvpValue*>>
qof_instance_get_slots_prefix (QofInstance const * inst, std::string const & prefix)
{
std::vector <std::pair <std::string, KvpValue*>> ret;
inst->kvp_data->for_each_slot_temp ([&prefix, &ret] (std::string const & key, KvpValue * val) {
if (key.find (prefix) == 0)
ret.emplace_back (key, val);
});
return ret;
}
namespace {
struct wrap_param
{
@@ -1360,6 +1371,7 @@ struct wrap_param
void *user_data;
};
}
static void
wrap_gvalue_function (const char* key, KvpValue *val, wrap_param & param)
{