HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
UT_StringArray Class Reference

#include <UT_StringArray.h>

+ Inheritance diagram for UT_StringArray:

Classes

class  IndexedCompare
 

Public Types

using Parent = UT_Array< UT_StringHolder >
 
- Public Types inherited from UT_Array< UT_StringHolder >
typedef UT_StringHolder value_type
 
typedef int(* Comparator )(const UT_StringHolder *, const UT_StringHolder *)
 
typedef base_iterator
< UT_StringHolder, true > 
iterator
 
typedef base_iterator< const
UT_StringHolder, true > 
const_iterator
 
typedef base_iterator
< UT_StringHolder, false > 
reverse_iterator
 
typedef base_iterator< const
UT_StringHolder, false > 
const_reverse_iterator
 
typedef const_iterator traverser
 

Public Member Functions

 UT_StringArray ()
 
 UT_StringArray (const char **src)
 
 UT_StringArray (const Parent &src)
 
 UT_StringArray (Parent &&src) noexcept
 
 UT_StringArray (UT_StringArray &&src) noexcept=default
 
 UT_StringArray (const UT_StringArray &src)=default
 
UT_StringArrayoperator= (const UT_StringArray &src)=default
 
UT_StringArrayoperator= (UT_StringArray &&src)=default
 
UT_StringArrayoperator+= (const UT_StringArray &src)
 
exint remove (exint idx)
 
exint find (const UT_StringRef &str, exint s=0) const
 
exint sortedFind (const UT_StringRef &str, Comparator compare) const
 
void sort (bool forward, bool numbered)
 
void sort ()
 
void sort (Comparator compare)
 
template<typename ComparatorBool , typename = IsBoolComp<ComparatorBool>>
void sort (ComparatorBool is_less)
 Sort string array using custom comparator. More...
 
exint sortedInsert (const char *str, bool forward=true, bool numbered=true)
 
template<typename Compare >
void sortedInsert (const char *str, Compare is_less)
 
exint sortedFind (const char *str, bool forward=true, bool numbered=true) const
 
exint getLongestPrefixLength () const
 
void join (const char *sep, UT_String &result) const
 
void join (const char *sep, UT_WorkBuffer &result) const
 
void join (const char *sep, const char *sep_last, UT_String &result) const
 
void join (const char *sep, const char *sep_last, UT_WorkBuffer &result) const
 
unsigned hash () const
 
template<typename I >
void stableSortIndices (UT_Array< I > &indices) const
 
- Public Member Functions inherited from UT_Array< UT_StringHolder >
 UT_Array (const UT_Array< UT_StringHolder > &a)
 
 UT_Array (UT_Array< UT_StringHolder > &&a) noexcept
 Move constructor. Steals the working data from the original. More...
 
 UT_Array (const exint capacity, const exint size)
 Construct based on given capacity and size. More...
 
 UT_Array (const exint capacity=0)
 Construct based on given capacity with a size of 0. More...
 
 UT_Array (std::initializer_list< UT_StringHolder > init)
 
 ~UT_Array ()
 
void swap (UT_Array< UT_StringHolder > &other)
 
exint append ()
 
exint append (const UT_StringHolder &t)
 
exint append (UT_StringHolder &&t)
 
exint append (const UT_StringHolder &t, bool check_dup)
 
void append (const UT_StringHolder *pt, exint count)
 
void appendMultiple (const UT_StringHolder &t, exint count)
 
exint insert (exint index)
 
exint insert (const UT_StringHolder &t, exint i)
 
exint insert (UT_StringHolder &&t, exint i)
 
exint emplace_back (S &&...s)
 
exint uniqueSortedInsert (const UT_StringHolder &t, Comparator compare)
 
exint uniqueSortedInsert (const UT_StringHolder &t, ComparatorBool is_less={})
 
exint uniqueSortedInsert (UT_StringHolder &&t, Comparator compare)
 
exint uniqueSortedFind (const UT_StringHolder &item, ComparatorBool is_less={}) const
 
exint uniqueSortedFind (const UT_StringHolder &item, Comparator compare) const
 
void merge (const UT_Array< UT_StringHolder > &other, int direction, bool allow_dups, ComparatorBool is_less={})
 
bool hasSortedSubset (const UT_Array< UT_StringHolder > &other, ComparatorBool is_less={}) const
 
