| 99 | |
| 100 | template<class T> |
| 101 | StringArrayT<T>* |
| 102 | StringArrayT<T>::getslice_string(PyObject *index) const |
| 103 | { |
| 104 | typedef boost::shared_array<StringTableIndex> StringTableIndexArrayPtr; |
| 105 | typedef boost::shared_ptr<StringTableT<T> > StringTablePtr; |
| 106 | |
| 107 | BOOST_STATIC_ASSERT(boost::is_pod<StringTableIndex>::value); |
| 108 | |
| 109 | size_t start=0, end=0, slicelength=0; |
| 110 | Py_ssize_t step; |
| 111 | extract_slice_indices(index,start,end,step,slicelength); |
| 112 | |
| 113 | StringTableIndexArrayPtr indexArray(reinterpret_cast<StringTableIndex*>(new char[sizeof(StringTableIndex)*slicelength])); |
| 114 | StringTablePtr table(new StringTableT<T>); |
| 115 | |
| 116 | for(size_t i=0; i<slicelength; ++i) |
| 117 | indexArray[i] = table->intern(getitem_string(start+i*step)); |
| 118 | |
| 119 | return new StringArrayT<T>(*table, indexArray.get(), slicelength, 1, indexArray, boost::any(table)); |
| 120 | } |
| 121 | |
| 122 | template<class T> |
| 123 | StringArrayT<T>* |
nothing calls this directly
no test coverage detected