Add StringPairArray::swapWith

This commit is contained in:
Vinnie Falco
2013-09-06 14:17:01 -07:00
parent d6a12f791f
commit 044e3b09db
2 changed files with 10 additions and 0 deletions

View File

@@ -44,6 +44,13 @@ StringPairArray& StringPairArray::operator= (const StringPairArray& other)
return *this;
}
void StringPairArray::swapWith (StringPairArray& other)
{
std::swap (ignoreCase, other.ignoreCase);
keys.swapWith (other.keys);
values.swapWith (other.values);
}
bool StringPairArray::operator== (const StringPairArray& other) const
{
for (int i = keys.size(); --i >= 0;)

View File

@@ -49,6 +49,9 @@ public:
/** Copies the contents of another string array into this one */
StringPairArray& operator= (const StringPairArray& other);
/** Swap the contents of this array with another. */
void swapWith (StringPairArray& other);
//==============================================================================
/** Compares two arrays.
Comparisons are case-sensitive.