#include <juce_StringPairArray.h>
A container for holding a set of strings which are keyed by another string.
- See also
- StringArray
@tags{Core}
◆ StringPairArray() [1/2]
| juce::StringPairArray::StringPairArray |
( |
bool | ignoreCaseWhenComparingKeys = true | ) |
|
◆ StringPairArray() [2/2]
| juce::StringPairArray::StringPairArray |
( |
const StringPairArray & | other | ) |
|
Creates a copy of another array
◆ ~StringPairArray()
| juce::StringPairArray::~StringPairArray |
( |
| ) |
|
|
default |
◆ addArray()
Adds the items from another array to this one. This is equivalent to using set() to add each of the pairs from the other array.
◆ addMap()
◆ addMapImpl()
template<typename Map>
| void juce::StringPairArray::addMapImpl |
( |
const Map & | mapToAdd | ) |
|
|
private |
◆ addUnorderedMap()
◆ clear()
| void juce::StringPairArray::clear |
( |
| ) |
|
Removes all elements from the array.
◆ containsKey()
| bool juce::StringPairArray::containsKey |
( |
StringRef | key | ) |
const |
|
noexcept |
Returns true if the given key exists.
◆ getAllKeys()
Returns a list of all keys in the array.
◆ getAllValues()
Returns a list of all values in the array.
◆ getDescription()
| String juce::StringPairArray::getDescription |
( |
| ) |
const |
Returns a descriptive string containing the items. This is handy for dumping the contents of an array.
◆ getIgnoresCase()
| bool juce::StringPairArray::getIgnoresCase |
( |
| ) |
const |
|
noexcept |
Indicates whether a case-insensitive search is used when looking up a key string.
◆ getValue()
Finds the value corresponding to a key string. If no such key is found, this will just return the value provided as a default.
- See also
- operator[]
◆ minimiseStorageOverheads()
| void juce::StringPairArray::minimiseStorageOverheads |
( |
| ) |
|
Reduces the amount of storage being used by the array.
Arrays typically allocate slightly more storage than they need, and after removing elements, they may have quite a lot of unused space allocated. This method will reduce the amount of allocated storage to a minimum.
◆ operator!=()
Compares two arrays. Comparisons are case-sensitive.
- Returns
- false if the other array contains exactly the same strings with the same keys
◆ operator=()
Copies the contents of another string array into this one
◆ operator==()
Compares two arrays. Comparisons are case-sensitive.
- Returns
- true only if the other array contains exactly the same strings with the same keys
◆ operator[]()
Finds the value corresponding to a key string.
If no such key is found, this will just return an empty string. To check whether a given key actually exists (because it might actually be paired with an empty string), use the getAllKeys() method to obtain a list.
Obviously the reference returned shouldn't be stored for later use, as the string it refers to may disappear when the array changes.
- See also
- getValue
◆ remove() [1/2]
| void juce::StringPairArray::remove |
( |
int | index | ) |
|
Removes a string from the array based on its index. If the index is out-of-range, no action will be taken.
◆ remove() [2/2]
Removes a string from the array based on its key. If the key isn't found, nothing will happen.
◆ set()
Adds or amends a key/value pair. If a value already exists with this key, its value will be overwritten, otherwise the key/value pair will be added to the array.
◆ setIgnoresCase()
| void juce::StringPairArray::setIgnoresCase |
( |
bool | shouldIgnoreCase | ) |
|
Indicates whether to use a case-insensitive search when looking up a key string.
◆ size()
| int juce::StringPairArray::size |
( |
| ) |
const |
|
inlinenoexcept |
Returns the number of strings in the array
◆ ignoreCase
| bool juce::StringPairArray::ignoreCase |
|
private |
◆ keys
◆ values
The documentation for this class was generated from the following files:
- /home/runner/work/lmms-fork/lmms-fork/plugins/CarlaBase/carla/source/modules/juce_core/text/juce_StringPairArray.h
- /home/runner/work/lmms-fork/lmms-fork/plugins/CarlaBase/carla/source/modules/juce_core/text/juce_StringPairArray.cpp