summaryrefslogtreecommitdiff
path: root/src/packedintarray.cpp
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/packedintarray.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/packedintarray.cpp b/src/packedintarray.cpp
index bcd2f66..5397a73 100644
--- a/src/packedintarray.cpp
+++ b/src/packedintarray.cpp
@@ -64,6 +64,12 @@ void PackedIntArray::clear()
64 iCount = 0; 64 iCount = 0;
65} 65}
66 66
67void PackedIntArray::zero()
68{
69 int iSize = StoreCount(iCapacity);
70 memset( aData, 0, iSize*sizeof(Store));
71}
72
67void PackedIntArray::append( PackedIntArray::Unit i ) 73void PackedIntArray::append( PackedIntArray::Unit i )
68{ 74{
69 iCount++; 75 iCount++;
@@ -117,6 +123,17 @@ void PackedIntArray::set( int idx, PackedIntArray::Unit i )
117 } 123 }
118} 124}
119 125
126void PackedIntArray::insert( int idx, Unit i )
127{
128 iCount++;
129 checkCapacity();
130 for( int j = iCount-1; j > idx; j-- )
131 {
132 set( j, get( j-1 ) );
133 }
134 set( idx, i );
135}
136
120void PackedIntArray::set( const PackedIntArray &rSrc, int iStart, int iSize ) 137void PackedIntArray::set( const PackedIntArray &rSrc, int iStart, int iSize )
121{ 138{
122 iCount = iSize; 139 iCount = iSize;