bool hasSortedSubset (const UT_Array< UT_StringHolder > &other, Comparator compare) const
 
void sortedUnion (const UT_Array< UT_StringHolder > &other, ComparatorBool is_less={})
 
void sortedUnion (const UT_Array< UT_StringHolder > &other, UT_Array< UT_StringHolder > &result, ComparatorBool is_less={}) const
 
void sortedUnion (const UT_Array< UT_StringHolder > &other, Comparator compare)
 
void sortedUnion (const UT_Array< UT_StringHolder > &other, UT_Array< UT_StringHolder > &result, Comparator compare) const
 
void sortedIntersection (const UT_Array< UT_StringHolder > &other, ComparatorBool is_less={})
 
void sortedIntersection (const UT_Array< UT_StringHolder > &other, UT_Array< UT_StringHolder > &result, ComparatorBool is_less={}) const
 
void sortedIntersection (const UT_Array< UT_StringHolder > &other, Comparator compare)
 
void sortedIntersection (const UT_Array< UT_StringHolder > &other, UT_Array< UT_StringHolder > &result, Comparator compare) const
 
void sortedSetDifference (const UT_Array< UT_StringHolder > &other, ComparatorBool is_less={})
 
void sortedSetDifference (const UT_Array< UT_StringHolder > &other, UT_Array< UT_StringHolder > &result, ComparatorBool is_less={}) const
 
void sortedSetDifference (const UT_Array< UT_StringHolder > &other, Comparator compare)
 
void sortedSetDifference (const UT_Array< UT_StringHolder > &other, UT_Array< UT_StringHolder > &result, Comparator compare) const
 
exint heapPush (const UT_StringHolder &t, Comparator compare)
 
UT_StringHolder heapPop (Comparator compare)
 
const UT_StringHolderheapMax () const
 
exint concat (const UT_Array< UT_StringHolder > &a)
 Takes another T array and concatenate it onto my end. More...
 
exint concat (UT_Array< UT_StringHolder > &&a) noexcept
 Takes another T array and concatenate it onto my end. More...
 
exint multipleInsert (exint index, exint count)
 Insert an element "count" times at the given index. Return the index. More...
 
exint insertAt (const UT_StringHolder &t, exint index)
 
bool isValidIndex (exint index) const
 Return true if given index is valid. More...
 
exint findAndRemove (const S &s)
 
exint removeIndex (exint index)
 
SYS_FORCE_INLINE void removeLast ()
 
void removeRange (exint begin_i, exint end_i)
 
void extractRange (exint begin_i, exint end_i, UT_Array< UT_StringHolder > &dest)
 
exint removeIf (IsEqual is_equal)
 
void collapseIf (IsEqual is_equal)
 Remove all matching elements. Also sets the capacity of the array. More...
 
void move (exint src_idx, exint dst_idx, exint how_many)
 
void cycle (exint how_many)
 Cyclically shifts the entire array by how_many. More...
 
void constant (const UT_StringHolder &v)
 Quickly set the array to a single value. More...
 
void zero ()
 Zeros the array if a POD type, else trivial constructs if a class type. More...
 
exint find (const S &s, exint start=0) const
 
exint sortedFind (const UT_StringHolder &t, Comparator compare) const
 
void reverse ()
 Reverses the array by swapping elements in mirrored locations. More...
 
void sort (ComparatorBool is_less={})
 Sort using std::sort with bool comparator. Defaults to operator<(). More...
 
void sort (Comparator compare)
 
void stdsort (ComparatorBool is_less)
 Sort using std::sort. The ComparatorBool uses the less-than semantics. More...
 
void stableSort (ComparatorBool is_less={})
 
void stableSortRange (ComparatorBool is_less, exint start, exint end)
 Like stableSort, but operates on a subset of the array. More...
 
void stableSortIndices (UT_Array< I > &indices, ComparatorBool is_less) const
 
void stableArgSort (UT_Array< I > &indices, ComparatorBool is_less) const
 
void stableSortByKey (const UT_Array< K > &keys, ComparatorBool is_less)
 
exint sortedRemoveDuplicates ()
 
exint sortedRemoveDuplicatesIf (CompareEqual compare_equal)
 
