DtkCore
DTK Core module
Dtk::Core::DConfigCacheImpl类 参考
类 Dtk::Core::DConfigCacheImpl 继承关系图:
Dtk::Core::DConfigCache

Public 成员函数

 DConfigCacheImpl (const DConfigKey &configKey, const uint uid, bool global)
 
virtual int serial (const QString &key) const override
 返回配置项的单调递增值 key 配置项名称 更多...
 
virtual uint uid () const override
 用户标识,为全局缓存时,uid为非用户标识的特定值 更多...
 
virtual QStringList keyList () const override
 返回配置内容的所有配置项 更多...
 
QString applicationCacheDir (const QString &prefix) const
 
QString cacheDir (const QString &basePath)
 
QString globalCacheDir (const QString &prefix) const
 
QString getCacheDir (const QString &localPrefix=QString())
 
bool load (const QString &localPrefix=QString()) override
 解析缓存配置文件 更多...
 
bool isGlobal () const override
 是否是全局缓存 更多...
 
void remove (const QString &key) override
 删除缓存中的配置项 key 配置项名称 更多...
 
bool setValue (const QString &key, const QVariant &value, const int serial, const uint uid, const QString &appid) override
 设置缓存中的值 key 配置项名称 value 需要设置的值 uid 设置时的用户id callerAppid 设置时的应用id 更多...
 
QVariant value (const QString &key) const override
 获取缓存中的值 key 配置项名称 更多...
 
bool save (const QString &localPrefix, QJsonDocument::JsonFormat format, bool sync) override
 保存缓存的值到磁盘中 localPrefix 为目录前缀 format 保存格式 sync 是否立即刷新 更多...
 
virtual bool load (const QString &localPrefix=QString())=0
 解析缓存配置文件 更多...
 
virtual bool save (const QString &localPrefix=QString(), QJsonDocument::JsonFormat format=QJsonDocument::Indented, bool sync=false)=0
 保存缓存的值到磁盘中 localPrefix 为目录前缀 format 保存格式 sync 是否立即刷新 更多...
 
virtual bool isGlobal () const =0
 是否是全局缓存 更多...
 
virtual void remove (const QString &key)=0
 删除缓存中的配置项 key 配置项名称 更多...
 
virtual QStringList keyList () const =0
 返回配置内容的所有配置项 更多...
 
virtual bool setValue (const QString &key, const QVariant &value, const int serial, const uint uid, const QString &callerAppid)=0
 设置缓存中的值 key 配置项名称 value 需要设置的值 uid 设置时的用户id callerAppid 设置时的应用id 更多...
 
virtual QVariant value (const QString &key) const =0
 获取缓存中的值 key 配置项名称 更多...
 
virtual int serial (const QString &key) const =0
 返回配置项的单调递增值 key 配置项名称 更多...
 
virtual uint uid () const =0
 用户标识,为全局缓存时,uid为非用户标识的特定值 更多...
 

Public 属性

DConfigKey configKey
 
DConfigInfo values
 
uint userid
 
bool global
 
bool cacheChanged = false
 

成员函数说明

◆ isGlobal()

bool Dtk::Core::DConfigCacheImpl::isGlobal ( ) const
inlineoverridevirtual

是否是全局缓存

返回

实现了 Dtk::Core::DConfigCache.

◆ keyList()

virtual QStringList Dtk::Core::DConfigCacheImpl::keyList ( ) const
inlineoverridevirtual

返回配置内容的所有配置项

返回

实现了 Dtk::Core::DConfigCache.

◆ load()

bool Dtk::Core::DConfigCacheImpl::load ( const QString &  localPrefix = QString())
overridevirtual

解析缓存配置文件

返回

实现了 Dtk::Core::DConfigCache.

◆ remove()

void Dtk::Core::DConfigCacheImpl::remove ( const QString &  key)
inlineoverridevirtual

删除缓存中的配置项 key 配置项名称

返回

实现了 Dtk::Core::DConfigCache.

◆ save()

bool Dtk::Core::DConfigCacheImpl::save ( const QString &  localPrefix,
QJsonDocument::JsonFormat  format,
bool  sync 
)
overridevirtual

保存缓存的值到磁盘中 localPrefix 为目录前缀 format 保存格式 sync 是否立即刷新

返回

实现了 Dtk::Core::DConfigCache.

◆ serial()

virtual int Dtk::Core::DConfigCacheImpl::serial ( const QString &  key) const
inlineoverridevirtual

返回配置项的单调递增值 key 配置项名称

返回
-1为无效值,表明没有配置此项

实现了 Dtk::Core::DConfigCache.

◆ setValue()

bool Dtk::Core::DConfigCacheImpl::setValue ( const QString &  key,
const QVariant &  value,
const int  serial,
const uint  uid,
const QString &  callerAppid 
)
inlineoverridevirtual

设置缓存中的值 key 配置项名称 value 需要设置的值 uid 设置时的用户id callerAppid 设置时的应用id

返回
为true时表示重新设置了新值,false表示没有设置

实现了 Dtk::Core::DConfigCache.

◆ uid()

virtual uint Dtk::Core::DConfigCacheImpl::uid ( ) const
inlineoverridevirtual

用户标识,为全局缓存时,uid为非用户标识的特定值

返回

实现了 Dtk::Core::DConfigCache.

◆ value()

QVariant Dtk::Core::DConfigCacheImpl::value ( const QString &  key) const
inlineoverridevirtual

获取缓存中的值 key 配置项名称

返回

实现了 Dtk::Core::DConfigCache.


该类的文档由以下文件生成: