Copy part of this ByteVector to a segment of another. The specified span must not exceed our size, and it must fit in the target ByteVector. Unlike Vector, the size() of other is increased to make it fit, up to the allocated size.
| 167 | // The specified span must not exceed our size, and it must fit in the target ByteVector. |
| 168 | // Unlike Vector, the size() of other is increased to make it fit, up to the allocated size. |
| 169 | void ByteVector::copyToSegment(ByteVector& other, size_t start, size_t span) const |
| 170 | { |
| 171 | ByteType* base = other.mStart + start; |
| 172 | BVASSERT(start <= other.size()); // If start == size(), nothing is copied. |
| 173 | BVASSERT(base+span<=other.mAllocEnd); |
| 174 | //BVASSERT(mStart+span<=mEnd); |
| 175 | //BVASSERT(base+span<=other.mAllocEnd); |
| 176 | memcpy(base,mStart,span); |
| 177 | //if (base+span > other.mEnd) { other.mEnd = base+span; } // Increase other.size() if necessary. |
| 178 | if (other.size() < start+span) { other.mSizeBits = (start+span)*8; } |
| 179 | } |
| 180 | |
| 181 | /** Copy all of this Vector to a segment of another Vector. */ |
| 182 | void ByteVector::copyToSegment(ByteVector& other, size_t start /*=0*/) const |
no test coverage detected