#include <quartz_values.h>
Inheritance diagram for QuartzValueTable:
Public Member Functions | |
QuartzValueTable (string path_, bool readonly_) | |
Create a new table object. | |
void | encode_values (string &s, Xapian::ValueIterator it, const Xapian::ValueIterator &end) |
Encode values as a string ready to add to the table. | |
void | set_encoded_values (Xapian::docid did, const string &enc) |
Set values for document did encoded as a string. | |
void | get_value (string &value, Xapian::docid did, Xapian::valueno valueno) const |
Get a value. | |
void | get_all_values (map< Xapian::valueno, string > &values, Xapian::docid did) const |
Get all values. | |
void | delete_all_values (Xapian::docid did) |
Remove all values. | |
Static Private Member Functions | |
static void | unpack_entry (const char **pos, const char *end, Xapian::valueno *this_value_no, string &this_value) |
Read an entry from position. |
Definition at line 35 of file quartz_values.h.
QuartzValueTable::QuartzValueTable | ( | string | path_, | |
bool | readonly_ | |||
) | [inline] |
Create a new table object.
This does not create the table on disk - the create() method must be called before the table is created on disk
This also does not open the table - the open() method must be called before use is made of the table.
path_ | - Path at which the table is stored. | |
readonly_ | - whether to open the table for read only access. | |
blocksize_ | - Size of blocks to use. This parameter is only used when creating the table. |
Definition at line 60 of file quartz_values.h.
void QuartzValueTable::unpack_entry | ( | const char ** | pos, | |
const char * | end, | |||
Xapian::valueno * | this_value_no, | |||
string & | this_value | |||
) | [static, private] |
Read an entry from position.
Throw appropriate exceptions if data runs out.
Definition at line 42 of file quartz_values.cc.
References DEBUGCALL_STATIC, DEBUGLINE, unpack_string(), and unpack_uint().
Referenced by get_all_values(), and get_value().
void QuartzValueTable::encode_values | ( | string & | s, | |
Xapian::ValueIterator | it, | |||
const Xapian::ValueIterator & | end | |||
) |
Encode values as a string ready to add to the table.
Definition at line 64 of file quartz_values.cc.
References DEBUGCALL, Xapian::ValueIterator::get_valueno(), pack_string(), and pack_uint().
Referenced by QuartzWritableDatabase::add_document_(), and QuartzWritableDatabase::replace_document().
void QuartzValueTable::set_encoded_values | ( | Xapian::docid | did, | |
const string & | enc | |||
) |
Set values for document did encoded as a string.
Definition at line 77 of file quartz_values.cc.
References DEBUGCALL, and make_key().
Referenced by QuartzWritableDatabase::add_document_(), and QuartzWritableDatabase::replace_document().
void QuartzValueTable::get_value | ( | string & | value, | |
Xapian::docid | did, | |||
Xapian::valueno | valueno | |||
) | const |
Get a value.
Definition at line 86 of file quartz_values.cc.
References DEBUGCALL, Btree::get_exact_entry(), make_key(), and unpack_entry().
Referenced by QuartzDocument::do_get_value().
void QuartzValueTable::get_all_values | ( | map< Xapian::valueno, string > & | values, | |
Xapian::docid | did | |||
) | const |
Get all values.
values | A map to be filled with all the values for the specified document. |
Definition at line 119 of file quartz_values.cc.
References DEBUGCALL, Btree::get_exact_entry(), make_key(), and unpack_entry().
Referenced by QuartzDocument::do_get_all_values().
void QuartzValueTable::delete_all_values | ( | Xapian::docid | did | ) |
Remove all values.
did | The document id for which to remove the values. |
Definition at line 144 of file quartz_values.cc.
References DEBUGCALL, Btree::del(), and make_key().
Referenced by QuartzWritableDatabase::delete_document(), and QuartzWritableDatabase::replace_document().