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 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);
239 int numElementsToAdd = -1);
244 template <
typename Iterator>
247 ensureStorageAllocated (size() + (
int)
static_cast<size_t> (end - start));
250 strings.add (*start++);
260 bool ignoreCase =
false);
269 int addTokens (
StringRef stringToTokenise,
bool preserveQuotedStrings);
285 int addTokens (
StringRef stringToTokenise,
295 int addLines (
StringRef stringToBreakUp);
304 bool preserveQuotedStrings);
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();
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.
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() noexcept
Returns a pointer to the first String in the array.
String * end() noexcept
Returns a pointer to the String which follows the last element in the array.
int size() const noexcept
Returns the number of strings in the array.
const String * begin() const noexcept
Returns a pointer to the first String in the array.
bool isEmpty() const noexcept
Returns true if the array is empty, false otherwise.
const String * end() const noexcept
Returns a pointer to the String which follows the last element in the array.
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.