librime 1.2
Rime Input Method Engine, the core library
rime::Config Class Reference

#include <config_component.h>

Inheritance diagram for rime::Config:
Collaboration diagram for rime::Config:

Public Member Functions

RIME_DLL Config ()
virtual RIME_DLL ~Config ()
 Config (an< ConfigData > data)
bool Save ()
bool LoadFromStream (std::istream &stream)
bool SaveToStream (std::ostream &stream)
RIME_DLL bool LoadFromFile (const path &file_path)
RIME_DLL bool SaveToFile (const path &file_path)
RIME_DLL bool IsNull (const string &path)
bool IsValue (const string &path)
RIME_DLL bool IsList (const string &path)
RIME_DLL bool IsMap (const string &path)
RIME_DLL bool GetBool (const string &path, bool *value)
RIME_DLL bool GetInt (const string &path, int *value)
RIME_DLL bool GetDouble (const string &path, double *value)
RIME_DLL bool GetString (const string &path, string *value)
RIME_DLL size_t GetListSize (const string &path)
an< ConfigItemGetItem (const string &path)
an< ConfigValueGetValue (const string &path)
RIME_DLL an< ConfigListGetList (const string &path)
RIME_DLL an< ConfigMapGetMap (const string &path)
bool SetBool (const string &path, bool value)
RIME_DLL bool SetInt (const string &path, int value)
bool SetDouble (const string &path, double value)
RIME_DLL bool SetString (const string &path, const char *value)
bool SetString (const string &path, const string &value)
RIME_DLL bool SetItem (const string &path, an< ConfigItem > item)
template<class T>
ConfigItemRefoperator= (const T &x)
Public Member Functions inherited from rime::ConfigItemRef
 ConfigItemRef (ConfigData *data)
virtual ~ConfigItemRef ()=default
 operator an< ConfigItem > () const
an< ConfigItemoperator* () const
template<class T>
ConfigItemRefoperator= (const T &x)
ConfigListEntryRef operator[] (size_t index)
ConfigMapEntryRef operator[] (const string &key)
RIME_DLL bool IsNull () const
bool IsValue () const
RIME_DLL bool IsList () const
bool IsMap () const
RIME_DLL bool ToBool () const
RIME_DLL int ToInt () const
double ToDouble () const
RIME_DLL string ToString () const
RIME_DLL an< ConfigListAsList ()
RIME_DLL an< ConfigMapAsMap ()
RIME_DLL void Clear ()
RIME_DLL bool Append (an< ConfigItem > item)
RIME_DLL size_t size () const
RIME_DLL bool HasKey (const string &key) const
RIME_DLL bool modified () const
RIME_DLL void set_modified ()

Protected Member Functions

an< ConfigItemGetItem () const
void SetItem (an< ConfigItem > item)

Protected Attributes

an< ConfigDatadata_
Protected Attributes inherited from rime::ConfigItemRef
ConfigDatadata_

Additional Inherited Members

Public Types inherited from rime::Class< Config, const string & >
using Initializer
Static Public Member Functions inherited from rime::Class< Config, const string & >
static Component * Require (const string &name)

Constructor & Destructor Documentation

◆ Config() [1/2]

rime::Config::Config ( )

◆ ~Config()

rime::Config::~Config ( )
virtual

◆ Config() [2/2]

rime::Config::Config ( an< ConfigData > data)
explicit

Member Function Documentation

◆ GetBool()

bool rime::Config::GetBool ( const string & path,
bool * value )

◆ GetDouble()

bool rime::Config::GetDouble ( const string & path,
double * value )

◆ GetInt()

bool rime::Config::GetInt ( const string & path,
int * value )

◆ GetItem() [1/2]

an< ConfigItem > rime::Config::GetItem ( ) const
protectedvirtual

Implements rime::ConfigItemRef.

◆ GetItem() [2/2]

an< ConfigItem > rime::Config::GetItem ( const string & path)

◆ GetList()

an< ConfigList > rime::Config::GetList ( const string & path)

◆ GetListSize()

size_t rime::Config::GetListSize ( const string & path)

◆ GetMap()

an< ConfigMap > rime::Config::GetMap ( const string & path)

◆ GetString()

bool rime::Config::GetString ( const string & path,
string * value )

◆ GetValue()

an< ConfigValue > rime::Config::GetValue ( const string & path)

◆ IsList()

bool rime::Config::IsList ( const string & path)

◆ IsMap()

bool rime::Config::IsMap ( const string & path)

◆ IsNull()

bool rime::Config::IsNull ( const string & path)

◆ IsValue()

bool rime::Config::IsValue ( const string & path)

◆ LoadFromFile()

bool rime::Config::LoadFromFile ( const path & file_path)

◆ LoadFromStream()

bool rime::Config::LoadFromStream ( std::istream & stream)

◆ operator=()

template<class T>
ConfigItemRef & rime::ConfigItemRef::operator= ( const T & x)
inline

◆ Save()

bool rime::Config::Save ( )

◆ SaveToFile()

bool rime::Config::SaveToFile ( const path & file_path)

◆ SaveToStream()

bool rime::Config::SaveToStream ( std::ostream & stream)

◆ SetBool()

bool rime::Config::SetBool ( const string & path,
bool value )

◆ SetDouble()

bool rime::Config::SetDouble ( const string & path,
double value )

◆ SetInt()

bool rime::Config::SetInt ( const string & path,
int value )

◆ SetItem() [1/2]

void rime::Config::SetItem ( an< ConfigItem > item)
protectedvirtual

Implements rime::ConfigItemRef.

◆ SetItem() [2/2]

bool rime::Config::SetItem ( const string & path,
an< ConfigItem > item )

◆ SetString() [1/2]

bool rime::Config::SetString ( const string & path,
const char * value )

◆ SetString() [2/2]

bool rime::Config::SetString ( const string & path,
const string & value )

Member Data Documentation

◆ data_

an<ConfigData> rime::Config::data_
protected

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