FlintVersion Class Reference

The FlintVersion class manages the "iamflint" file. More...

#include <flint_version.h>

Collaboration diagram for FlintVersion:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 FlintVersion (const std::string &dbdir)
void create ()
 Create the version file.
void read_and_check (bool readonly)
 Read the version file and check it's a version we understand.

Private Attributes

std::string filename

Detailed Description

The FlintVersion class manages the "iamflint" file.

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

Definition at line 31 of file flint_version.h.


Constructor & Destructor Documentation

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

Definition at line 35 of file flint_version.h.

References filename.


Member Function Documentation

void FlintVersion::create (  ) 

Create the version file.

Definition at line 61 of file flint_version.cc.

References filename, flint_io_write(), FLINT_VERSION, MAGIC_LEN, MAGIC_STRING, O_BINARY, Xapian::Remote::open(), and VERSIONFILE_SIZE.

Referenced by FlintDatabase::create_and_open_tables(), and read_and_check().

void FlintVersion::read_and_check ( bool  readonly  ) 

Read the version file and check it's a version we understand.

Parameters:
readonly true if the database is being opened readonly.
On failure, an exception is thrown.

Definition at line 92 of file flint_version.cc.

References create(), filename, flint_io_read(), FLINT_VERSION, MAGIC_LEN, MAGIC_STRING, msvc_posix_rename(), O_BINARY, om_tostring(), Xapian::Remote::open(), size, STRINGIZE, and VERSIONFILE_SIZE.

Referenced by FlintDatabase::open_tables(), and FlintDatabase::open_tables_consistent().


Member Data Documentation

std::string FlintVersion::filename [private]

Definition at line 32 of file flint_version.h.

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


The documentation for this class was generated from the following files:
Documentation for Xapian (version 1.0.10).
Generated on 24 Dec 2008 by Doxygen 1.5.2.