Copy other to this starting at start. The 'this' ByteVector must be allocated large enough to hold other. Unlike Vector, the size() is increased to make it fit, up to the allocated size.
| 152 | // The 'this' ByteVector must be allocated large enough to hold other. |
| 153 | // Unlike Vector, the size() is increased to make it fit, up to the allocated size. |
| 154 | void ByteVector::setSegment(size_t start, ByteVector&other) |
| 155 | { |
| 156 | BVASSERT(start <= size()); // If start == size(), nothing is copied. |
| 157 | BVASSERT(bitind() == 0); // This function only allowed on byte-aligned data. |
| 158 | ByteType* base = mStart + start; |
| 159 | int othersize = other.size(); |
| 160 | BVASSERT(mAllocEnd - base >= othersize); |
| 161 | memcpy(base,other.mStart,othersize); |
| 162 | //if (mEnd - base < othersize) { mEnd = base + othersize; } // Grow size() if necessary. |
| 163 | if (mSizeBits/8 < start+othersize) { mSizeBits = (start+othersize)*8; } |
| 164 | } |
| 165 | |
| 166 | // Copy part of this ByteVector to a segment of another. |
| 167 | // The specified span must not exceed our size, and it must fit in the target ByteVector. |
no test coverage detected