| 161 | } |
| 162 | |
| 163 | void setClumplets(const ClumpletWriter& writer) |
| 164 | { |
| 165 | Ods::header_page* hdr = write(); |
| 166 | UCHAR* const to = hdr->hdr_data; |
| 167 | UCHAR* const end = reinterpret_cast<UCHAR*>(hdr) + hdr->hdr_page_size; |
| 168 | const unsigned limit = (end - to) - 1; |
| 169 | |
| 170 | const unsigned length = writer.getBufferLength(); |
| 171 | fb_assert(length <= limit); |
| 172 | if (length > limit) |
| 173 | Arg::Gds(isc_hdr_overflow).raise(); |
| 174 | |
| 175 | memcpy(to, writer.getBuffer(), length); |
| 176 | to[length] = Ods::HDR_end; |
| 177 | hdr->hdr_end = HDR_SIZE + length; |
| 178 | } |
| 179 | |
| 180 | ~CchHdr() |
| 181 | { |
no test coverage detected