51 template <
typename... OtherElements>
55 StringArray (
const std::initializer_list<const char*>& strings);
61 template <typename Type>
64 addArray (stringArray.begin(), stringArray.end());
78 StringArray (
const char*
const* strings,
int numberOfStrings);
91 explicit StringArray (
const wchar_t*
const* strings);
98 StringArray (
const wchar_t*
const* strings,
int numberOfStrings);
110 template <typename Type>
113 addArray (stringArray.begin(), stringArray.end());
125 bool operator== (
const StringArray&)
const noexcept;
131 bool operator!= (
const StringArray&)
const noexcept;
135 inline int size() const noexcept {
return strings.size(); }
138 inline bool isEmpty() const noexcept {
return size() == 0; }
147 const String& operator[] (
int index)
const noexcept;
153 String& getReference (
int index)
noexcept;
163 inline const String*
begin() const noexcept {
return strings.begin(); }
173 inline const String*
end() const noexcept {
return strings.end(); }
182 bool contains (
StringRef stringToLookFor,
183 bool ignoreCase =
false)
const;
196 bool ignoreCase =
false,
197 int startIndex = 0)
const;
201 void add (
String stringToAdd);
210 void insert (
int index,
String stringToAdd);
217 bool addIfNotAlreadyThere (
const String& stringToAdd,
bool ignoreCase =
false);
224 void set (
int index,
String newString);
235 int numElementsToAdd = -1);
240 template <
typename Iterator>
243 ensureStorageAllocated (size() + (
int)
static_cast<size_t> (end - start));
246 strings.add (*start++);
256 bool ignoreCase =
false);
265 int addTokens (
StringRef stringToTokenise,
bool preserveQuotedStrings);
281 int addTokens (
StringRef stringToTokenise,
291 int addLines (
StringRef stringToBreakUp);
300 bool preserveQuotedStrings);
339 void remove (
int index);
345 void removeString (
StringRef stringToRemove,
346 bool ignoreCase =
false);
359 void removeRange (
int startIndex,
int numberToRemove);
368 void removeDuplicates (
bool ignoreCase);
374 void removeEmptyStrings (
bool removeWhitespaceStrings =
true);
390 void move (
int currentIndex,
int newIndex)
noexcept;
410 void appendNumbersToDuplicates (
bool ignoreCaseWhenComparing,
411 bool appendNumberToFirstInstance,
430 int numberOfElements = -1)
const;
436 void sort (
bool ignoreCase);
451 void ensureStorageAllocated (
int minNumElements);
459 void minimiseStorageOverheads();
StringArray(StringRef firstValue, OtherElements... otherValues)
const String * begin() const noexcept
void addArray(Iterator &&start, Iterator &&end)
int size() const noexcept
const String * end() const noexcept
bool isEmpty() const noexcept
String * begin() noexcept