|
| | StringList (size_t ct, const char **list) |
| | Constructs a StringList from a C-style string array.
|
| |
| String | join (const String &delimiter) const |
| | Joins all strings using the given delimiter.
|
| |
| StringList | filter (TestFunc func) const |
| | Returns a new StringList containing only strings that match the predicate.
|
| |
| int | indexOf (const String &val) const |
| | Returns the index of the first occurrence of a string, or -1 if not found.
|
| |
|
| List ()=default |
| | Default constructor. Creates an empty list.
|
| |
| | List (size_t size) |
| | Constructs a list with a given number of default-constructed elements.
|
| |
| | List (size_t size, const T &defaultValue) |
| | Constructs a list with a given number of copies of a value.
|
| |
|
| List (const List &other) |
| | Copy constructor.
|
| |
|
| List (List &&other) noexcept |
| | Move constructor.
|
| |
| | List (std::initializer_list< T > initList) |
| | Constructs a list from an initializer list.
|
| |
| List & | operator+= (const T &item) |
| | Appends a single item to the back of the list.
|
| |
| List & | operator+= (T &&item) |
| | Appends a single item to the back of the list (move overload).
|
| |
| List & | operator+= (const List &list) |
| | Appends all items from another list to the back of this list.
|
| |
| List & | operator+= (List &&list) |
| | Appends all items from another list (move overload).
|
| |
|
List & | operator= (const List &other) |
| | Copy assignment operator.
|
| |
|
List & | operator= (List &&other) noexcept |
| | Move assignment operator.
|
| |
| List & | operator= (std::initializer_list< T > initList) |
| | Assigns from an initializer list, replacing all contents.
|
| |
|
| List ()=default |
| | Default constructor. Creates an empty list.
|
| |
| | List (size_t size) |
| | Constructs a list with a given number of default-constructed elements.
|
| |
| | List (size_t size, const String &defaultValue) |
| | Constructs a list with a given number of copies of a value.
|
| |
|
| List (const List &other) |
| | Copy constructor.
|
| |
|
| List (List &&other) noexcept |
| | Move constructor.
|
| |
| | List (std::initializer_list< String > initList) |
| | Constructs a list from an initializer list.
|
| |
|
| ~List ()=default |
| | Destructor.
|
| |
|
List & | operator= (const List &other) |
| | Copy assignment operator.
|
| |
|
List & | operator= (List &&other) noexcept |
| | Move assignment operator.
|
| |
| List & | operator= (std::initializer_list< String > initList) |
| | Assigns from an initializer list, replacing all contents.
|
| |
| List & | operator+= (const String &item) |
| | Appends a single item to the back of the list.
|
| |
| List & | operator+= (String &&item) |
| | Appends a single item to the back of the list (move overload).
|
| |
| List & | operator+= (const List &list) |
| | Appends all items from another list to the back of this list.
|
| |
| List & | operator+= (List &&list) |
| | Appends all items from another list (move overload).
|
| |
|
Iterator | begin () noexcept |
| | Returns a mutable iterator to the first element.
|
| |
|
ConstIterator | begin () const noexcept |
| | Returns a const iterator to the first element.
|
| |
|
ConstIterator | cbegin () const noexcept |
| | Returns a const iterator to the first element.
|
| |
| ConstIterator | constBegin () const noexcept |
| | Returns a const iterator to the first element.
|
| |
|
RevIterator | rbegin () noexcept |
| | Returns a mutable reverse iterator to the last element.
|
| |
| RevIterator | revBegin () noexcept |
| | Returns a mutable reverse iterator to the last element.
|
| |
|
ConstRevIterator | crbegin () const noexcept |
| | Returns a const reverse iterator to the last element.
|
| |
| ConstRevIterator | constRevBegin () const noexcept |
| | Returns a const reverse iterator to the last element.
|
| |
|
Iterator | end () noexcept |
| | Returns a mutable iterator to one past the last element.
|
| |
|
ConstIterator | end () const noexcept |
| | Returns a const iterator to one past the last element.
|
| |
|
ConstIterator | cend () const noexcept |
| | Returns a const iterator to one past the last element.
|
| |
| ConstIterator | constEnd () const noexcept |
| | Returns a const iterator to one past the last element.
|
| |
|
RevIterator | rend () noexcept |
| | Returns a mutable reverse iterator to one before the first element.
|
| |
| RevIterator | revEnd () noexcept |
| | Returns a mutable reverse iterator to one before the first element.
|
| |
|
ConstRevIterator | crend () const noexcept |
| | Returns a const reverse iterator to one before the first element.
|
| |
| ConstRevIterator | constRevEnd () const noexcept |
| | Returns a const reverse iterator to one before the first element.
|
| |
| String & | at (size_t index) |
| | Returns a reference to the element at index with bounds checking.
|
| |
| const String & | at (size_t index) const |
| | Returns a reference to the element at index with bounds checking.
|
| |
| String & | operator[] (size_t index) |
| | Returns a reference to the element at index without bounds checking.
|
| |
| const String & | operator[] (size_t index) const |
| | Returns a reference to the element at index without bounds checking.
|
| |
|
String & | front () |
| | Returns a reference to the first element.
|
| |
| const String & | front () const |
| | Returns a reference to the first element.
|
| |
|
String & | back () |
| | Returns a reference to the last element.
|
| |
| const String & | back () const |
| | Returns a reference to the last element.
|
| |
|
String * | data () noexcept |
| | Returns a pointer to the underlying contiguous storage.
|
| |
| const String * | data () const noexcept |
| | Returns a pointer to the underlying contiguous storage.
|
| |
|
bool | isEmpty () const noexcept |
| | Returns true if the list has no elements.
|
| |
|
size_t | size () const noexcept |
| | Returns the number of elements in the list.
|
| |
|
size_t | maxSize () const noexcept |
| | Returns the maximum number of elements the list can theoretically hold.
|
| |
| void | reserve (size_t newCapacity) |
| | Pre-allocates storage for at least newCapacity elements.
|
| |
|
size_t | capacity () const noexcept |
| | Returns the number of elements the list can hold without reallocating.
|
| |
|
void | shrink () |
| | Releases unused memory by shrinking capacity to fit the current size.
|
| |
|
void | clear () noexcept |
| | Removes all elements from the list.
|
| |
| Iterator | insert (ConstIterator pos, const String &value) |
| | Inserts a value before the position given by an iterator.
|
| |
| Iterator | insert (ConstIterator pos, String &&value) |
| | Inserts a value before the position given by an iterator (move overload).
|
| |
| Iterator | insert (size_t pos, const String &value) |
| | Inserts a value before the given index.
|
| |
| Iterator | insert (size_t pos, String &&value) |
| | Inserts a value before the given index (move overload).
|
| |
| Iterator | emplace (ConstIterator pos, Args &&...args) |
| | Emplaces an object right before the given position.
|
| |
| Iterator | emplace (size_t pos, Args &&...args) |
| | Emplaces an object right before the given index.
|
| |
| Iterator | remove (ConstIterator pos) |
| | Removes the element at the given iterator position.
|
| |
| Iterator | remove (size_t index) |
| | Removes the element at the given index.
|
| |
| Iterator | erase (ConstIterator first, ConstIterator last) |
| | Removes elements in the range [first, last).
|
| |
| void | removeIf (TestFunc func) |
| | Runs a test function on all the items and removes them if it returns true.
|
| |
| bool | removeFirst (const String &value) |
| | Removes the first instance of value from the list.
|
| |
| void | pushToBack (const String &value) |
| | Pushes an item onto the back of the list.
|
| |
| void | pushToBack (const List< String > &list) |
| | Pushes all items from another list to the back of this list.
|
| |
| void | pushToBack (String &&value) |
| | Moves an item onto the back of the list.
|
| |
| void | pushToBack (List< String > &&list) |
| | Moves all items from another list to the back of this list.
|
| |
| String & | emplaceToBack (Args &&...args) |
| | Emplaces an object on the back of the list.
|
| |
|
void | popFromBack () |
| | Removes the last element from the list.
|
| |
| void | resize (size_t newSize) |
| | Resizes the list.
|
| |
| void | resize (size_t newSize, const String &value) |
| | Resizes the list, constructs any new items with the given value.
|
| |
| void | swap (List< String > &other) noexcept |
| | Swaps the list data with another list of the same type.
|
| |
| bool | set (size_t index, const String &val) |
| | Sets an item in the list by index.
|
| |
| List< String > | sort () const |
| | Returns a sorted copy of this list.
|
| |
| List< String > | reverse () const |
| | Returns a reversed copy of this list.
|
| |
| List< String > | unique () |
| | Returns a list of all the unique items in this list.
|
| |
| void | forEach (Func &&func) const |
| | Calls func for every element.
|
| |
| bool | contains (const String &val) const |
| | Returns true if the list contains the given value.
|
| |
| ssize_t | indexOf (const String &value) const |
| | Returns the index of the first occurrence of value.
|
| |
| ssize_t | lastIndexOf (const String &value) const |
| | Returns the index of the last occurrence of value.
|
| |
| size_t | count (const String &value) const |
| | Returns the number of occurrences of value.
|
| |
| List< String > | mid (size_t pos, size_t length) const |
| | Returns a sublist starting at pos with length elements.
|
| |
Manages a list of strings.