| 236 | } |
| 237 | |
| 238 | int Write(const void* ptr, int size) noexcept |
| 239 | { |
| 240 | // Stream APIs usually return the number of bytes written. |
| 241 | // sqlite3_blob_write is all-or-nothing function, |
| 242 | // so Write will return the result of the call |
| 243 | if (!IsOpen() || mIsReadOnly || ptr == nullptr) |
| 244 | return SQLITE_MISUSE; |
| 245 | |
| 246 | const int rc = sqlite3_blob_write(mBlob, ptr, size, mOffset); |
| 247 | |
| 248 | if (rc == SQLITE_OK) |
| 249 | mOffset += size; |
| 250 | |
| 251 | return rc; |
| 252 | } |
| 253 | |
| 254 | int Read(void* ptr, int& size) noexcept |
| 255 | { |
no outgoing calls
no test coverage detected