55 template <
typename... OtherElements>
59 StringArray (
const std::initializer_list<const char*>& strings);
65 template <
typename Type>
68 addArray (stringArray.
begin(), stringArray.
end());
82 StringArray (
const char*
const* strings,
int numberOfStrings);
89 explicit StringArray (
const char*
const* strings);
95 explicit StringArray (
const wchar_t*
const* strings);
102 StringArray (
const wchar_t*
const* strings,
int numberOfStrings);
108 StringArray& operator= (
const StringArray&);
111 StringArray& operator= (StringArray&&) noexcept;
114 template <
typename Type>
117 addArray (stringArray.
begin(), stringArray.
end());
122 void swapWith (StringArray&) noexcept;
129 bool operator== (
const StringArray&)
const noexcept;
135 bool operator!= (
const StringArray&)
const noexcept;
139 inline int size() const noexcept {
return strings.size(); }
142 inline bool isEmpty() const noexcept {
return size() == 0; }
151 const String& operator[] (
int index)
const noexcept;
157 String& getReference (
int index) noexcept;
167 inline const String*
begin() const noexcept {
return strings.begin(); }
177 inline const String*
end() const noexcept {
return strings.end(); }
186 bool contains (
StringRef stringToLookFor,
187 bool ignoreCase =
false)
const;
200 bool ignoreCase =
false,
201 int startIndex = 0)
const;
205 void add (
String stringToAdd);
214 void insert (
int index,
String stringToAdd);
221 bool addIfNotAlreadyThere (
const String& stringToAdd,
bool ignoreCase =
false);
228 void set (
int index,
String newString);
237 void addArray (
const StringArray& other,
239 int numElementsToAdd = -1);
244 template <
typename Iterator>
247 ensureStorageAllocated (size() + (
int) static_cast<size_t> (end - start));
250 strings.add (*start++);
259 void mergeArray (
const StringArray& other,
260 bool ignoreCase =
false);
269 int addTokens (
StringRef stringToTokenise,
bool preserveQuotedStrings);
285 int addTokens (
StringRef stringToTokenise,
295 int addLines (
StringRef stringToBreakUp);
303 static StringArray fromTokens (
StringRef stringToTokenise,
304 bool preserveQuotedStrings);
319 static StringArray fromTokens (
StringRef stringToTokenise,
329 static StringArray fromLines (
StringRef stringToBreakUp);
343 void remove (
int index);
349 void removeString (
StringRef stringToRemove,
350 bool ignoreCase =
false);
363 void removeRange (
int startIndex,
int numberToRemove);
372 void removeDuplicates (
bool ignoreCase);
378 void removeEmptyStrings (
bool removeWhitespaceStrings =
true);
394 void move (
int currentIndex,
int newIndex) noexcept;
414 void appendNumbersToDuplicates (
bool ignoreCaseWhenComparing,
415 bool appendNumberToFirstInstance,
434 int numberOfElements = -1)
const;
440 void sort (
bool ignoreCase);
455 void ensureStorageAllocated (
int minNumElements);
463 void minimiseStorageOverheads();
471 JUCE_LEAK_DETECTOR (StringArray)
bool isEmpty() const noexcept
Returns true if the array is empty, false otherwise.
#define JUCE_API
This macro is added to all JUCE public class declarations.
const String * begin() const noexcept
Returns a pointer to the first String in the array.
String * begin() noexcept
Returns a pointer to the first String in the array.
StringArray(const Array< Type > &stringArray)
Creates a StringArray from an array of objects which can be implicitly converted to Strings...
ElementType * end() noexcept
Returns a pointer to the element which follows the last element in the array.
A simple class for holding temporary references to a string literal or String.
String * end() noexcept
Returns a pointer to the String which follows the last element in the array.
StringArray(StringRef firstValue, OtherElements... otherValues)
Creates an array containing a list of strings.
A special array for holding a list of strings.
ElementType * begin() noexcept
Returns a pointer to the first element in the array.
const String * end() const noexcept
Returns a pointer to the String which follows the last element in the array.
Holds a resizable array of primitive or copy-by-value objects.
int size() const noexcept
Returns the number of strings in the array.
Array< String > strings
This is the array holding the actual strings.
void addArray(Iterator &&start, Iterator &&end)
Adds items from a range of start/end iterators of some kind of objects which can be implicitly conver...
Wraps a pointer to a null-terminated UTF-8 character string, and provides various methods to operate ...