ChertVersion Class Reference

The ChertVersion class manages the "iamchert" file. More...

#include <chert_version.h>

Collaboration diagram for ChertVersion:

Collaboration graph
[legend]

List of all members.

Public Member Functions

 ChertVersion (const std::string &dbdir)
void create ()
 Create the version file.
void read_and_check ()
 Read the version file and check it's a version we understand.
const char * get_uuid () const
 Return pointer to 16 byte UUID.
std::string get_uuid_string () const
 Return UUID in the standard 36 character string format.
void set_uuid (void *data)
 Set the UUID from 16 byte binary value data.
bool set_uuid_string (const std::string &s)
 Set the UUID from the standard 36 character string format.

Private Attributes

std::string filename
 The filename of the version file.
uuid_t uuid
 The UUID of this database.


Detailed Description

The ChertVersion class manages the "iamchert" file.

The "iamchert" file (currently) contains a "magic" string identifying that this is a chert database and a database format version number.

Definition at line 34 of file chert_version.h.


Constructor & Destructor Documentation

ChertVersion::ChertVersion ( const std::string &  dbdir  )  [inline]

Definition at line 45 of file chert_version.h.

References filename.


Member Function Documentation

void ChertVersion::create (  ) 

const char* ChertVersion::get_uuid (  )  const [inline]

Return pointer to 16 byte UUID.

Definition at line 59 of file chert_version.h.

References uuid.

std::string ChertVersion::get_uuid_string (  )  const [inline]

Return UUID in the standard 36 character string format.

Definition at line 65 of file chert_version.h.

References uuid, and uuid_unparse_lower().

Referenced by ChertDatabaseReplicator::get_uuid(), and ChertDatabase::get_uuid().

void ChertVersion::read_and_check (  ) 

void ChertVersion::set_uuid ( void *  data  )  [inline]

Set the UUID from 16 byte binary value data.

Definition at line 72 of file chert_version.h.

References uuid.

bool ChertVersion::set_uuid_string ( const std::string &  s  )  [inline]

Set the UUID from the standard 36 character string format.

Returns:
true if s was successfully parsed; false otherwise.

Definition at line 80 of file chert_version.h.

References uuid, and uuid_parse().


Member Data Documentation

std::string ChertVersion::filename [private]

The filename of the version file.

Definition at line 36 of file chert_version.h.

Referenced by ChertVersion(), create(), and read_and_check().

uuid_t ChertVersion::uuid [mutable, private]

The UUID of this database.

This is mutable for older uuid libraries which take non-const uuid_t.

Definition at line 42 of file chert_version.h.

Referenced by create(), get_uuid(), get_uuid_string(), read_and_check(), set_uuid(), and set_uuid_string().


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

Documentation for Xapian (version 1.2.9).
Generated on 10 May 2012 by Doxygen 1.5.9.