提交 df10ce6a 编写于 作者: L Luiz Capitulino 提交者: Anthony Liguori

QDict: Introduce qdict_get_qdict()

A helper to retrieve a QDict from a QDict.
Signed-off-by: NLuiz Capitulino <lcapitulino@redhat.com>
Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
上级 59eb1c85
......@@ -215,6 +215,19 @@ QList *qdict_get_qlist(const QDict *qdict, const char *key)
return qobject_to_qlist(qdict_get_obj(qdict, key, QTYPE_QLIST));
}
/**
* qdict_get_qdict(): Get the QDict mapped by 'key'
*
* This function assumes that 'key' exists and it stores a
* QDict object.
*
* Return QDict mapped by 'key'.
*/
QDict *qdict_get_qdict(const QDict *qdict, const char *key)
{
return qobject_to_qdict(qdict_get_obj(qdict, key, QTYPE_QDICT));
}
/**
* qdict_get_str(): Get a pointer to the stored string mapped
* by 'key'
......
......@@ -40,6 +40,7 @@ void qdict_iter(const QDict *qdict,
int64_t qdict_get_int(const QDict *qdict, const char *key);
int qdict_get_bool(const QDict *qdict, const char *key);
QList *qdict_get_qlist(const QDict *qdict, const char *key);
QDict *qdict_get_qdict(const QDict *qdict, const char *key);
const char *qdict_get_str(const QDict *qdict, const char *key);
int64_t qdict_get_try_int(const QDict *qdict, const char *key,
int64_t err_value);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册