#include <brass_check.h>


Static Public Member Functions | |
| static void | check (const char *tablename, const std::string &path, int opts, std::ostream &out=std::cout) |
Private Member Functions | |
| BrassTableCheck (const char *tablename_, const std::string &path_, bool readonly, std::ostream &out_) | |
| void | block_check (Brass::Cursor *C_, int j, int opts) |
| int | block_usage (const byte *p) const |
| void | report_block (int m, int n, const byte *p) const |
| BrassTableCheck::report_block(m, n, p) prints the block at p, block number n, indented by m spaces. | |
| void | report_block_full (int m, int n, const byte *p) const |
| void | report_cursor (int N, const Brass::Cursor *C_) const |
| XAPIAN_NORETURN (void failure(int n) const) | |
| void | print_key (const byte *p, int c, int j) const |
| void | print_tag (const byte *p, int c, int j) const |
| void | print_spaces (int n) const |
| void | print_bytes (int n, const byte *p) const |
Private Attributes | |
| std::ostream & | out |
Definition at line 33 of file brass_check.h.
| BrassTableCheck::BrassTableCheck | ( | const char * | tablename_, | |
| const std::string & | path_, | |||
| bool | readonly, | |||
| std::ostream & | out_ | |||
| ) | [inline, private] |
Definition at line 38 of file brass_check.h.
| void BrassTableCheck::block_check | ( | Brass::Cursor * | C_, | |
| int | j, | |||
| int | opts | |||
| ) | [private] |
Definition at line 127 of file brass_check.cc.
References BrassTable::base, BrassTable_base::block_free_at_start(), BrassTable_base::block_free_now(), BrassTable::block_given_by(), BrassTable::block_size, BrassTable::block_to_cursor(), Brass::Cursor::c, D2, DIR_END, DIR_START, BrassTable_base::free_block(), Brass::Item_base< T >::get_address(), GET_LEVEL, Brass::Item_base< T >::key(), BrassTable::level, MAX_FREE, Brass::Cursor::n, OPT_FULL_TREE, OPT_SHORT_TREE, Brass::Cursor::p, report_block(), report_block_full(), REVISION, Brass::Item_base< T >::size(), and TOTAL_FREE.
Referenced by check().
| int BrassTableCheck::block_usage | ( | const byte * | p | ) | const [private] |
Definition at line 91 of file brass_check.cc.
References BrassTable::block_size, DIR_END, and TOTAL_FREE.
Referenced by report_block(), and report_block_full().
| void BrassTableCheck::check | ( | const char * | tablename, | |
| const std::string & | path, | |||
| int | opts, | |||
| std::ostream & | out = std::cout | |||
| ) | [static] |
Definition at line 201 of file brass_check.cc.
References BrassTable::base, BrassTable::base_letter, block_check(), BrassTable_base::block_free_at_start(), BrassTable::block_size, BrassTable::C, BrassTable::faked_root_block, BrassTable_base::get_bit_map_size(), BrassTable_base::get_last_block(), BrassTable_base::is_empty(), BrassTable::item_count, BrassTable::level, Brass::Cursor::n, BrassTable::open(), OPT_SHOW_BITMAP, OPT_SHOW_STATS, and BrassTable::revision_number.
Referenced by check_brass_table().
| void BrassTableCheck::print_bytes | ( | int | n, | |
| const byte * | p | |||
| ) | const [private] |
| void BrassTableCheck::print_key | ( | const byte * | p, | |
| int | c, | |||
| int | j | |||
| ) | const [private] |
Definition at line 43 of file brass_check.cc.
References Brass::Item_base< T >::component_of(), Brass::Item_base< T >::key(), Brass::Key::length(), out, and Brass::Key::read().
Referenced by report_block(), and report_block_full().
| void BrassTableCheck::print_spaces | ( | int | n | ) | const [private] |
Definition at line 33 of file brass_check.cc.
References out.
Referenced by report_block(), and report_block_full().
| void BrassTableCheck::print_tag | ( | const byte * | p, | |
| int | c, | |||
| int | j | |||
| ) | const [private] |
Definition at line 60 of file brass_check.cc.
References Brass::Item_base< T >::append_chunk(), Brass::Item_base< T >::components_of(), getint4(), and out.
Referenced by report_block_full().
| void BrassTableCheck::report_block | ( | int | m, | |
| int | n, | |||
| const byte * | p | |||
| ) | const [private] |
BrassTableCheck::report_block(m, n, p) prints the block at p, block number n, indented by m spaces.
Definition at line 101 of file brass_check.cc.
References block_usage(), D2, DIR_END, DIR_START, GET_LEVEL, out, print_key(), print_spaces(), and REVISION.
Referenced by block_check().
| void BrassTableCheck::report_block_full | ( | int | m, | |
| int | n, | |||
| const byte * | p | |||
| ) | const [private] |
Definition at line 73 of file brass_check.cc.
References block_usage(), D2, DIR_END, DIR_START, GET_LEVEL, out, print_key(), print_spaces(), print_tag(), and REVISION.
Referenced by block_check().
| void BrassTableCheck::report_cursor | ( | int | N, | |
| const Brass::Cursor * | C_ | |||
| ) | const [private] |
| BrassTableCheck::XAPIAN_NORETURN | ( | void failure(int n) | const | ) | [private] |
std::ostream& BrassTableCheck::out [private] |
Definition at line 54 of file brass_check.h.
Referenced by print_bytes(), print_key(), print_spaces(), print_tag(), report_block(), report_block_full(), and report_cursor().