openshot-audio
0.1.5
|
#include <juce_StringPairArray.h>
Public Member Functions | |
StringPairArray (bool ignoreCaseWhenComparingKeys=true) | |
StringPairArray (const StringPairArray &other) | |
~StringPairArray () | |
StringPairArray & | operator= (const StringPairArray &other) |
bool | operator== (const StringPairArray &other) const |
bool | operator!= (const StringPairArray &other) const |
const String & | operator[] (StringRef key) const |
String | getValue (StringRef, const String &defaultReturnValue) const |
bool | containsKey (StringRef key) const noexcept |
const StringArray & | getAllKeys () const noexcept |
const StringArray & | getAllValues () const noexcept |
int | size () const noexcept |
void | set (const String &key, const String &value) |
void | addArray (const StringPairArray &other) |
void | clear () |
void | remove (StringRef key) |
void | remove (int index) |
void | setIgnoresCase (bool shouldIgnoreCase) |
String | getDescription () const |
void | minimiseStorageOverheads () |
A container for holding a set of strings which are keyed by another string.
StringPairArray::StringPairArray | ( | bool | ignoreCaseWhenComparingKeys = true | ) |
Creates an empty array
StringPairArray::StringPairArray | ( | const StringPairArray & | other | ) |
Creates a copy of another array
StringPairArray::~StringPairArray | ( | ) |
Destructor.
void StringPairArray::addArray | ( | const StringPairArray & | other | ) |
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.
void StringPairArray::clear | ( | ) |
Removes all elements from the array.
|
noexcept |
Returns true if the given key exists.
|
inlinenoexcept |
Returns a list of all keys in the array.
|
inlinenoexcept |
Returns a list of all values in the array.
String StringPairArray::getDescription | ( | ) | const |
Returns a descriptive string containing the items. This is handy for dumping the contents of an array.
Finds the value corresponding to a key string. If no such key is found, this will just return the value provided as a default.
void 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.
bool StringPairArray::operator!= | ( | const StringPairArray & | other | ) | const |
Compares two arrays. Comparisons are case-sensitive.
StringPairArray & StringPairArray::operator= | ( | const StringPairArray & | other | ) |
Copies the contents of another string array into this one
bool StringPairArray::operator== | ( | const StringPairArray & | other | ) | const |
Compares two arrays. Comparisons are case-sensitive.
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.
void StringPairArray::remove | ( | StringRef | key | ) |
Removes a string from the array based on its key. If the key isn't found, nothing will happen.
void 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.
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.
void StringPairArray::setIgnoresCase | ( | bool | shouldIgnoreCase | ) |
Indicates whether to use a case-insensitive search when looking up a key string.
|
inlinenoexcept |
Returns the number of strings in the array