OpenShot Library | libopenshot-audio
0.2.0
|
32 values (other.values),
33 ignoreCase (other.ignoreCase)
44 values = other.values;
52 if (num != other.
size())
55 for (
int i = 0; i < num; ++i)
57 if (keys[i] == other.keys[i])
59 if (values[i] != other.values[i])
65 for (
int j = i; j < num; ++j)
67 auto otherIndex = other.keys.
indexOf (keys[j], other.ignoreCase);
69 if (otherIndex < 0 || values[j] != other.values[otherIndex])
87 return values[keys.
indexOf (key, ignoreCase)];
92 auto i = keys.
indexOf (key, ignoreCase);
97 return defaultReturnValue;
102 return keys.contains (key);
107 auto i = keys.
indexOf (key, ignoreCase);
111 values.
set (i, value);
122 for (
int i = 0; i < other.
size(); ++i)
123 set (other.keys[i], other.values[i]);
145 ignoreCase = shouldIgnoreCase;
152 for (
int i = 0; i < keys.
size(); ++i)
154 s << keys[i] <<
" = " << values[i];
void addArray(const StringPairArray &other)
Adds the items from another array to this one.
int indexOf(StringRef stringToLookFor, bool ignoreCase=false, int startIndex=0) const
Searches for a string in the array.
A simple class for holding temporary references to a string literal or String.
void set(int index, String newString)
Replaces one of the strings in the array with another one.
void setIgnoresCase(bool shouldIgnoreCase)
Indicates whether to use a case-insensitive search when looking up a key string.
StringPairArray & operator=(const StringPairArray &other)
Copies the contents of another string array into this one.
bool operator!=(const StringPairArray &other) const
Compares two arrays.
void clear()
Removes all elements from the array.
int size() const noexcept
Returns the number of strings in the array.
A container for holding a set of strings which are keyed by another string.
bool containsKey(StringRef key) const noexcept
Returns true if the given key exists.
void remove(int index)
Removes a string from the array.
void set(const String &key, const String &value)
Adds or amends a key/value pair.
void remove(StringRef key)
Removes a string from the array based on its key.
String getDescription() const
Returns a descriptive string containing the items.
void minimiseStorageOverheads()
Reduces the amount of storage being used by the array.
void add(String stringToAdd)
Appends a string at the end of the array.
void clear()
Removes all elements from the array.
StringPairArray(bool ignoreCaseWhenComparingKeys=true)
Creates an empty array.
~StringPairArray()
Destructor.
int size() const noexcept
Returns the number of strings in the array.
const String & operator[](StringRef key) const
Finds the value corresponding to a key string.
String getValue(StringRef, const String &defaultReturnValue) const
Finds the value corresponding to a key string.
void minimiseStorageOverheads()
Reduces the amount of storage being used by the array.
bool operator==(const StringPairArray &other) const
Compares two arrays.