2#ifndef __TOSHI_TPSTRING8_H__
3# define __TOSHI_TPSTRING8_H__
15#define TPSTRING8_DECLARE( STR ) extern Toshi::TPString8 g_str_##STR
16#define TPS8( STR ) ( g_str_##STR )
17#define TPS8D( STR ) ( Toshi::TPString8( STR ) )
32 : m_oString( a_szString, a_pAllocator )
77 return m_oMap.Begin();
141 a_pPool->
Get( m_pPtr, a_szString,
TNULL );
152 m_pPtr = a_rOther.m_pPtr;
158 m_pPtr = a_rOther.m_pPtr;
159 a_rOther.m_pPtr =
TNULL;
174 return m_pPtr ? m_pPtr->m_oString :
ms_sEmpty;
184 return m_pPtr ==
TNULL || m_pPtr->GetString8().Length() == 0;
189 if ( m_pPtr != a_pPooledString )
192 m_pPtr = a_pPooledString;
199 return m_pPtr == a_Other.m_pPtr;
204 return m_pPtr == a_pOther->m_pPtr;
209 return m_pPtr == a_Other.m_pPtr;
214 return m_pPtr != a_Other.m_pPtr;
219 if ( m_pPtr != a_pString )
231 if ( m_pPtr != other.m_pPtr )
234 m_pPtr = other.m_pPtr;
243 if ( m_pPtr != pOther->m_pPtr )
246 m_pPtr = pOther->m_pPtr;
263 m_pPtr = a_rOther.m_pPtr;
264 a_rOther.m_pPtr =
TNULL;
270 return m_pPtr ? m_pPtr->m_oString.GetString() :
ms_sEmpty.GetString();
275 return m_pPtr ? &m_pPtr->m_oString : &
ms_sEmpty;
294 if ( m_pPtr && m_pPtr->DecRefCount() == 0 )
301 TPooledString8* m_pPtr;
330 StringMap* m_pStrings;
333 TBOOL m_bCanReinitialise;
#define TOSHI_NAMESPACE_START
#define TOSHI_NAMESPACE_END
#define TDECLARE_FREELIST_ALLOCATOR(CLASS_NAME)
Char string implementation for the Toshi engine.
T2RedBlackTree< Pair >::Iterator Iterator
const TString8 & GetString8() const
TPooledString8(const TCHAR *a_szString, TPString8Pool *a_pPool, T2Allocator *a_pAllocator)
TPString8Pool * GetStringPool() const
TPString8Pool(T2Allocator *a_pAllocator)
T2Allocator * GetAllocator() const
T2Map< constTCHAR *, TPooledString8 *, T2String8Comparator >::Iterator Begin()
T2Map< constTCHAR *, TPooledString8 *, T2String8Comparator >::Iterator End()
void Get(TPooledString8 *&a_pOutString, const TCHAR *a_szString, bool *a_pWasInPool=nullptr)
void Remove(TPooledString8 *a_pString)
TFORCEINLINE bool IsEqual(const TPString8 *a_pOther) const
TFORCEINLINE const TString8 & GetString8() const
TFORCEINLINE TPString8 & operator=(const TPString8 &other)
TFORCEINLINE void SetPooledString(TPooledString8 *a_pPooledString)
TFORCEINLINE TPString8(TPooledString8 *a_pPooled)
TFORCEINLINE TPString8(const TCHAR *a_szString)
TFORCEINLINE TPString8(TPString8Pool *a_pPool, const TCHAR *a_szString)
TFORCEINLINE TPString8(TPString8 &&a_rOther)
TFORCEINLINE const TPooledString8 * GetPooledString() const
static const TString8 ms_sEmpty
TFORCEINLINE TPString8 & operator=(const TCHAR *a_szString)
TFORCEINLINE TPString8 & operator=(TPString8 &&a_rOther)
TFORCEINLINE TPString8 & operator=(TPooledString8 *a_pString)
TFORCEINLINE ~TPString8()
TFORCEINLINE TPString8(const TPString8 &a_rOther)
TFORCEINLINE bool IsEqual(const TPString8 &a_Other) const
TFORCEINLINE TBOOL IsEmpty() const
TFORCEINLINE bool operator==(const TPString8 &a_Other) const
TFORCEINLINE const TCHAR * GetString() const
TFORCEINLINE constexpr TPString8()
TFORCEINLINE bool operator!=(const TPString8 &a_Other) const
TFORCEINLINE TPString8 & operator=(const TPString8 *pOther)
static TBOOL IsGreaterOrEqual(const TPString8 &a, const TPString8 &b)
static TBOOL IsGreater(const TPString8 &a, const TPString8 &b)
static TBOOL IsLess(const TPString8 &a, const TPString8 &b)
static TBOOL IsEqual(const TPString8 &a, const TPString8 &b)
static TBOOL IsLessOrEqual(const TPString8 &a, const TPString8 &b)
void Initialise(TPString8Pool *a_pStringPool)
TPString8Initialiser(StringMap *a_pStrings, TUINT a_iStringCount, TBOOL a_bFlag)
StringMap * GetStringMap() const
TPString8Initialiser * Next() const
~TPString8Initialiser()=default
static TPString8Initialiser * Head()
const TCHAR * m_szCString
const TCHAR * GetString(TINT a_iIndex=0) const
static TPString8Pool * GetTPStringPool()