| 721 | operator bool() const { return valid; } |
| 722 | |
| 723 | RawCursor(SQLiteDB& db, int table, bool write) : db(db), cursor(nullptr), valid(false) { |
| 724 | keyInfo.db = db.db; |
| 725 | keyInfo.enc = db.db->aDb[0].pSchema->enc; |
| 726 | keyInfo.aColl[0] = db.db->pDfltColl; |
| 727 | keyInfo.aSortOrder = 0; |
| 728 | keyInfo.nField = 1; |
| 729 | |
| 730 | try { |
| 731 | cursor = (BtCursor*)new char[sqlite3BtreeCursorSize()]; |
| 732 | sqlite3BtreeCursorZero(cursor); |
| 733 | db.checkError("BtreeCursor", sqlite3BtreeCursor(db.btree, table, write, &keyInfo, cursor)); |
| 734 | } catch (...) { |
| 735 | destroyCursor(); |
| 736 | throw; |
| 737 | } |
| 738 | } |
| 739 | ~RawCursor() { destroyCursor(); } |
| 740 | void destroyCursor() { |
| 741 | if (cursor) { |
nothing calls this directly
no test coverage detected