carb::dictionary::getValueOrDefault
Defined in omni/extras/DictHelpers.h
-
template<typename T>
T carb::dictionary::getValueOrDefault(const Item *baseItem, const char *path, T defaultValue) Gets a child value from a given Item if present, otherwise returns the given default value.
- Template Parameters
T – the type of the return value and default value
- Parameters
baseItem – The carb::dictionary::Item to use as a base (required)
path – The path of children from
baseItem
using/
as a separatordefaultValue – The default value to return if no item is present at the given location
- Returns
The carb::dictionary::Item converted to
T
with carb::dictionary::IDictionary::get(), ordefaultValue
if the givenbaseItem
andpath
did not resolve to an Item