![]() |
KVIrc 5.2.6
Developer APIs
|
#include <KviConfigurationFile.h>
Public Types | |
enum | FileMode { Read = 1 , Write = 2 , ReadWrite = 3 } |
Public Member Functions | |
void | clear () |
void | clearDirtyFlag () |
void | clearGroup (const QString &szGroup) |
void | clearKey (const QString &szKey) |
KviPointerHashTable< QString, KviConfigurationFileGroup > * | dict () |
bool | dirty () |
const QString & | fileName () |
const QString & | group () |
unsigned int | groupsCount () |
bool | hasGroup (const QString &szGroup) |
bool | hasKey (const QString &szKey) |
KviConfigurationFile (const char *filename, FileMode f, bool bLocal8Bit=false) | |
KviConfigurationFile (const QString &filename, FileMode f, bool bLocal8Bit=false) | |
void | preserveEmptyGroups (bool bPreserve) |
bool | readBoolEntry (const QString &szKey, bool bTrue) |
char | readCharEntry (const QString &szKey, char iDefault) |
QColor | readColorEntry (const QString &szKey, const QColor &clr) |
QString | readEntry (const QString &szKey, const QString &szDefault=QString()) |
QFont | readFontEntry (const QString &szKey, const QFont &fnt) |
int | readIntEntry (const QString &szKey, int iDefault) |
QList< int > | readIntListEntry (const QString &, const QList< int > &list) |
QString | readKviCStringEntry (const QString &szKey, const KviCString &szDefault) |
KviMessageTypeSettings | readMsgTypeEntry (const QString &szKey, const KviMessageTypeSettings &msgDef) |
bool | readOnly () |
KviPixmap | readPixmapEntry (const QString &szKey, const KviPixmap &pixDef) |
QRect | readRectEntry (const QString &szKey, const QRect &rct) |
QStringList | readStringListEntry (const QString &szKey, const QStringList &list=QStringList()) |
unsigned char | readUCharEntry (const QString &szKey, unsigned char iDefault) |
unsigned int | readUIntEntry (const QString &szKey, unsigned int iDefault) |
unsigned short int | readUShortEntry (const QString &szKey, unsigned short int usDefault) |
bool | saveIfDirty () |
void | setGroup (const QString &szGroup) |
void | setReadOnly (bool bReadOnly) |
void | setSavePath (const QString &savePath) |
bool | sync () |
void | writeEntry (const QString &szKey, bool bTrue) |
void | writeEntry (const QString &szKey, char iValue) |
void | writeEntry (const QString &szKey, const char *szValue) |
void | writeEntry (const QString &szKey, const KviMessageTypeSettings &msg) |
void | writeEntry (const QString &szKey, const KviPixmap &pixmap) |
void | writeEntry (const QString &szKey, const QColor &clr) |
void | writeEntry (const QString &szKey, const QList< int > &list) |
void | writeEntry (const QString &szKey, const QRect &rct) |
void | writeEntry (const QString &szKey, const QString &szValue) |
void | writeEntry (const QString &szKey, const QStringList &list) |
void | writeEntry (const QString &szKey, int iValue) |
void | writeEntry (const QString &szKey, QFont &fnt) |
void | writeEntry (const QString &szKey, unsigned char iValue) |
void | writeEntry (const QString &szKey, unsigned int iValue) |
void | writeEntry (const QString &szKey, unsigned short int usValue) |
~KviConfigurationFile () | |
Static Public Member Functions | |
static void | getFontProperties (KviCString &buffer, QFont *fnt) |
static void | setFontProperties (KviCString &str, QFont *fnt) |
Private Member Functions | |
KviConfigurationFileGroup * | getCurrentGroup () |
bool | load () |
bool | save () |
Private Attributes | |
bool | m_bDirty |
bool | m_bLocal8Bit |
bool | m_bPreserveEmptyGroups |
bool | m_bReadOnly |
KviPointerHashTable< QString, KviConfigurationFileGroup > * | m_pDict |
QString | m_szFileName |
QString | m_szGroup |
QString | m_szStrBuffer |
KviConfigurationFile::KviConfigurationFile | ( | const QString & | filename, |
FileMode | f, | ||
bool | bLocal8Bit = false ) |
References f, KVI_CONFIG_DEFAULT_GROUP, load(), m_bDirty, m_bLocal8Bit, m_bPreserveEmptyGroups, m_bReadOnly, m_pDict, m_szFileName, m_szGroup, Read, and Write.
KviConfigurationFile::KviConfigurationFile | ( | const char * | filename, |
FileMode | f, | ||
bool | bLocal8Bit = false ) |
References f, KVI_CONFIG_DEFAULT_GROUP, load(), m_bDirty, m_bLocal8Bit, m_bPreserveEmptyGroups, m_bReadOnly, m_pDict, m_szFileName, m_szGroup, Read, and Write.
void KviConfigurationFile::clear | ( | ) |
References KVI_CONFIG_DEFAULT_GROUP, m_bDirty, m_pDict, and m_szGroup.
Referenced by ClassEditorWidget::build(), config_kvs_cmd_clear(), ListWindow::exportList(), KviActionManager::save(), KviDefaultScriptManager::save(), KviIdentityProfileSet::save(), KviInputHistory::save(), KviIrcServerDataBase::save(), KviKvsAliasManager::save(), KviKvsPopupManager::save(), KviKvsScriptAddonManager::save(), KviMediaManager::save(), KviNickServRuleSet::save(), KviProxyDataBase::save(), KviRegisteredChannelDataBase::save(), KviRegisteredUserDataBase::save(), KviSharedFilesManager::save(), KviThemeInfo::save(), KviUserIdentityManager::save(), KviKvsEventManager::saveAppEvents(), ClassEditorWidget::saveNotBuiltClasses(), and KviKvsEventManager::saveRawEvents().
|
inline |
References m_bDirty.
void KviConfigurationFile::clearGroup | ( | const QString & | szGroup | ) |
References KVI_CONFIG_DEFAULT_GROUP, m_bDirty, m_pDict, and m_szGroup.
Referenced by clearKey(), and config_kvs_cmd_clearsection().
void KviConfigurationFile::clearKey | ( | const QString & | szKey | ) |
References clearGroup(), KviPointerHashTable< Key, T >::count(), getCurrentGroup(), m_bDirty, m_szGroup, and KviPointerHashTable< Key, T >::remove().
Referenced by config_kvs_cmd_write().
|
inline |
References m_pDict.
Referenced by config_kvs_fnc_keylist(), config_kvs_fnc_sectionlist(), KviKvsScriptAddonManager::delayedLoad(), ListWindow::importList(), KviActionManager::load(), KviAvatarCache::load(), KviCustomToolBarManager::load(), KviIrcServerDataBase::load(), KviKvsAliasManager::load(), KviKvsPopupManager::load(), KviRegisteredChannelDataBase::load(), KviRegisteredUserDataBase::load(), KviTextIconManager::load(), KviUserIdentityManager::load(), ClassEditorWidget::loadNotBuiltClasses(), and save().
|
inline |
References m_bDirty.
Referenced by config_kvs_cmd_close().
|
inline |
References m_szFileName.
Referenced by config_kvs_cmd_close(), and config_kvs_fnc_filename().
|
private |
References KVI_CONFIG_DEFAULT_GROUP, m_pDict, m_szGroup, and KviPointerHashTable< Key, T >::setAutoDelete().
Referenced by clearKey(), hasKey(), readBoolEntry(), readCharEntry(), readColorEntry(), readEntry(), readFontEntry(), readIntEntry(), readIntListEntry(), readMsgTypeEntry(), readPixmapEntry(), readRectEntry(), readStringListEntry(), readUCharEntry(), readUIntEntry(), readUShortEntry(), setGroup(), writeEntry(), writeEntry(), writeEntry(), writeEntry(), writeEntry(), writeEntry(), writeEntry(), writeEntry(), writeEntry(), writeEntry(), writeEntry(), writeEntry(), writeEntry(), and writeEntry().
|
static |
References KviStringConversion::toString().
|
inline |
References m_szGroup.
Referenced by config_kvs_fnc_keylist(), config_kvs_fnc_section(), KviCustomToolBarDescriptor::load(), KviKvsUserAction::load(), KviUserIdentity::load(), and save().
|
inline |
References m_pDict.
bool KviConfigurationFile::hasGroup | ( | const QString & | szGroup | ) |
bool KviConfigurationFile::hasKey | ( | const QString & | szKey | ) |
References KviPointerHashTable< Key, T >::find(), and getCurrentGroup().
Referenced by KviTheme::apply().
|
private |
References KviMemory::allocate(), begin(), f, KviMemory::free(), KviCString::hexDecode(), KviCString::isEmpty(), KVI_CONFIG_DEFAULT_GROUP, KviCString::len(), LOAD_BLOCK_SIZE, m_bLocal8Bit, m_pDict, m_szFileName, KviMemory::move(), p, KviCString::ptr(), KviMemory::reallocate(), KviPointerHashTable< Key, T >::replace(), KviPointerHashTable< Key, T >::setAutoDelete(), KviCString::stripRightWhiteSpace(), and z.
Referenced by KviConfigurationFile(), and KviConfigurationFile().
|
inline |
References m_bPreserveEmptyGroups.
Referenced by KviRegisteredChannelDataBase::save(), and KviRegisteredUserDataBase::save().
bool KviConfigurationFile::readBoolEntry | ( | const QString & | szKey, |
bool | bTrue ) |
References KviPointerHashTable< Key, T >::find(), and getCurrentGroup().
Referenced by ConfigDialog::ConfigDialog(), KviIrcServer::load(), KviIrcServerDataBase::load(), KviProxyDataBase::load(), KviRegisteredUserDataBase::load(), OptionsWidget_messageColors::load(), KviKvsEventManager::loadAppEvents(), KviIdentityProfileSet::loadPrivate(), KviNickServRuleSet::loadPrivate(), KviChannelWindow::loadProperties(), KviConsoleWindow::loadProperties(), KviQueryWindow::loadProperties(), KviWindow::loadProperties(), KviKvsEventManager::loadRawEvents(), KviStatusBarAwayIndicator::loadState(), KviStatusBarClock::loadState(), KviStatusBarConnectionTimer::loadState(), KviStatusBarUpdateIndicator::loadState(), SetupWizard::SetupWizard(), and url_module_cleanup().
char KviConfigurationFile::readCharEntry | ( | const QString & | szKey, |
char | iDefault ) |
References KviPointerHashTable< Key, T >::find(), and getCurrentGroup().
QColor KviConfigurationFile::readColorEntry | ( | const QString & | szKey, |
const QColor & | clr ) |
QString KviConfigurationFile::readEntry | ( | const QString & | szKey, |
const QString & | szDefault = QString() ) |
References KviPointerHashTable< Key, T >::find(), getCurrentGroup(), and m_szStrBuffer.
Referenced by KviTheme::apply(), KviDefaultScriptManager::compareVersions(), config_kvs_fnc_read(), KviMircServersIniImport::doImport(), KviApplication::findLocalKvircDirectory(), KviIrcServerDataBase::importFromMircIni(), ListWindow::importList(), KviDefaultScriptManager::isDefscriptUpToDate(), KviAvatarCache::load(), KviCustomToolBarDescriptor::load(), KviIdentityProfile::load(), KviInputHistory::load(), KviIrcServer::load(), KviIrcServerDataBase::load(), KviKvsAliasManager::load(), KviKvsPopupMenu::load(), KviKvsScriptAddon::load(), KviKvsUserAction::load(), KviMediaManager::load(), KviNickServRule::load(), KviProxyDataBase::load(), KviSharedFilesManager::load(), KviStatusBar::load(), KviTextIconManager::load(), KviThemeInfo::load(), KviUserIdentity::load(), KviUserIdentityManager::load(), KviKvsEventManager::loadAppEvents(), KviDefaultScriptManager::loadInternal(), ClassEditorWidget::loadNotBuiltClasses(), AliasEditorWidget::loadProperties(), ClassEditorWidget::loadProperties(), KviWindow::loadProperties(), KviKvsEventManager::loadRawEvents(), readKviCStringEntry(), KviDefaultScriptManager::restoreInternal(), and SetupWizard::SetupWizard().
QFont KviConfigurationFile::readFontEntry | ( | const QString & | szKey, |
const QFont & | fnt ) |
References KviPointerHashTable< Key, T >::find(), getCurrentGroup(), setFontProperties(), and KviCString::stripLeftWhiteSpace().
Referenced by ScriptEditorImplementation::loadOptions().
int KviConfigurationFile::readIntEntry | ( | const QString & | szKey, |
int | iDefault ) |
References KviPointerHashTable< Key, T >::find(), and getCurrentGroup().
Referenced by KviCustomToolBarManager::load(), KviInputHistory::load(), KviIrcServer::load(), KviIrcServerDataBase::load(), KviKvsPopupMenu::load(), KviRegisteredUserDataBase::load(), KviSharedFilesManager::load(), KviStatusBar::load(), KviTextIconManager::load(), OptionsWidget_messageColors::load(), KviStatusBarClock::loadState(), and SetupWizard::SetupWizard().
QList< int > KviConfigurationFile::readIntListEntry | ( | const QString & | szKey, |
const QList< int > & | list ) |
References KviPointerHashTable< Key, T >::find(), and getCurrentGroup().
Referenced by ActionEditorWindow::loadProperties(), AliasEditorWidget::loadProperties(), ClassEditorWidget::loadProperties(), HelpWindow::loadProperties(), KviChannelWindow::loadProperties(), KviConsoleWindow::loadProperties(), KviDebugWindow::loadProperties(), and KviQueryWindow::loadProperties().
|
inline |
References KviCString::ptr(), and readEntry().
KviMessageTypeSettings KviConfigurationFile::readMsgTypeEntry | ( | const QString & | szKey, |
const KviMessageTypeSettings & | msgDef ) |
|
inline |
References m_bReadOnly.
Referenced by config_kvs_cmd_close(), config_kvs_cmd_flush(), and config_kvs_fnc_readonly().
References KviPointerHashTable< Key, T >::find(), KviStringConversion::fromString(), and getCurrentGroup().
Referenced by KviUserIdentity::load(), and KviChannelWindow::loadProperties().
QRect KviConfigurationFile::readRectEntry | ( | const QString & | szKey, |
const QRect & | rct ) |
References KviPointerHashTable< Key, T >::find(), KviStringConversion::fromString(), and getCurrentGroup().
Referenced by addon_module_init(), channelsjoin_module_init(), theme_module_init(), and toolbareditor_module_init().
QStringList KviConfigurationFile::readStringListEntry | ( | const QString & | szKey, |
const QStringList & | list = QStringList() ) |
unsigned char KviConfigurationFile::readUCharEntry | ( | const QString & | szKey, |
unsigned char | iDefault ) |
References KviPointerHashTable< Key, T >::find(), and getCurrentGroup().
unsigned int KviConfigurationFile::readUIntEntry | ( | const QString & | szKey, |
unsigned int | iDefault ) |
References KviPointerHashTable< Key, T >::find(), and getCurrentGroup().
Referenced by KviApplication::findLocalKvircDirectory(), KviAvatarCache::load(), KviCustomToolBarDescriptor::load(), KviIdentityProfileSet::load(), KviIrcServer::load(), KviKvsUserAction::load(), KviMediaManager::load(), KviNickServRuleSet::load(), KviNickServRuleSet::load(), KviProxyDataBase::load(), KviKvsEventManager::loadAppEvents(), and KviKvsEventManager::loadRawEvents().
unsigned short int KviConfigurationFile::readUShortEntry | ( | const QString & | szKey, |
unsigned short int | usDefault ) |
References KviPointerHashTable< Key, T >::find(), and getCurrentGroup().
|
private |
References KviPointerHashTableIterator< Key, T >::current(), KviPointerHashTableIterator< Key, T >::currentKey(), dict(), f, group(), KviCString::hexEncodeWhiteSpace(), KviCString::hexEncodeWithTable(), KviCString::len(), m_bDirty, m_bLocal8Bit, m_bPreserveEmptyGroups, m_bReadOnly, m_pDict, m_szFileName, and KviCString::ptr().
Referenced by saveIfDirty(), sync(), and ~KviConfigurationFile().
bool KviConfigurationFile::saveIfDirty | ( | ) |
References m_bDirty, and save().
Referenced by KviApplication::saveOptions().
|
static |
References KviStringConversion::fromString(), and KviCString::ptr().
Referenced by readFontEntry().
void KviConfigurationFile::setGroup | ( | const QString & | szGroup | ) |
References getCurrentGroup(), hasGroup(), m_bDirty, m_bPreserveEmptyGroups, and m_szGroup.
Referenced by ConfigDialog::acceptbtn(), KviTheme::apply(), config_kvs_cmd_setsection(), config_set_section(), ConfigDialog::ConfigDialog(), KviMircServersIniImport::doImport(), ListWindow::exportList(), KviApplication::findLocalKvircDirectory(), KviIrcServerDataBase::importFromMircIni(), ListWindow::importList(), KviActionManager::load(), KviAvatarCache::load(), KviCustomToolBarManager::load(), KviIrcServerDataBase::load(), KviKvsAliasManager::load(), KviKvsPopupManager::load(), KviKvsScriptAddon::load(), KviMediaManager::load(), KviRegisteredUserDataBase::load(), KviSharedFilesManager::load(), KviStatusBar::load(), KviTextIconManager::load(), KviThemeInfo::load(), KviUserIdentityManager::load(), OptionsWidget_messageColors::load(), KviKvsEventManager::loadAppEvents(), ClassEditorWidget::loadNotBuiltClasses(), KviKvsEventManager::loadRawEvents(), KviActionManager::save(), KviAvatarCache::save(), KviCustomToolBarDescriptor::save(), KviCustomToolBarManager::save(), KviIrcServerDataBase::save(), KviKvsAliasManager::save(), KviKvsPopupManager::save(), KviKvsScriptAddon::save(), KviKvsScriptAddonManager::save(), KviKvsUserAction::save(), KviMediaManager::save(), KviRegisteredChannelDataBase::save(), KviRegisteredUserDataBase::save(), KviSharedFilesManager::save(), KviStatusBar::save(), KviTextIconManager::save(), KviTheme::save(), KviThemeInfo::save(), KviUserIdentity::save(), KviUserIdentityManager::save(), OptionsWidget_messageColors::save(), KviKvsEventManager::saveAppEvents(), KviApplication::saveKvircDirectory(), ClassEditorWidget::saveNotBuiltClasses(), KviKvsEventManager::saveRawEvents(), SetupWizard::SetupWizard(), and url_module_cleanup().
|
inline |
References m_bReadOnly.
|
inline |
References m_szFileName.
|
inline |
References save().
Referenced by ClassEditorWidget::build(), config_kvs_cmd_close(), config_kvs_cmd_flush(), and ClassEditorWidget::saveNotBuiltClasses().
void KviConfigurationFile::writeEntry | ( | const QString & | szKey, |
bool | bTrue ) |
References getCurrentGroup(), m_bDirty, and KviPointerHashTable< Key, T >::replace().
void KviConfigurationFile::writeEntry | ( | const QString & | szKey, |
char | iValue ) |
References getCurrentGroup(), m_bDirty, and KviPointerHashTable< Key, T >::replace().
|
inline |
References writeEntry().
void KviConfigurationFile::writeEntry | ( | const QString & | szKey, |
const KviMessageTypeSettings & | msg ) |
void KviConfigurationFile::writeEntry | ( | const QString & | szKey, |
const KviPixmap & | pixmap ) |
void KviConfigurationFile::writeEntry | ( | const QString & | szKey, |
const QColor & | clr ) |
void KviConfigurationFile::writeEntry | ( | const QString & | szKey, |
const QList< int > & | list ) |
void KviConfigurationFile::writeEntry | ( | const QString & | szKey, |
const QRect & | rct ) |
void KviConfigurationFile::writeEntry | ( | const QString & | szKey, |
const QString & | szValue ) |
References getCurrentGroup(), m_bDirty, and KviPointerHashTable< Key, T >::replace().
Referenced by ConfigDialog::acceptbtn(), addon_module_cleanup(), channelsjoin_module_cleanup(), config_kvs_cmd_write(), ListWindow::exportList(), KviAvatarCache::save(), KviCustomToolBarDescriptor::save(), KviCustomToolBarManager::save(), KviIdentityProfile::save(), KviIdentityProfileSet::save(), KviInputHistory::save(), KviIrcServer::save(), KviIrcServerDataBase::save(), KviKvsAliasManager::save(), KviKvsPopupMenu::save(), KviKvsScriptAddon::save(), KviKvsUserAction::save(), KviMediaManager::save(), KviNickServRule::save(), KviNickServRuleSet::save(), KviProxyDataBase::save(), KviRegisteredChannelDataBase::save(), KviRegisteredUserDataBase::save(), KviSharedFilesManager::save(), KviStatusBar::save(), KviTextIconManager::save(), KviTheme::save(), KviThemeInfo::save(), KviUserIdentity::save(), KviUserIdentityManager::save(), OptionsWidget_messageColors::save(), KviKvsEventManager::saveAppEvents(), BanFrame::saveBans(), KviDefaultScriptManager::saveInternal(), KviApplication::saveKvircDirectory(), ClassEditorWidget::saveNotBuiltClasses(), ScriptEditorImplementation::saveOptions(), ActionEditorWindow::saveProperties(), AliasEditorWidget::saveProperties(), ClassEditorWidget::saveProperties(), HelpWindow::saveProperties(), KviChannelWindow::saveProperties(), KviConsoleWindow::saveProperties(), KviDebugWindow::saveProperties(), KviQueryWindow::saveProperties(), KviWindow::saveProperties(), KviKvsEventManager::saveRawEvents(), KviApplication::saveRecentEntries(), KviStatusBarAwayIndicator::saveState(), KviStatusBarClock::saveState(), KviStatusBarConnectionTimer::saveState(), KviStatusBarUpdateIndicator::saveState(), theme_module_cleanup(), toolbareditor_module_cleanup(), and writeEntry().
void KviConfigurationFile::writeEntry | ( | const QString & | szKey, |
const QStringList & | list ) |
void KviConfigurationFile::writeEntry | ( | const QString & | szKey, |
int | iValue ) |
References getCurrentGroup(), m_bDirty, and KviPointerHashTable< Key, T >::replace().
void KviConfigurationFile::writeEntry | ( | const QString & | szKey, |
QFont & | fnt ) |
void KviConfigurationFile::writeEntry | ( | const QString & | szKey, |
unsigned char | iValue ) |
References getCurrentGroup(), m_bDirty, and KviPointerHashTable< Key, T >::replace().
void KviConfigurationFile::writeEntry | ( | const QString & | szKey, |
unsigned int | iValue ) |
References getCurrentGroup(), m_bDirty, and KviPointerHashTable< Key, T >::replace().
void KviConfigurationFile::writeEntry | ( | const QString & | szKey, |
unsigned short int | usValue ) |
References getCurrentGroup(), m_bDirty, and KviPointerHashTable< Key, T >::replace().
|
private |
Referenced by clear(), clearDirtyFlag(), clearGroup(), clearKey(), dirty(), KviConfigurationFile(), KviConfigurationFile(), save(), saveIfDirty(), setGroup(), writeEntry(), writeEntry(), writeEntry(), writeEntry(), writeEntry(), writeEntry(), writeEntry(), writeEntry(), writeEntry(), writeEntry(), writeEntry(), writeEntry(), writeEntry(), writeEntry(), and ~KviConfigurationFile().
|
private |
Referenced by KviConfigurationFile(), KviConfigurationFile(), load(), and save().
|
private |
Referenced by KviConfigurationFile(), KviConfigurationFile(), preserveEmptyGroups(), save(), and setGroup().
|
private |
Referenced by KviConfigurationFile(), KviConfigurationFile(), readOnly(), save(), and setReadOnly().
|
private |
Referenced by clear(), clearGroup(), dict(), getCurrentGroup(), groupsCount(), hasGroup(), KviConfigurationFile(), KviConfigurationFile(), load(), save(), and ~KviConfigurationFile().
|
private |
Referenced by fileName(), KviConfigurationFile(), KviConfigurationFile(), load(), save(), and setSavePath().
|
private |
Referenced by clear(), clearGroup(), clearKey(), getCurrentGroup(), group(), KviConfigurationFile(), KviConfigurationFile(), and setGroup().
|
private |
Referenced by readEntry().