| 1805 | |
| 1806 | template<typename TokenT> |
| 1807 | ResultType Array::InsertAt(index_t aIndex, TokenT aValue[], index_t aCount) |
| 1808 | { |
| 1809 | ASSERT(aIndex <= mLength); |
| 1810 | |
| 1811 | if (!EnsureCapacity(mLength + aCount)) |
| 1812 | return FAIL; |
| 1813 | |
| 1814 | if (aIndex < mLength) |
| 1815 | { |
| 1816 | memmove(mItem + aIndex + aCount, mItem + aIndex, (mLength - aIndex) * sizeof(mItem[0])); |
| 1817 | } |
| 1818 | for (index_t i = 0; i < aCount; ++i) |
| 1819 | { |
| 1820 | mItem[aIndex + i].Minit(); |
| 1821 | mItem[aIndex + i].Assign(aValue[i]); |
| 1822 | } |
| 1823 | mLength += aCount; |
| 1824 | return OK; |
| 1825 | } |
| 1826 | |
| 1827 | template ResultType Array::InsertAt(index_t, ExprTokenType *[], index_t); |
| 1828 | template ResultType Array::InsertAt(index_t, ExprTokenType [], index_t); |