Real CAtlArray: void InsertAt( size_t iElement, INARGTYPE element, size_t nCount = 1 );
| 680 | |
| 681 | //Real CAtlArray: void InsertAt( size_t iElement, INARGTYPE element, size_t nCount = 1 ); |
| 682 | void InsertAt( size_t nIndex, E& element ) |
| 683 | { |
| 684 | if(m_nSize == m_nAllocSize) |
| 685 | { |
| 686 | E* aT; |
| 687 | int nNewAllocSize = (m_nAllocSize == 0) ? 1 : (m_nSize * 2); |
| 688 | aT = (E*)realloc(m_aT, nNewAllocSize * sizeof(E)); |
| 689 | if(aT == NULL) |
| 690 | return; // FALSE; |
| 691 | m_nAllocSize = nNewAllocSize; |
| 692 | m_aT = aT; |
| 693 | } |
| 694 | memmove((void*)&m_aT[nIndex+1], (void*)&m_aT[nIndex], (m_nSize - nIndex ) * sizeof(E)); |
| 695 | m_nSize++; |
| 696 | SetAtIndex(nIndex, element); |
| 697 | //return TRUE; |
| 698 | } |
| 699 | |
| 700 | //Real CAtlArray: void RemoveAt( size_t iElement, size_t nCount = 1 ); |
| 701 | void RemoveAt( size_t nIndex ) |
no outgoing calls
no test coverage detected