exint sortAndRemoveDuplicates (ComparatorBool is_less={})
 
UT_StringHolder selectNthLargest (exint idx, ComparatorBool is_less={})
 
void setCapacity (exint new_capacity)
 
void setCapacityIfNeeded (exint min_capacity)
 
void bumpCapacity (exint min_capacity)
 
void bumpSize (exint newsize)
 
void bumpEntries (exint newsize)
 
exint capacity () const
 
exint size () const
 
exint entries () const
 Alias of size(). size() is preferred. More...
 
void entries (exint newsize)
 Alias of setSize(). setSize() is preferred. More...
 
bool isEmpty () const
 Returns true iff there are no occupied elements in the array. More...
 
int64 getMemoryUsage (bool inclusive=false) const
 
void setSize (exint newsize)
 
void setSizeIfNeeded (exint minsize)
 
void setSizeNoInit (exint newsize)
 
void shrinkToFit ()
 shrinks the capacity to the current size More...
 
void setSizeAndShrink (exint new_size)
 convenience method to set size and shrink-to-fit in a single call More...
 
void truncate (exint maxsize)
 Decreases, but never expands, to the given maxsize. More...
 
void clear ()
 Resets list to an empty list. More...
 
UT_Array< UT_StringHolder > & operator= (const UT_Array< UT_StringHolder > &a)
 
UT_Array< UT_StringHolder > & operator= (std::initializer_list< UT_StringHolder > ilist)
 Replace the contents with those from the initializer_list ilist. More...
 
UT_Array< UT_StringHolder > & operator= (UT_Array< UT_StringHolder > &&a)
 Move the contents of array a to this array. More...
 
bool operator== (const UT_Array< UT_StringHolder > &a) const
 
bool operator!= (const UT_Array< UT_StringHolder > &a) const
 
bool isEqual (const UT_Array< UT_StringHolder > &a, ComparatorBool is_equal) const
 
int isEqual (const UT_Array< UT_StringHolder > &a, Comparator compare) const
 
UT_StringHolderoperator() (exint i)
 
const UT_StringHolderoperator() (exint i) const
 
UT_StringHolderoperator[] (exint i)
 
const UT_StringHolderoperator[] (exint i) const
 
UT_StringHolderforcedRef (exint i)
 
UT_StringHolder forcedGet (exint i) const
 
UT_StringHolderlast ()
 
const UT_StringHolderlast () const
 
exint apply (int(*apply_func)(UT_StringHolder &t, void *d), void *d)
 
UT_StringHolder accumulate (const UT_StringHolder &init_value, BinaryOp add) const
 
UT_StringHoldergetArray () const
 
const UT_StringHoldergetRawArray () const
 
UT_StringHolderarray ()
 
const UT_StringHolderarray () const
 
UT_StringHolderdata ()
 
const UT_StringHolderdata () const
 
UT_StringHolderaliasArray (UT_StringHolder *newdata)
 
iterator begin ()
 
const_iterator begin () const
 
iterator end ()
 End iterator. More...
 
const_iterator end () const
 End const iterator. Consider using it.atEnd() instead. More...
 
reverse_iterator rbegin ()
 Begin iterating over the array in reverse. More...
 
const_reverse_iterator rbegin () const
 Begin iterating over the array in reverse. More...
 
reverse_iterator rend ()
 End reverse iterator. More...
 
const_reverse_iterator rend () const
 End reverse iterator. Consider using it.atEnd() instead. More...
 
UT_IteratorRange< iteratorrange ()
 
UT_IteratorRange< const_iteratorrange () const
 
UT_IteratorRange
< reverse_iterator
rrange ()
 
UT_IteratorRange
< const_reverse_iterator
rrange () const
 
void removeItem (const reverse_iterator &it)
 Remove item specified by the reverse_iterator. More...
 
void unsafeShareData (UT_Array< UT_StringHolder > &src)
 
void unsafeShareData (UT_StringHolder *src, exint srcsize)
 
void unsafeShareData (UT_StringHolder *src, exint size, exint capacity)
 
void unsafeClearData ()
 
bool isHeapBuffer () const
 Returns true if the data used by the array was allocated on the heap. More...
 
exint sortedInsert (const UT_StringHolder &t, Comparator compare)
 
exint sortedInsert (const UT_StringHolder &t, ComparatorBool is_less={})
 
