From 56a45370880deb5f32624391568eb39efbacc840 Mon Sep 17 00:00:00 2001 From: jules Date: Thu, 7 Jun 2012 10:53:04 +0100 Subject: [PATCH] Added method StringArray::swapWith(). --- modules/juce_core/text/juce_StringArray.cpp | 5 +++++ modules/juce_core/text/juce_StringArray.h | 3 +++ 2 files changed, 8 insertions(+) diff --git a/modules/juce_core/text/juce_StringArray.cpp b/modules/juce_core/text/juce_StringArray.cpp index 81407e60d7..d275fee02b 100644 --- a/modules/juce_core/text/juce_StringArray.cpp +++ b/modules/juce_core/text/juce_StringArray.cpp @@ -118,6 +118,11 @@ bool StringArray::operator!= (const StringArray& other) const noexcept return ! operator== (other); } +void StringArray::swapWith (StringArray& other) noexcept +{ + strings.swapWithArray (other.strings); +} + void StringArray::clear() { strings.clear(); diff --git a/modules/juce_core/text/juce_StringArray.h b/modules/juce_core/text/juce_StringArray.h index 6deb6c1f5b..f1d191b9cc 100644 --- a/modules/juce_core/text/juce_StringArray.h +++ b/modules/juce_core/text/juce_StringArray.h @@ -90,6 +90,9 @@ public: StringArray& operator= (StringArray&& other) noexcept; #endif + /** Swaps the contents of this and another StringArray. */ + void swapWith (StringArray& other) noexcept; + //============================================================================== /** Compares two arrays. Comparisons are case-sensitive.