Gray C++ Libraries  0.0.2
A set of C++ libraries for MSVC, GNU on Windows, WinCE, Linux
Gray::cArraySortString< _TYPE_CH > Class Template Reference

#include <cArraySortString.h>

Inheritance diagram for Gray::cArraySortString< _TYPE_CH >:
Gray::cArraySorted< cStringT< TCHAR >, cStringT< TCHAR >, const TCHAR * > Gray::cArrayTyped< TYPE, ARG_TYPE > Gray::CArray< TYPE, const TYPE & > Gray::CObject

Public Types

typedef cArraySorted< cStringT< _TYPE_CH >, cStringT< _TYPE_CH >, const _TYPE_CH * > SUPER_t
 
typedef cStringT< _TYPE_CH > STR_t
 
typedef SUPER_t::REF_t REF_t
 
typedef SUPER_t::KEY_t KEY_t
 
- Public Types inherited from Gray::cArraySorted< cStringT< TCHAR >, cStringT< TCHAR >, const TCHAR * >
typedef cArrayTyped< cStringT< TCHAR >, cStringT< TCHAR > > SUPER_t
 
typedef const TCHAR * KEY_t
 
typedef SUPER_t::REF_t REF_t
 
- Public Types inherited from Gray::cArrayTyped< TYPE, ARG_TYPE >
typedef CArray< TYPE, ARG_TYPE > SUPER_t
 
typedef cArrayTyped< TYPE, ARG_TYPE > THIS_t
 
typedef ITERATE_t iterator
 
typedef ITERATE_t const_iterator
 
typedef TYPE ELEM_t
 What type is stored. More...
 
typedef ARG_TYPE REF_t
 How to refer to this? value or ref or pointer? More...
 

Public Member Functions

virtual ~cArraySortString ()
 
virtual COMPARE_t CompareKey (KEY_t pszID1, REF_t sID2) const override
 
virtual COMPARE_t CompareData (REF_t sID1, REF_t sID2) const noexcept override
 
ITERATE_t AddStr (const _TYPE_CH *pszStr)
 
ITERATE_t FindKeyRoot (const _TYPE_CH *pszRoot)
 
ITERATE_t FindKeyDerived (const _TYPE_CH *pszDerived)
 
- Public Member Functions inherited from Gray::cArraySorted< cStringT< TCHAR >, cStringT< TCHAR >, const TCHAR * >
virtual ~cArraySorted ()
 
ITERATE_t FindINear (REF_t pNew, COMPARE_t &iCompareRes) const
 
ITERATE_t FindINearKey (KEY_t key, COMPARE_t &iCompareRes) const
 
ITERATE_t FindIForKey (KEY_t key) const
 
ITERATE_t FindIFirstForKey (const TCHAR * nKey) const
 
ITERATE_t FindILastForKey (const TCHAR * nKey) const
 
ITERATE_t AddPresorted (ITERATE_t index, COMPARE_t iCompareRes, cStringT< TCHAR > pNew)
 
bool RemoveKey (const TCHAR * key)
 
ITERATE_t Add (cStringT< TCHAR > pNew)
 
void AddArray (const SUPER_t &a)
 
- Public Member Functions inherited from Gray::cArrayTyped< TYPE, ARG_TYPE >
 cArrayTyped () noexcept
 
 cArrayTyped (const THIS_t &rArray)
 
 cArrayTyped (ITERATE_t iSize)
 
virtual ~cArrayTyped ()
 
bool isValidCheck () const noexcept
 < memory allocation and structure definitions are valid. More...
 
bool IsValidIndex (ITERATE_t i) const noexcept
 
ITERATE_t ClampValidIndex (ITERATE_t i) const noexcept
 
size_t GetHeapStats (OUT ITERATE_t &iAllocCount) const noexcept
 
void AssertValidIndex (ITERATE_t nIndex) const
 
const TYPEGetAtSecure (ITERATE_t nIndex) const
 
TYPEElementAtSecure (ITERATE_t nIndex)
 
REF_t ConstElementAt (ITERATE_t nIndex) const
 
TYPEoperator[] (ITERATE_t nIndex)
 
const TYPEoperator[] (ITERATE_t nIndex) const
 
TYPEHead ()
 
TYPETail ()
 
TYPEElementAtHead ()
 
TYPEElementAtTail ()
 
REF_t ConstHead () const
 
REF_t ConstTail () const
 
REF_t GetAtTail ()
 
void UnLinkIndex (ITERATE_t nIndex)
 
void Swap (ITERATE_t i, ITERATE_t j)
 
void SetCopy (const cArrayTyped< TYPE, ARG_TYPE > &aValues)
 
const cArrayTyped< TYPE, ARG_TYPE > & operator= (const cArrayTyped< TYPE, ARG_TYPE > &aValues)
 
ITERATE_t FindIFor (ARG_TYPE arg) const
 
bool HasArg (ARG_TYPE arg) const
 
void RemoveLast ()
 
ELEM_t PopHead ()
 
ELEM_t PopTail ()
 
bool RemoveArg (ARG_TYPE arg)
 
void UnLinkArg (ARG_TYPE arg)
 
ITERATE_t AddTail (ARG_TYPE newElement)
 
ITERATE_t PushTail (ARG_TYPE newElement)
 
void AddHead (ARG_TYPE newElement)
 
TYPEget_DataWork () const
 
void AddArray (const SUPER_t &src)
 
bool IsEqualArray (const SUPER_t &aValues) const
 
bool isArraySorted () const
 
bool isArraySortedND () const
 
void QSort ()
 
- Public Member Functions inherited from Gray::CArray< TYPE, const TYPE & >
 CArray () noexcept
 
 CArray (THIS_t &&ref) noexcept
 
