carb::dictionary::getItemFullPath

Defined in carb/dictionary/DictionaryUtils.h

inline std::string carb::dictionary::getItemFullPath(dictionary::IDictionary *dict, const carb::dictionary::Item *item, bool includeRoot = true)

Retrieves the full path to dictionary item from its top-most ancestor.

Thread Safety

This operation itself is thread safe. However, if the item or its chain of ancestors is being modified concurrently, undefined behavior may result.

Parameters
  • dict[in] The IDictionary interface to use to retrieve the full path to the requested dictionary item. This must not be nullptr.

  • item[in] The dictionary item to retrieve the full path to. This may not be nullptr. This item must have been created by the same IDictionary interface passed in as dict.

  • includeRoot[in] Set to true to include the root node’s name. This is the default behavior. Set to false to skip the root node’s name. The root node is typically a node with a name that identifies the source of the dictionary (ie: <ISettings root>, the name of the file a dictionary was loaded from, etc).

Returns

A string containing the full path to the dictionary item item. This path will be relative to its top-most ancestor. On failure, an empty string is returned.