librime: rime::TextDb Class Reference

| librime 1.2 Rime Input Method Engine, the core library

Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
rime::TextDb Class Reference

`#include <text_db.h>`

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

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

## Protected Member Functions
void | Clear ()
bool | LoadFromFile (const path &file)
bool | SaveToFile (const path &file)

## Protected Attributes
string | db_type_
TextFormat | format_
TextDbData | metadata_
TextDbData | data_
bool | modified_ = false
Protected Attributes inherited from rime::Db
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

## ◆ TextDb()

rime::TextDb::TextDb | ( | const path & | file_path,
|  | const string & | db_name,
|  | const string & | db_type,
|  | TextFormat | format )

## ◆ ~TextDb()

rime::TextDb::~TextDb | ( |  | ) |
| virtual

## Member Function Documentation

## ◆ Backup()

bool rime::TextDb::Backup | ( | const path & | snapshot_file | ) |
| overridevirtual

Implements rime::Db.

## ◆ Clear()

void rime::TextDb::Clear | ( |  | ) |
| protected

## ◆ Close()

bool rime::TextDb::Close | ( |  | ) |
| overridevirtual

Implements rime::Db.

## ◆ CreateMetadata()

bool rime::TextDb::CreateMetadata | ( |  | ) |
| overridevirtual

Reimplemented from rime::Db.

## ◆ Erase()

bool rime::TextDb::Erase | ( | const string & | key | ) |
| overridevirtual

Implements rime::Db.

## ◆ Fetch()

bool rime::TextDb::Fetch | ( | const string & | key,
|  | string * | value )
| overridevirtual

Implements rime::Db.

## ◆ LoadFromFile()

bool rime::TextDb::LoadFromFile | ( | const path & | file | ) |
| protected

## ◆ MetaFetch()

bool rime::TextDb::MetaFetch | ( | const string & | key,
|  | string * | value )
| overridevirtual

Implements rime::Db.

## ◆ MetaUpdate()

bool rime::TextDb::MetaUpdate | ( | const string & | key,
|  | const string & | value )
| overridevirtual

Implements rime::Db.

## ◆ Open()

bool rime::TextDb::Open | ( |  | ) |
| overridevirtual

Implements rime::Db.

## ◆ OpenReadOnly()

bool rime::TextDb::OpenReadOnly | ( |  | ) |
| overridevirtual

Implements rime::Db.

## ◆ Query()

an< DbAccessor > rime::TextDb::Query | ( | const string & | key | ) |
| overridevirtual

Implements rime::Db.

## ◆ QueryAll()

an< DbAccessor > rime::TextDb::QueryAll | ( |  | ) |
| overridevirtual

Implements rime::Db.

## ◆ QueryMetadata()

an< DbAccessor > rime::TextDb::QueryMetadata | ( |  | ) |
| overridevirtual

Implements rime::Db.

## ◆ Restore()

bool rime::TextDb::Restore | ( | const path & | snapshot_file | ) |
| overridevirtual

Implements rime::Db.

## ◆ SaveToFile()

bool rime::TextDb::SaveToFile | ( | const path & | file | ) |
| protected

## ◆ Update()

bool rime::TextDb::Update | ( | const string & | key,
|  | const string & | value )
| overridevirtual

Implements rime::Db.

## Member Data Documentation

## ◆ data_

TextDbData rime::TextDb::data_
| protected

## ◆ db_type_

string rime::TextDb::db_type_
| protected

## ◆ format_

TextFormat rime::TextDb::format_
| protected

## ◆ metadata_

TextDbData rime::TextDb::metadata_
| protected

## ◆ modified_

bool rime::TextDb::modified_ = false
| protected

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

- text_db.h
- text_db.cc