|
| | dictionary (bool caseSensitive=false) noexcept |
| | Constructor.
|
| | dictionary (const dictionary &other) noexcept |
| | Copy constructor.
|
|
| ~dictionary () noexcept |
| | Destructor.
|
|
void | clear () noexcept |
| | Empty the word list.
|
| bool | read (const zstring &filename, const core::timeout &time=-1, bool assumePresorted=false) |
| | Read this dictionary's word list as text from a file.
|
| void | write (const zstring &filename) |
| | Write this dictionary's word list to a file.
|
| bool | isWord (const zstring &word) const noexcept |
| | Check if the given string is a valid word in the dictionary (case is ignored).
|
| void | addWord (const zstring &word) noexcept |
| | Add a word to the dictionary.
|
| bool | isCaseSensitive () const noexcept |
| | Check whether this dictionary is case sensitive.
|
| void | setCaseSensitive (bool caseSensitive) noexcept |
| | Set the case sensitivity of this dictionary.
|
| dictRange | range () const noexcept |
| | Create a new range of words encompassing the whole dictionary.
|
| bool | narrow (dictRange *wordRange, uint32_t nextChar) const noexcept |
| | Narrow the results of a range given the next character.
|
| int | maxWordLength () const noexcept |
| | Get the length of the longest word in the dictionary.
|
| dictionary | filter (std::function< bool(const zstring &)> lambda) const |
| | Filters the dictionary based on a predicate and returns a new dictionary containing the words that satisfy the predicate.
|
| dictionary & | operator= (dictionary &&other) noexcept |
| | Dictionary move operator.
|
| dictionary & | operator= (const dictionary &other) noexcept |
| | Dictionary assignment operator.
|
| z::core::array< zstring > | findPermutations (const zstring &scrambled) const noexcept |
| | Find all permutations of a given scrambled word that are valid words in the dictionary.
|
|
| sortedRefArray () |
| | Default constructor.
|
| virtual bool | operator() (const zstring *&arg1, const zstring *&arg2) const override |
| | Callable operator.
|
|
| sortedArray () |
| | Default constructor.
|
| virtual int | add (const zstring *&object) override |
| | Add an object to the array.
|
| virtual int | find (const zstring *&object) const override |
| | Check if a given object is in the array.
|
| virtual int | findInsert (const zstring *&object, bool allowDuplicates=true) const |
| | Find an index where the given object can be inserted while keeping the array sorted.
|
| virtual void | shuffle () noexcept override |
| | Shuffle the elements of the array into a random order.
|
| virtual void | reverse () noexcept override |
| | Reverse the order of all elements in the array.
|
|
| array () |
| | Default constructor.
|
|
virtual | ~array () |
| | Destructor.
|
|
void | clear () |
| | Clear the data in the array.
|
| void | increase (int newSize) noexcept |
| | Increase the space allocated for this array.
|
| int | push (const zstring *&object) noexcept |
| | Add an object to the array.
|
| zstring * | pop () |
| | Remove the last element from this array.
|
| array & | insert (const zstring *&, int) |
| | Insert an object into the array.
|
| void | append (const zstring *&) |
| | Append an object to the end of the array.
|
| array & | remove (int) |
| | Remove an object from the array.
|
| array & | replace (int, int, const zstring *&) |
| | Replace all objects in the given range with an object.
|
| array | subset (int index, int count) const |
| | Get a contiguous subset of the elements in the array.
|
| size_t | size () const noexcept override |
| | Get the size of the array.
|
| int | length () const noexcept override |
| | Get the length of the array.
|
| zstring *& | at (int) |
| | Function to get the object at the given index.
|
| const zstring *& | operator[] (int index) const override |
| | Function to get the object at the given index.
|
| bool | contains (const zstring *&object) const noexcept |
| | Check if a given object is in the array.
|
| void | sort () noexcept |
| | Sort the array based on default comparison operator.
|
| array | sorted () const noexcept |
| | Sort the array based on default comparison operator.
|
| array | shuffled () const noexcept |
| | Shuffle the elements of the array into a random order.
|
| array | reversed () const noexcept |
| | Reverse the order of all elements in the array.
|
| array & | operator= (const array &other) |
| | Array assignment operator.
|
| bool | operator== (const array &other) const |
| | Check whether two arrays' contents are the same.
|
| bool | operator> (const array &other) const |
| | Array greater-than operator.
|
| bool | operator< (const array &other) const |
| | Array less-than operator.
|
| bool | operator!= (const array &other) const |
| | Check whether two arrays' contents are different.
|
| bool | operator>= (const array &other) const |
| | Array greater-than-or-equal operator.
|
| bool | operator<= (const array &other) const |
| | Array less-than-or-equal operator.
|
| bool | isValid (int index) const |
| | Check if an index is within the bounds of the array.
|
| array & | swap (int index1, int index2) |
| | Swap two elements in an array.
|
| array< U > | map (std::function< U(const zstring *&)> lambda) const |
| | Applies a transformation function to each element of the array and returns a new array with the results.
|
| array | filter (std::function< bool(const zstring *&)> lambda) const |
| | Filters the array based on a predicate and returns a new array containing the elements that satisfy the predicate.
|
| zstring * | reduce (std::function< zstring *(const zstring *&, const zstring *&)> lambda, const zstring *&defaultValue={}) const |
| | Reduces the array to a single value by applying a binary operation cumulatively to the elements.
|
| array< U > | operator| (std::function< U(zstring *)> lambda) noexcept |
| array | operator&& (std::function< zstring *(const zstring *&)> lambda) noexcept |
| zstring * | operator>> (std::function< zstring *(const zstring *&, const zstring *&)> lambda) |
| | Reduces the array to a single value by applying a binary operation cumulatively to the elements.
|
| zstring * | randomElement () const |
| | Get a random element from the array.
|
| array | randomElements (int count) const noexcept |
| | Get N random elements from the array.
|
| zstring ** | begin () const noexcept override |
| | Get pointer to the beginning of the array.
|
| zstring ** | end () const noexcept override |
| | Get pointer to the end of the array.
|
| virtual T | at (int index) const =0 |
| | Function to get the object at the given index.
|