virtual ~CArray ()
 
bool IsValidMallocSize () const noexcept
 
ITERATE_t GetSize () const noexcept
 
ITERATE_t GetUpperBound () const noexcept
 
bool IsEmpty () const noexcept
 
void SetSize (ITERATE_t nNewSize)
 
ITERATE_t GetMallocSize () const noexcept
 
void RemoveAll ()
 Clean up. More...
 
const TYPEGetAt (ITERATE_t nIndex) const
 
TYPEElementAt (ITERATE_t nIndex)
 
void SetAt (ITERATE_t nIndex, const TYPE & newElement)
 
const TYPEGetData () const
 
TYPEGetData ()
 
void SetDataArrayPtr (TYPE *pData, ITERATE_t nSize)
 
void SetAtGrow (ITERATE_t nIndex, const TYPE & newElement)
 
ITERATE_t Add (const TYPE & newElement)
 
void Copy (const CArray &src)
 
TYPEoperator[] (ITERATE_t nIndex)
 
const TYPEoperator[] (ITERATE_t nIndex) const
 
void InsertAt (ITERATE_t nIndex, const TYPE & newElement)
 
void RemoveAt (ITERATE_t nIndex)
 
void RemoveAt (ITERATE_t nIndex, ITERATE_t iQty)
 
void MoveElement (ITERATE_t iFrom, ITERATE_t iTo)
 
- Public Member Functions inherited from Gray::CObject
virtual ~CObject ()
 
virtual void AssertValid () const
 < memory allocation and structure definitions are valid. More...
 
virtual void Serialize (cArchive &a)
 

Friends

class cArraySortStringTests
 

Additional Inherited Members

- Protected Member Functions inherited from Gray::cArraySorted< cStringT< TCHAR >, cStringT< TCHAR >, const TCHAR * >
virtual COMPARE_t CompareKey (KEY_t key1, REF_t Data2) const
 
bool RemoveArgKey (REF_t pObj, KEY_t key)
 
- Protected Member Functions inherited from Gray::cArrayTyped< TYPE, ARG_TYPE >
ITERATE_t QSortPartition (ITERATE_t iLeft, ITERATE_t iRight)
 
void QSort (ITERATE_t iLeft, ITERATE_t iRight)
 
- Protected Member Functions inherited from Gray::CArray< TYPE, const TYPE & >
bool IsValidIndex (ITERATE_t i) const noexcept
 
- Protected Attributes inherited from Gray::CArray< TYPE, const TYPE & >
TYPEm_pData
 the actual array of data More...
 
ITERATE_t m_nSize
 Number of elements (upperBound - 1) More...
 

Detailed Description

template<typename _TYPE_CH = TCHAR>
class Gray::cArraySortString< _TYPE_CH >

Alpha Sorted array of strings. Case Ignored. duplicates are lost.

Member Typedef Documentation

◆ KEY_t

template<typename _TYPE_CH = TCHAR>
typedef SUPER_t::KEY_t Gray::cArraySortString< _TYPE_CH >::KEY_t

◆ REF_t

template<typename _TYPE_CH = TCHAR>
typedef SUPER_t::REF_t Gray::cArraySortString< _TYPE_CH >::REF_t

◆ STR_t

template<typename _TYPE_CH = TCHAR>
typedef cStringT<_TYPE_CH> Gray::cArraySortString< _TYPE_CH >::STR_t

◆ SUPER_t

template<typename _TYPE_CH = TCHAR>
typedef cArraySorted< cStringT<_TYPE_CH>, cStringT<_TYPE_CH>, const _TYPE_CH*> Gray::cArraySortString< _TYPE_CH >::SUPER_t

Constructor & Destructor Documentation

◆ ~cArraySortString()

template<typename _TYPE_CH = TCHAR>
virtual Gray::cArraySortString< _TYPE_CH >::~cArraySortString ( )
inlinevirtual

Member Function Documentation

◆ AddStr()

template<typename _TYPE_CH = TCHAR>
ITERATE_t Gray::cArraySortString< _TYPE_CH >::AddStr ( const _TYPE_CH *  pszStr)
inline

◆ CompareData()

template<typename _TYPE_CH = TCHAR>
virtual COMPARE_t Gray::cArraySortString< _TYPE_CH >::CompareData ( REF_t  sID1,
REF_t  sID2 
) const
inlineoverridevirtualnoexcept

◆ CompareKey()

template<typename _TYPE_CH = TCHAR>
virtual COMPARE_t Gray::cArraySortString< _TYPE_CH >::CompareKey ( KEY_t  pszID1,
REF_t  sID2 
) const
inlineoverridevirtual

◆ FindKeyDerived()

template<typename _TYPE_CH = TCHAR>
ITERATE_t Gray::cArraySortString< _TYPE_CH >::FindKeyDerived ( const _TYPE_CH *  pszDerived)
inline

one of the listed paths is a root of pszDerived ? pszDerived is a child. opposite of FindKeyRoot e.g. pszDerived = abc, element[x] = a like cFilePath::IsRelativeRoot

Returns
-1 = found nothing that would be root of pszDerived.

◆ FindKeyRoot()

template<typename _TYPE_CH = TCHAR>
ITERATE_t Gray::cArraySortString< _TYPE_CH >::FindKeyRoot ( const _TYPE_CH *  pszRoot)
inline

pszRoot is a root of one of the listed paths ? opposite of FindKeyDerived e.g. pszRoot = a, element[x] = abc like cFilePath::IsRelativeRoot

Returns
-1 = found nothing that would be derived from pszRoot.

Friends And Related Function Documentation

◆ cArraySortStringTests

template<typename _TYPE_CH = TCHAR>
friend class cArraySortStringTests
friend

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