carb::dictionary::setStringArray

Defined in carb/dictionary/DictionaryUtils.h

inline void carb::dictionary::setStringArray(IDictionary *dict, Item *baseItem, const char *path, const std::vector<std::string> &stringArray)

Sets an array of values at a given path relative to a dictionary item.

Thread Safety

This call itself is thread safe as long as no other call is trying to concurrently modify the same item in the dictionary. Results are undefined if another thread is modifying the same item in the dictionary. Similarly, undefined behavior may result if another thread is concurrently trying to retrieve the items from this same dictionary.

Parameters
  • dict[in] The IDictionary interface to use to access the items in the dictionary. This must not be nullptr. This must be the same interface that was originally used to create the dictionary baseItem.

  • baseItem[in] The base item to act as the root of where to set the values relative to. This is expected to contain the child path path. This may not be nullptr.

  • path[in] The path to the item to set the array of strings in. This path must either already exist as an array of strings or be an empty item in the dictionary. This may be nullptr to set the string array into the item baseItem itself.

  • stringArray[in] The array of strings to set in the dictionary. This may contain a different number of items than the existing array. If the number of items differs, this new array of values will replace the existing item at path entirely. If the count is the same as the previous item, values will simply be replaced.

Returns

No return value.