| 265 | *****************************************************************************/ |
| 266 | |
| 267 | bool LzwDecoder::copyCode(const LzwDecoder& other) |
| 268 | { |
| 269 | bool isSuccessful = true; |
| 270 | |
| 271 | if (nullptr != m_codes) |
| 272 | { |
| 273 | m_codeAllocator.deallocateArray(m_codes); |
| 274 | m_codes = nullptr; |
| 275 | } |
| 276 | |
| 277 | if (nullptr != other.m_codes) |
| 278 | { |
| 279 | m_codes = m_codeAllocator.allocateArray(CODE_LIMIT); |
| 280 | |
| 281 | if (nullptr == m_codes) |
| 282 | { |
| 283 | isSuccessful = false; |
| 284 | } |
| 285 | else |
| 286 | { |
| 287 | for (size_t idx = 0U; idx < CODE_LIMIT; ++idx) |
| 288 | { |
| 289 | m_codes[idx] = other.m_codes[idx]; |
| 290 | } |
| 291 | } |
| 292 | } |
| 293 | |
| 294 | return isSuccessful; |
| 295 | } |
| 296 | |
| 297 | bool LzwDecoder::copyStack(const LzwDecoder& other) |
| 298 | { |
nothing calls this directly
no test coverage detected