//----------------------------------------------------------------------------- // // File: strlist.inl // Copyright (C) 1994-1997 Microsoft Corporation // All rights reserved. // // // //----------------------------------------------------------------------------- template CLocThingList::CLocThingList() { m_fAdditionsAllowed = FALSE; m_uiIndex = NO_INDEX; } template UINT CLocThingList::GetIndex(void) const { return m_uiIndex; } template const CArray & CLocThingList::GetStringArray(void) const { return m_aThings; } template BOOL CLocThingList::AdditionsAllowed(void) const { return m_fAdditionsAllowed; } template void CLocThingList::SetThingList( const CArray &aNewThings) { UINT uiNewSize = aNewThings.GetSize(); m_aThings.SetSize(uiNewSize); for (UINT i=0; i inline UINT CLocThingList::AddThing( T &NewThing) { return m_aThings.Add(NewThing); } template inline void CLocThingList::InsertThing( UINT idxInsert, T & tNew ) { m_aThings.InsertAt(idxInsert, tNew); } template inline BOOL CLocThingList::DeleteThing( UINT iIndex) { BOOL fRetVal = FALSE; if (iIndex < GetSize()) { m_aThings.RemoveAt(iIndex); fRetVal = TRUE; } return fRetVal; } template inline BOOL CLocThingList::SetIndex( UINT uiNewIndex) { m_uiIndex = uiNewIndex; return FALSE; } template inline void CLocThingList::SetAdditionsAllowed( BOOL fAllowed) { m_fAdditionsAllowed = fAllowed; } template inline UINT CLocThingList::GetSize() { return m_aThings.GetSize(); } template const CLocThingList & CLocThingList::operator=( const CLocThingList& slOther) { SetThingList(slOther.GetStringArray()); SetIndex(slOther.GetIndex()); SetAdditionsAllowed(slOther.AdditionsAllowed()); return *this; } template CLocThingList::~CLocThingList() { m_aThings.SetSize(0); } template inline int CLocThingList::operator==( const CLocThingList& list) const { if (m_uiIndex != list.m_uiIndex || m_fAdditionsAllowed != list.m_fAdditionsAllowed || m_aThings.GetSize() != list.m_aThings.GetSize()) { return 0; } for (int i=m_aThings.GetUpperBound(); i>=0; i--) { if (m_aThings[i] != list.m_aThings[i]) { return 0; } } return 1; } template inline int CLocThingList::operator!=( const CLocThingList& list) const { return !(operator==(list)); }