31 : strings (other.strings)
36 : strings (std::move (other.strings))
41 : strings (std::move (other))
88 strings = std::move (other.strings);
94 return strings == other.strings;
104 strings.swapWith (other.strings);
119 if (isPositiveAndBelow (index, strings.size()))
120 return strings.getReference (index);
128 return strings.getReference (index);
133 return strings.getReference (index);
232 for (
int i =
size(); --i >= 0;)
238 for (
int i =
size(); --i >= 0;)
254 for (
int i =
size(); --i >= 0;)
255 if (!
strings.getReference (i).containsNonWhitespaceChars())
260 for (
int i =
size(); --i >= 0;)
261 if (
strings.getReference (i).isEmpty())
277 [] (
const String& a,
const String& b) { return a.compareIgnoreCase (b) < 0; });
285 [] (
const String& a,
const String& b) { return a.compareNatural (b) < 0; });
300 if (start == last - 1)
301 return strings.getReference (start);
306 for (
int i = start; i < last; ++i)
307 bytesNeeded +=
strings.getReference (i).getCharPointer().sizeInBytes() -
sizeof (String::CharPointerType::CharType);
316 auto& s =
strings.getReference (start);
319 dest.writeAll (s.getCharPointer());
340 for (
auto t = text.
text;;)
362 bool finished = text.isEmpty();
370 switch (text.getAndAdvance())
372 case 0: finished =
true;
break;
374 case '\r':
if (*text ==
'\n') ++text;
break;
413 for (
int i = 0; i <
size() - 1; ++i)
415 auto s =
strings.getReference (i);
417 for (
int nextIndex = i + 1;;)
419 nextIndex =
indexOf (s, ignoreCase, nextIndex);
440 for (
int i = 0; i <
size() - 1; ++i)
442 auto& s =
strings.getReference (i);
443 auto nextIndex =
indexOf (s, ignoreCase, i + 1);
455 while (nextIndex >= 0)
471 strings.minimiseStorageOverheads();
static Type findEndOfToken(Type text, BreakType breakCharacters, Type quoteCharacters)
bool operator==(const StringArray &) const noexcept
String joinIntoString(StringRef separatorString, int startIndex=0, int numberOfElements=-1) const
void appendNumbersToDuplicates(bool ignoreCaseWhenComparing, bool appendNumberToFirstInstance, CharPointer_UTF8 preNumberString=CharPointer_UTF8(nullptr), CharPointer_UTF8 postNumberString=CharPointer_UTF8(nullptr))
String & getReference(int index) noexcept
void removeEmptyStrings(bool removeWhitespaceStrings=true)
void addArray(const StringArray &other, int startIndex=0, int numElementsToAdd=-1)
int indexOf(StringRef stringToLookFor, bool ignoreCase=false, int startIndex=0) const
bool contains(StringRef stringToLookFor, bool ignoreCase=false) const
void removeDuplicates(bool ignoreCase)
static StringArray fromTokens(StringRef stringToTokenise, bool preserveQuotedStrings)
void insert(int index, String stringToAdd)
static StringArray fromLines(StringRef stringToBreakUp)
void minimiseStorageOverheads()
const String & operator[](int index) const noexcept
void removeString(StringRef stringToRemove, bool ignoreCase=false)
void sort(bool ignoreCase)
void move(int currentIndex, int newIndex) noexcept
void swapWith(StringArray &) noexcept
int size() const noexcept
bool operator!=(const StringArray &) const noexcept
void add(String stringToAdd)
int addLines(StringRef stringToBreakUp)
void mergeArray(const StringArray &other, bool ignoreCase=false)
bool addIfNotAlreadyThere(const String &stringToAdd, bool ignoreCase=false)
void removeRange(int startIndex, int numberToRemove)
StringArray & operator=(const StringArray &)
void set(int index, String newString)
void ensureStorageAllocated(int minNumElements)
int addTokens(StringRef stringToTokenise, bool preserveQuotedStrings)
bool isNotEmpty() const noexcept
String::CharPointerType text
CharPointerType getCharPointer() const noexcept
void preallocateBytes(size_t numBytesNeeded)