Set buffer out of bound error (common case optimization).
| 231 | |
| 232 | /// Set buffer out of bound error (common case optimization). |
| 233 | void set_buffer_out_of_bound(size_t offset, size_t length, size_t capacity) { |
| 234 | ok_ = false; |
| 235 | state_.reset(new ErrorState( |
| 236 | ErrorCode::BufferOutOfBound, |
| 237 | "Buffer out of bound: " + std::to_string(offset) + " + " + |
| 238 | std::to_string(length) + " > " + std::to_string(capacity))); |
| 239 | } |
| 240 | |
| 241 | /// reset to OK state. |
| 242 | void reset() { |
no test coverage detected