exint index (const UT_StringHolder &t) const
 
exint safeIndex (const UT_StringHolder &t) const
 

Additional Inherited Members

- Protected Member Functions inherited from UT_Array< UT_StringHolder >
 UT_Array (const UT_ArrayCT::ExternalCapacity, UT_StringHolder *external_data, const exint external_capacity)
 
 UT_Array (const UT_ArrayCT::ExternalMove, UT_StringHolder *external_data, const exint external_capacity, UT_Array &&a)
 
exint appendImpl (S &&s)
 
exint insertImpl (S &&s, exint index)
 Similar to appendImpl() but for insertion. More...
 
exint uniqueSortedInsertImpl (S &&s, Comparator compare)
 
void validateEmplaceArgs (First &&first, Rest &&...rest) const
 
void validateEmplaceArgs () const
 Base case for validateEmplaceArgs(). More...
 
- Static Protected Member Functions inherited from UT_Array< UT_StringHolder >
static constexpr
SYS_FORCE_INLINE bool 
isPOD ()
 
static void construct (UT_StringHolder &dst, S &&...s)
 
static void copyConstruct (UT_StringHolder &dst, const UT_StringHolder &src)
 

Detailed Description

Member Typedef Documentation

Definition at line 27 of file UT_StringArray.h.

Constructor & Destructor Documentation

UT_StringArray::UT_StringArray ( )
inline

Definition at line 32 of file UT_StringArray.h.

UT_StringArray::UT_StringArray ( const char **  src)
explicit
UT_StringArray::UT_StringArray ( const Parent src)
inline

Definition at line 37 of file UT_StringArray.h.

UT_StringArray::UT_StringArray ( Parent &&  src)
inlinenoexcept

Definition at line 40 of file UT_StringArray.h.

UT_StringArray::UT_StringArray ( UT_StringArray &&  src)
defaultnoexcept
UT_StringArray::UT_StringArray ( const UT_StringArray src)
default

Member Function Documentation

exint UT_StringArray::find ( const UT_StringRef str,
exint  s = 0 
) const
inline

Definition at line 56 of file UT_StringArray.h.

exint UT_StringArray::getLongestPrefixLength ( ) const
unsigned UT_StringArray::hash ( ) const
void UT_StringArray::join ( const char *  sep,
UT_String result 
) const
void UT_StringArray::join ( const char *  sep,
UT_WorkBuffer result 
) const
void UT_StringArray::join ( const char *  sep,
const char *  sep_last,
UT_String result 
) const
void UT_StringArray::join ( const char *  sep,
const char *  sep_last,
UT_WorkBuffer result 
) const
UT_StringArray& UT_StringArray::operator+= ( const UT_StringArray src)
UT_StringArray& UT_StringArray::operator= ( const UT_StringArray src)
default
UT_StringArray& UT_StringArray::operator= ( UT_StringArray &&  src)
default
exint UT_StringArray::remove ( exint  idx)
void UT_StringArray::sort ( bool  forward,
bool  numbered 
)
void UT_StringArray::sort ( )
inline

Definition at line 71 of file UT_StringArray.h.

void UT_StringArray::sort ( Comparator  compare)
inline

Definition at line 78 of file UT_StringArray.h.

template<typename ComparatorBool , typename = IsBoolComp<ComparatorBool>>
void UT_StringArray::sort ( ComparatorBool  is_less)
inline

Sort string array using custom comparator.

Definition at line 93 of file UT_StringArray.h.

exint UT_StringArray::sortedFind ( const UT_StringRef str,
Comparator  compare 
) const
inline

Definition at line 60 of file UT_StringArray.h.

exint UT_StringArray::sortedFind ( const char *  str,
bool  forward = true,
bool  numbered = true 
) const
exint UT_StringArray::sortedInsert ( const char *  str,
bool  forward = true,
bool  numbered = true 
)
template<typename Compare >
void UT_StringArray::sortedInsert ( const char *  str,
Compare  is_less 
)
inline

Definition at line 101 of file UT_StringArray.h.

template<typename I >
void UT_StringArray::stableSortIndices ( UT_Array< I > &  indices) const
inline

Definition at line 147 of file UT_StringArray.h.


The documentation for this class was generated from the following file: