18 if ( a_szString !=
TNULL )
24 auto it = m_oMap.Find( a_szString );
26 if ( m_oMap.IsValid( it ) )
29 *a_pWasInPool =
TTRUE;
31 a_pOutString = it->GetSecond();
39 a_pOutString = pString;
47 : m_pAllocator( a_pAllocator ), m_oMap( a_pAllocator )
53 : m_pAllocator( a_pAllocator ), m_oMap( a_pAllocator )
59 it->Initialise(
this );
65 m_iCount = a_iStringCount;
66 m_pStrings = a_pStrings;
67 m_pNextInitialiser = ms_pHeadInitialiser;
68 m_bCanReinitialise = a_bCanReinitialise;
69 ms_pHeadInitialiser =
this;
74 if ( m_bCanReinitialise )
76 for (
TSIZE i = 0; i < m_iCount; i++ )
78 if ( m_pStrings[ i ].m_pString8 )
80 m_pStrings[ i ].m_pString8->SetPooledString(
TNULL );
85 for (
TSIZE i = 0; i < m_iCount; i++ )
87 TPString8 string( a_pStringPool, m_pStrings[ i ].m_szCString );
89 if (
string.GetPooledString() &&
90 string.GetPooledString() != m_pStrings[ i ].m_pString8->GetPooledString() )
92 *m_pStrings[ i ].m_pString8 = string;
101 m_pPool->Remove(
this );
102 m_pPool->GetAllocator()->Delete(
this );
#define TOSHI_NAMESPACE_START
#define TOSHI_NAMESPACE_END
#define TDEFINE_FREELIST_ALLOCATOR1(CLASS_NAME, GROW_SIZE)
const TString8 & GetString8() const
TPString8Pool(T2Allocator *a_pAllocator)
void Get(TPooledString8 *&a_pOutString, const TCHAR *a_szString, bool *a_pWasInPool=nullptr)
void Initialise(TPString8Pool *a_pStringPool)
TPString8Initialiser(StringMap *a_pStrings, TUINT a_iStringCount, TBOOL a_bFlag)
static TPString8Initialiser * Head()
const TCHAR * GetString(TINT a_iIndex=0) const
static TSIZE String8Length(const TCHAR *str)