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);
95 explicit StringArray (
const wchar_t*
const* strings);
102 StringArray (
const wchar_t*
const* strings,
int numberOfStrings);
114 template <typename Type>
117 addArray (stringArray.begin(), stringArray.end());
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 String*
end() const noexcept {
return strings.end(); }
175 bool contains (
StringRef stringToLookFor,
176 bool ignoreCase =
false)
const;
189 bool ignoreCase =
false,
190 int startIndex = 0)
const;
194 void add (
String stringToAdd);
203 void insert (
int index,
String stringToAdd);
210 bool addIfNotAlreadyThere (
const String& stringToAdd,
bool ignoreCase =
false);
217 void set (
int index,
String newString);
228 int numElementsToAdd = -1);
233 template <
typename Iterator>
236 ensureStorageAllocated (size() + (
int)
static_cast<size_t> (end - start));
239 strings.add (*start++);
249 bool ignoreCase =
false);
258 int addTokens (
StringRef stringToTokenise,
bool preserveQuotedStrings);
274 int addTokens (
StringRef stringToTokenise,
284 int addLines (
StringRef stringToBreakUp);
293 bool preserveQuotedStrings);
332 void remove (
int index);
338 void removeString (
StringRef stringToRemove,
339 bool ignoreCase =
false);
352 void removeRange (
int startIndex,
int numberToRemove);
361 void removeDuplicates (
bool ignoreCase);
367 void removeEmptyStrings (
bool removeWhitespaceStrings =
true);
383 void move (
int currentIndex,
int newIndex)
noexcept;
403 void appendNumbersToDuplicates (
bool ignoreCaseWhenComparing,
404 bool appendNumberToFirstInstance,
423 int numberOfElements = -1)
const;
429 void sort (
bool ignoreCase);
444 void ensureStorageAllocated (
int minNumElements);
452 void minimiseStorageOverheads();
Holds a resizable array of primitive or copy-by-value objects.
Wraps a pointer to a null-terminated UTF-8 character string, and provides various methods to operate ...
A special array for holding a list of strings.
StringArray(StringRef firstValue, OtherElements... otherValues)
Creates an array containing a list of strings.
String * end() const noexcept
Returns a pointer to the String which follows the last element 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...
String * begin() const noexcept
Returns a pointer to the first String in the array.
int size() const noexcept
Returns the number of strings in the array.
bool isEmpty() const noexcept
Returns true if the array is empty, false otherwise.
A simple class for holding temporary references to a string literal or String.
#define JUCE_API
This macro is added to all JUCE public class declarations.