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) SYS_NOEXCEPT
 
 UT_StringArray (UT_StringArray &&src) SYS_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 find (const UT_StringRef &str, Comparator compare) const
 
void sort (bool forward, bool numbered)
 
void sort ()
 
void sort (Comparator compare)
 
template<typename Compare >
void sort (Compare is_less)
 
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, const char *sep_last, UT_String &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) SYS_NOEXCEPT
 Move constructor. Steals the working data from the original. More...
 
 UT_Array (exint capacity, exint size)
 Construct based on given capacity and size. More...
 
 UT_Array (exint capacity=0)
 Construct based on given capacity with a size of 0. More...
 
 UT_Array (std::initializer_list< UT_StringHolder > init)
 Construct with the contents of an initializer list. More...
 
 ~UT_Array ()
 
void swap (UT_Array< UT_StringHolder > &other)
 
exint append (void)
 
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 uniqueSortedFind (const UT_StringHolder &item, Comparator compare) const
 
exint uniqueSortedFind (const UT_StringHolder &item, ComparatorBool is_less) 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, Comparator compare) 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, 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, 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 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 UT_StringHolder &t)
 
exint removeIndex (exint index)
 
SYS_FORCE_INLINE void removeLast ()
 
void removeRange (exint begin_i, exint end_i)
 Remove the range [begin_i,end_i) of elements from the array. More...
 
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 srcIdx, exint destIdx, exint howMany)
 
void cycle (exint howMany)
 Cyclically shifts the entire array by howMany. 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 UT_StringHolder &t, exint s=0) const
 
exint find (const UT_StringHolder &t, Comparator compare) const
 
void reverse ()
 Reverses the array by swapping elements in mirrored locations. More...
 
exint index (const UT_StringHolder &t) const
 
exint safeIndex (const UT_StringHolder &t) const
 
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 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)
 
void sortAndRemoveDuplicates (ComparatorBool is_less)
 
UT_StringHolder selectNthLargest (exint idx, ComparatorBool is_less)
 
void setCapacity (exint newcapacity)
 
void setCapacityIfNeeded (exint mincapacity)
 
void bumpCapacity (exint mincapacity)
 
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 setSizeNoInit (exint newsize)
 
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
 
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(*applyFct)(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...
 
bool isHeapBuffer (UT_StringHolder *data) const
 
exint sortedInsert (const UT_StringHolder &t, Comparator compare)
 
exint sortedInsert (const UT_StringHolder &t, ComparatorBool is_less)
 

Additional Inherited Members

- Protected Member Functions inherited from UT_Array< UT_StringHolder >
exint appendImpl (S &&s)
 
exint insertImpl (S &&s, exint index)
 Similar to appendImpl() but for insertion. More...
 
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)
 
static void copyConstructRange (UT_StringHolder *dst, const UT_StringHolder *src, exint n)
 
static void trivialConstruct (UT_StringHolder &dst)
 Element Constructor. More...
 
static void trivialConstructRange (UT_StringHolder *dst, exint n)
 
static SYS_FORCE_INLINE void trivialDestruct (UT_StringHolder &dst)
 Element Destructor. More...
 
static void trivialDestructRange (UT_StringHolder *dst, exint n)
 

Detailed Description

Member Typedef Documentation

Definition at line 26 of file UT_StringArray.h.

Constructor & Destructor Documentation

UT_StringArray::UT_StringArray ( )
inline

Definition at line 31 of file UT_StringArray.h.

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

Definition at line 36 of file UT_StringArray.h.

UT_StringArray::UT_StringArray ( Parent &&  src)
inline

Definition at line 39 of file UT_StringArray.h.

UT_StringArray::UT_StringArray ( UT_StringArray &&  src)
default
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 55 of file UT_StringArray.h.

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

Definition at line 59 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,
const char *  sep_last,
UT_String 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 ( void  )
inline

Definition at line 69 of file UT_StringArray.h.

void UT_StringArray::sort ( Comparator  compare)
inline

Definition at line 72 of file UT_StringArray.h.

template<typename Compare >
void UT_StringArray::sort ( Compare  is_less)
inline

Definition at line 76 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 83 of file UT_StringArray.h.

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

Definition at line 126 of file UT_StringArray.h.


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