path entries at dumpHeight or below will have their entire pages printed
| 7404 | |
| 7405 | // path entries at dumpHeight or below will have their entire pages printed |
| 7406 | std::string toString(int dumpHeight = 0) const { |
| 7407 | std::string r = format("{ptr=%p reason=%s %s ", |
| 7408 | this, |
| 7409 | PagerEventReasonsStrings[(int)reason], |
| 7410 | ::toString(pager->getVersion()).c_str()); |
| 7411 | for (int i = 0; i < path.size(); ++i) { |
| 7412 | std::string id = "<debugOnly>"; |
| 7413 | #if REDWOOD_DEBUG |
| 7414 | id = ::toString(path[i].id); |
| 7415 | #endif |
| 7416 | int height = path[i].btPage()->height; |
| 7417 | r += format("\n\t[Level=%d ID=%s ptr=%p Cursor=%s] ", |
| 7418 | height, |
| 7419 | id.c_str(), |
| 7420 | path[i].page->data(), |
| 7421 | path[i].cursor.valid() ? path[i].cursor.get().toString(path[i].btPage()->isLeaf()).c_str() |
| 7422 | : "<invalid>"); |
| 7423 | if (height <= dumpHeight) { |
| 7424 | BTreePage::BinaryTree::Cursor c = path[i].cursor; |
| 7425 | c.moveFirst(); |
| 7426 | int i = 0; |
| 7427 | while (c.valid()) { |
| 7428 | r += format("\n\t\%7d: %s", ++i, c.get().toString(height == 1).c_str()); |
| 7429 | c.moveNext(); |
| 7430 | } |
| 7431 | } |
| 7432 | } |
| 7433 | r += "\n"; |
| 7434 | if (!valid) { |
| 7435 | r += " (invalid) "; |
| 7436 | } |
| 7437 | r += "}"; |
| 7438 | return r; |
| 7439 | } |
| 7440 | |
| 7441 | const RedwoodRecordRef get() { return path.back().cursor.get(); } |
| 7442 |
no test coverage detected