Defined in carb/settings/SettingsUtils.h

template<typename ElementData, typename OnItemFnType>
inline void carb::settings::walkSettings(carb::dictionary::IDictionary *idict, carb::settings::ISettings *settings, dictionary::WalkerMode walkerMode, const char *rootPath, ElementData rootElementData, OnItemFnType onItemFn, void *userData)

A function for walking all of the settings from a given root.

Similar to dictionary::walkDictionary().

Template Parameters
  • ElementData – Type of the second parameter passed to onItemFn.

  • OnItemFnType – Type of the invocable onItemFn.

  • idict – The acquired dictionary::IDictionary interface.

  • settings – The acquired ISettings interface.

  • walkerMode – See dictionary::WalkerMode.

  • rootPath – The settings root to begin the walk at. An empty string or “/” is considered the root of the settings tree.

  • rootElementData – A value of type ElementData that is passed as the second parameter to onItemFn. This value is not used by walkSettings() and is intended to be used only by the caller and the onItemFn invocable.

  • onItemFn – An invocable that is invoked for each setting value encountered. The type of this invocable should be ElementData(const char*, ElementData, void*): the encountered item path is the first parameter, followed by the parent’s ElementData, followed by userData. The return value is only used for dictionary and array settings: the returned ElementData will be passed to onItemFn invocations for child settings; the return value is otherwise ignored.

  • userData – A caller-specific value that is not used but is passed to every onItemFn invocation.