| @@ -531,6 +531,20 @@ public: | |||||
| } | } | ||||
| } | } | ||||
| /** This swaps the contents of this array with those of another array. | |||||
| If you need to exchange two arrays, this is vastly quicker than using copy-by-value | |||||
| because it just swaps their internal pointers. | |||||
| */ | |||||
| void swapWith (SortedSet& otherSet) noexcept | |||||
| { | |||||
| const ScopedLockType lock1 (getLock()); | |||||
| const ScopedLockType lock2 (otherSet.getLock()); | |||||
| data.swapWith (otherSet.data); | |||||
| swapVariables (numUsed, otherSet.numUsed); | |||||
| } | |||||
| //============================================================================== | //============================================================================== | ||||
| /** Reduces the amount of storage being used by the set. | /** Reduces the amount of storage being used by the set. | ||||
| @@ -125,6 +125,22 @@ public: | |||||
| */ | */ | ||||
| String& getReference (int index) noexcept; | String& getReference (int index) noexcept; | ||||
| /** Returns a pointer to the first String in the array. | |||||
| This method is provided for compatibility with standard C++ iteration mechanisms. | |||||
| */ | |||||
| inline String* begin() const noexcept | |||||
| { | |||||
| return strings.begin(); | |||||
| } | |||||
| /** Returns a pointer to the String which follows the last element in the array. | |||||
| This method is provided for compatibility with standard C++ iteration mechanisms. | |||||
| */ | |||||
| inline String* end() const noexcept | |||||
| { | |||||
| return strings.end(); | |||||
| } | |||||
| /** Searches for a string in the array. | /** Searches for a string in the array. | ||||
| The comparison will be case-insensitive if the ignoreCase parameter is true. | The comparison will be case-insensitive if the ignoreCase parameter is true. | ||||