xapian-core  2.0.0
Public Member Functions | Static Public Member Functions | List of all members
HoneyDocDataTable Class Reference

#include <honey_docdata.h>

+ Inheritance diagram for HoneyDocDataTable:
+ Collaboration diagram for HoneyDocDataTable:

Public Member Functions

 HoneyDocDataTable (const std::string &dbdir, bool readonly)
 Create a new HoneyDocDataTable object. More...
 
 HoneyDocDataTable (int fd, off_t offset_, bool readonly)
 
std::string get_document_data (Xapian::docid did) const
 Get the document data for document did. More...
 
void add_document_data (Xapian::docid did, const std::string &data)
 Set the document data for document did. More...
 
void replace_document_data (Xapian::docid did, const std::string &data)
 Replace the document data for document did. More...
 
bool delete_document_data (Xapian::docid did)
 Delete the document data for document did. More...
 
void readahead_for_document (Xapian::docid did) const
 
- Public Member Functions inherited from HoneyLazyTable
 HoneyLazyTable (const char *name_, const std::string &path_, bool readonly)
 Create a new lazy table. More...
 
 HoneyLazyTable (const char *name_, int fd, off_t offset_, bool readonly)
 
- Public Member Functions inherited from HoneyTable
 HoneyTable (const char *, const std::string &path_, bool read_only_, bool lazy_=false)
 
 HoneyTable (const char *, int fd, off_t offset_, bool read_only_, bool lazy_=false)
 
 ~HoneyTable ()
 
bool is_writable () const
 
int get_flags () const
 
void create_and_open (int flags_, const Honey::RootInfo &root_info)
 
void open (int flags_, const Honey::RootInfo &root_info, honey_revision_number_t)
 
void close (bool permanent)
 
const std::string & get_path () const
 
void add (std::string_view key, const char *val, size_t val_size, bool compressed=false)
 
void add (std::string_view key, std::string_view val, bool compressed=false)
 
void flush_db ()
 
void cancel (const Honey::RootInfo &, honey_revision_number_t)
 
void commit (honey_revision_number_t, Honey::RootInfo *root_info)
 
bool sync ()
 
bool empty () const
 
bool get_exact_entry (std::string_view key, std::string &tag) const
 
bool key_exists (const std::string &key) const
 
bool del (const std::string &)
 
bool readahead_key (const std::string &) const
 
bool is_modified () const
 
HoneyCursorcursor_get () const
 
bool exists () const
 
bool is_open () const
 
honey_tablesize_t get_entry_count () const
 
honey_tablesize_t get_approx_entry_count () const
 Return an approximation of the number of entries in the table. More...
 
off_t get_root () const
 
off_t get_offset () const
 

Static Public Member Functions

static std::string make_key (Xapian::docid did)
 
- Static Public Member Functions inherited from HoneyTable
static void throw_database_closed ()
 

Detailed Description

Definition at line 31 of file honey_docdata.h.

Constructor & Destructor Documentation

◆ HoneyDocDataTable() [1/2]

HoneyDocDataTable::HoneyDocDataTable ( const std::string &  dbdir,
bool  readonly 
)
inline

Create a new HoneyDocDataTable object.

This method does not create or open the table on disk - you must call the create() or open() methods respectively!

Parameters
dbdirThe directory the honey database is stored in.
readonlytrue if we're opening read-only, else false.

Definition at line 47 of file honey_docdata.h.

◆ HoneyDocDataTable() [2/2]

HoneyDocDataTable::HoneyDocDataTable ( int  fd,
off_t  offset_,
bool  readonly 
)
inline

Definition at line 50 of file honey_docdata.h.

Member Function Documentation

◆ add_document_data()

void HoneyDocDataTable::add_document_data ( Xapian::docid  did,
const std::string &  data 
)
inline

Set the document data for document did.

If the document might already exist, use replace_document_data() instead.

Parameters
didThe docid to set the document data for.
dataThe document data to set.

Definition at line 74 of file honey_docdata.h.

References HoneyTable::add(), and make_key().

◆ delete_document_data()

bool HoneyDocDataTable::delete_document_data ( Xapian::docid  did)
inline

Delete the document data for document did.

Parameters
didThe docid to delete the document data for.
Returns
true if document data was actually removed (false means either there's no such document, or the document has no data).

Definition at line 103 of file honey_docdata.h.

References HoneyTable::del(), and make_key().

Referenced by replace_document_data().

◆ get_document_data()

std::string HoneyDocDataTable::get_document_data ( Xapian::docid  did) const
inline

Get the document data for document did.

If the document doesn't exist, the empty string is returned.

Parameters
didThe docid to set the document data for.

Definition at line 59 of file honey_docdata.h.

References HoneyTable::get_exact_entry(), and make_key().

◆ make_key()

static std::string HoneyDocDataTable::make_key ( Xapian::docid  did)
inlinestatic

◆ readahead_for_document()

void HoneyDocDataTable::readahead_for_document ( Xapian::docid  did) const
inline

Definition at line 105 of file honey_docdata.h.

References make_key(), and HoneyTable::readahead_key().

◆ replace_document_data()

void HoneyDocDataTable::replace_document_data ( Xapian::docid  did,
const std::string &  data 
)
inline

Replace the document data for document did.

Any existing data is replaced.

Parameters
didThe docid to replace the document data for.
dataThe document data to set.

Definition at line 87 of file honey_docdata.h.

References HoneyTable::add(), delete_document_data(), and make_key().


The documentation for this class was generated from the following file: