librime: rime::Db Class Reference

| librime 1.2 Rime Input Method Engine, the core library

Public Member Functions | Protected Attributes | List of all members
rime::Db Class Referenceabstract

`#include <db.h>`

Inheritance diagram for rime::Db:
[legend]
Collaboration diagram for rime::Db:
[legend]

## Public Member Functions
| Db (const path &file_path, const string &name)
virtual | ~Db ()=default
RIME_DLL bool | Exists () const
virtual RIME_DLL bool | Remove ()
virtual bool | Open ()=0
virtual bool | OpenReadOnly ()=0
virtual bool | Close ()=0
virtual bool | Backup (const path &snapshot_file)=0
virtual bool | Restore (const path &snapshot_file)=0
virtual bool | CreateMetadata ()
virtual bool | MetaFetch (const string &key, string *value)=0
virtual bool | MetaUpdate (const string &key, const string &value)=0
virtual an< DbAccessor > | QueryMetadata ()=0
virtual an< DbAccessor > | QueryAll ()=0
virtual an< DbAccessor > | Query (const string &key)=0
virtual bool | Fetch (const string &key, string *value)=0
virtual bool | Update (const string &key, const string &value)=0
virtual bool | Erase (const string &key)=0
const string & | name () const
const path & | file_path () const
bool | loaded () const
bool | readonly () const
bool | disabled () const
void | disable ()
void | enable ()

## Protected Attributes
string | name_
path | file_path_
bool | loaded_ = false
bool | readonly_ = false
bool | disabled_ = false

## Additional Inherited Members
Public Types inherited from rime::Class< Db, const string & >
using | Initializer
Static Public Member Functions inherited from rime::Class< Db, const string & >
static Component * | Require (const string &name)

## Constructor & Destructor Documentation

## ◆ Db()

rime::Db::Db | ( | const path & | file_path,
|  | const string & | name )

## ◆ ~Db()

virtual rime::Db::~Db | ( |  | ) |
| virtualdefault

## Member Function Documentation

## ◆ Backup()

virtual bool rime::Db::Backup | ( | const path & | snapshot_file | ) |
| pure virtual

Implemented in rime::LevelDb, and rime::TextDb.

## ◆ Close()

virtual bool rime::Db::Close | ( |  | ) |
| pure virtual

Implemented in rime::LevelDb, and rime::TextDb.

## ◆ CreateMetadata()

bool rime::Db::CreateMetadata | ( |  | ) |
| virtual

Reimplemented in rime::LevelDb, and rime::TextDb.

## ◆ disable()

void rime::Db::disable | ( |  | ) |
| inline

## ◆ disabled()

bool rime::Db::disabled | ( |  | ) | const
| inline

## ◆ enable()

void rime::Db::enable | ( |  | ) |
| inline

## ◆ Erase()

virtual bool rime::Db::Erase | ( | const string & | key | ) |
| pure virtual

Implemented in rime::LevelDb, and rime::TextDb.

## ◆ Exists()

bool rime::Db::Exists | ( |  | ) | const

## ◆ Fetch()

virtual bool rime::Db::Fetch | ( | const string & | key,
|  | string * | value )
| pure virtual

Implemented in rime::LevelDb, and rime::TextDb.

## ◆ file_path()

const path & rime::Db::file_path | ( |  | ) | const
| inline

## ◆ loaded()

bool rime::Db::loaded | ( |  | ) | const
| inline

## ◆ MetaFetch()

virtual bool rime::Db::MetaFetch | ( | const string & | key,
|  | string * | value )
| pure virtual

Implemented in rime::LevelDb, and rime::TextDb.

## ◆ MetaUpdate()

virtual bool rime::Db::MetaUpdate | ( | const string & | key,
|  | const string & | value )
| pure virtual

Implemented in rime::LevelDb, and rime::TextDb.

## ◆ name()

const string & rime::Db::name | ( |  | ) | const
| inline

## ◆ Open()

virtual bool rime::Db::Open | ( |  | ) |
| pure virtual

Implemented in rime::LevelDb, rime::StableDb, and rime::TextDb.

## ◆ OpenReadOnly()

virtual bool rime::Db::OpenReadOnly | ( |  | ) |
| pure virtual

Implemented in rime::LevelDb, and rime::TextDb.

## ◆ Query()

virtual an< DbAccessor > rime::Db::Query | ( | const string & | key | ) |
| pure virtual

Implemented in rime::LevelDb, and rime::TextDb.

## ◆ QueryAll()

virtual an< DbAccessor > rime::Db::QueryAll | ( |  | ) |
| pure virtual

Implemented in rime::LevelDb, and rime::TextDb.

## ◆ QueryMetadata()

virtual an< DbAccessor > rime::Db::QueryMetadata | ( |  | ) |
| pure virtual

Implemented in rime::LevelDb, and rime::TextDb.

## ◆ readonly()

bool rime::Db::readonly | ( |  | ) | const
| inline

## ◆ Remove()

bool rime::Db::Remove | ( |  | ) |
| virtual

Reimplemented in rime::LevelDb.

## ◆ Restore()

virtual bool rime::Db::Restore | ( | const path & | snapshot_file | ) |
| pure virtual

Implemented in rime::LevelDb, and rime::TextDb.

## ◆ Update()

virtual bool rime::Db::Update | ( | const string & | key,
|  | const string & | value )
| pure virtual

Implemented in rime::LevelDb, and rime::TextDb.

## Member Data Documentation

## ◆ disabled_

bool rime::Db::disabled_ = false
| protected

## ◆ file_path_

path rime::Db::file_path_
| protected

## ◆ loaded_

bool rime::Db::loaded_ = false
| protected

## ◆ name_

string rime::Db::name_
| protected

## ◆ readonly_

bool rime::Db::readonly_ = false
| protected

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

- db.h
- db.cc