carb::dictionary::getChildByIndex
Defined in carb/dictionary/DictionaryUtils.h
-
template<typename ItemPtrType>
inline ItemPtrType *carb::dictionary::getChildByIndex(IDictionary *dict, ItemPtrType *item, size_t idx) Prototype for a callback function used to walk children in a dictionary.
Remark
This callback provides a way to control the order in which the items in a dictionary are walked. An basic implementation is provided below.
- Template Parameters
ItemPtrType – The data type of the dictionary item in the dictionary being walked. This should be either
Item
orconst Item
.- Parameters
dict – [in] The IDictionary interface being used to access the items in the dictionary during the walk. This must not be
nullptr
.item – [in] The dictionary item to retrieve one of the child items from. This must not be
nullptr
. This is assumed to be an item of type ItemType::eDictionary.idx – [in] The zero based index of the child item of
item
to retrieve. This is expected to be within the range of the number of children in the given dictionary item.
- Returns
The child item at the requested index in the given dictionary item
item
. Returnsnullptr
if the given index is out of range of the number of children in the given dictionary item.