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, ignoreCase);
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]);
134 remove (keys.
indexOf (key, ignoreCase));
145 ignoreCase = shouldIgnoreCase;
152 for (
int i = 0; i < keys.
size(); ++i)
154 s << keys[i] <<
" = " << values[i];
String getValue(StringRef, const String &defaultReturnValue) const
StringPairArray(bool ignoreCaseWhenComparingKeys=true)
int size() const noexcept
int indexOf(StringRef stringToLookFor, bool ignoreCase=false, int startIndex=0) const
bool operator==(const StringPairArray &other) const
void minimiseStorageOverheads()
void set(int index, String newString)
const String & operator[](StringRef key) const
StringPairArray & operator=(const StringPairArray &other)
bool operator!=(const StringPairArray &other) const
void set(const String &key, const String &value)
bool contains(StringRef stringToLookFor, bool ignoreCase=false) const
void minimiseStorageOverheads()
String getDescription() const
bool containsKey(StringRef key) const noexcept
int size() const noexcept
void remove(StringRef key)
void addArray(const StringPairArray &other)
void setIgnoresCase(bool shouldIgnoreCase)
void add(String stringToAdd)