KVIrc  4.9.2
DeveloperAPIs
Public Types | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | List of all members
KviConfigurationFile Class Reference

#include <KviConfigurationFile.h>

+ Inheritance diagram for KviConfigurationFile:

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 ()
 
bool ensureWritable ()
 
const QString & fileName ()
 
const QString & group ()
 
unsigned int groupsCount ()
 
bool hasGroup (const QString &szGroup)
 
bool hasKey (const QString &szKey)
 
 KviConfigurationFile (const QString &filename, FileMode f, bool bLocal8Bit=false)
 
 KviConfigurationFile (const char *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)
 
void setGroup (const QString &szGroup)
 
void setReadOnly (bool bReadOnly)
 
void setSavePath (const QString &savePath)
 
bool sync ()
 
void writeEntry (const QString &szKey, const QString &szValue)
 
void writeEntry (const QString &szKey, const char *szValue)
 
void writeEntry (const QString &szKey, const KviPixmap &pixmap)
 
void writeEntry (const QString &szKey, const KviMessageTypeSettings &msg)
 
void writeEntry (const QString &szKey, const QColor &clr)
 
void writeEntry (const QString &szKey, QFont &fnt)
 
void writeEntry (const QString &szKey, bool bTrue)
 
void writeEntry (const QString &szKey, const QRect &rct)
 
void writeEntry (const QString &szKey, const QStringList &list)
 
void writeEntry (const QString &szKey, const QList< int > &list)
 
void writeEntry (const QString &szKey, int iValue)
 
void writeEntry (const QString &szKey, unsigned short int usValue)
 
void writeEntry (const QString &szKey, unsigned int iValue)
 
void writeEntry (const QString &szKey, char iValue)
 
void writeEntry (const QString &szKey, unsigned char iValue)
 
 ~KviConfigurationFile ()
 

Static Public Member Functions

static void getFontProperties (KviCString &buffer, QFont *fnt)
 
static void setFontProperties (KviCString &str, QFont *fnt)
 

Private Member Functions

KviConfigurationFileGroupgetCurrentGroup ()
 
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
 

Member Enumeration Documentation

Enumerator
Read 
Write 
ReadWrite 

Constructor & Destructor Documentation

KviConfigurationFile::KviConfigurationFile ( const QString &  filename,
FileMode  f,
bool  bLocal8Bit = false 
)
KviConfigurationFile::KviConfigurationFile ( const char *  filename,
FileMode  f,
bool  bLocal8Bit = false 
)
KviConfigurationFile::~KviConfigurationFile ( )

References m_bDirty, m_pDict, and save().

Member Function Documentation

void KviConfigurationFile::clear ( )
void KviConfigurationFile::clearDirtyFlag ( )
inline
void KviConfigurationFile::clearGroup ( const QString &  szGroup)
void KviConfigurationFile::clearKey ( const QString &  szKey)
KviPointerHashTable<QString, KviConfigurationFileGroup>* KviConfigurationFile::dict ( )
inline
bool KviConfigurationFile::dirty ( )
inline

Referenced by config_kvs_cmd_close().

bool KviConfigurationFile::ensureWritable ( )

References f, m_bReadOnly, and m_szFileName.

Referenced by KviApplication::saveOptions().

const QString& KviConfigurationFile::fileName ( )
inline
KviConfigurationFileGroup * KviConfigurationFile::getCurrentGroup ( )
private
void KviConfigurationFile::getFontProperties ( KviCString buffer,
QFont *  fnt 
)
static
const QString& KviConfigurationFile::group ( )
inline
unsigned int KviConfigurationFile::groupsCount ( )
inline
bool KviConfigurationFile::hasGroup ( const QString &  szGroup)
bool KviConfigurationFile::hasKey ( const QString &  szKey)
bool KviConfigurationFile::load ( )
private
void KviConfigurationFile::preserveEmptyGroups ( bool  bPreserve)
inline
bool KviConfigurationFile::readBoolEntry ( const QString &  szKey,
bool  bTrue 
)
char KviConfigurationFile::readCharEntry ( const QString &  szKey,
char  iDefault 
)
QColor KviConfigurationFile::readColorEntry ( const QString &  szKey,
const QColor &  clr 
)
QString KviConfigurationFile::readEntry ( const QString &  szKey,
const QString &  szDefault = QString() 
)
QFont KviConfigurationFile::readFontEntry ( const QString &  szKey,
const QFont &  fnt 
)
int KviConfigurationFile::readIntEntry ( const QString &  szKey,
int  iDefault 
)
QList< int > KviConfigurationFile::readIntListEntry ( const QString &  szKey,
const QList< int > &  list 
)
QString KviConfigurationFile::readKviCStringEntry ( const QString &  szKey,
const KviCString szDefault 
)
inline

References KviCString::ptr().

KviMessageTypeSettings KviConfigurationFile::readMsgTypeEntry ( const QString &  szKey,
const KviMessageTypeSettings msgDef 
)
bool KviConfigurationFile::readOnly ( )
inline
KviPixmap KviConfigurationFile::readPixmapEntry ( const QString &  szKey,
const KviPixmap pixDef 
)
QRect KviConfigurationFile::readRectEntry ( const QString &  szKey,
const QRect &  rct 
)
QStringList KviConfigurationFile::readStringListEntry ( const QString &  szKey,
const QStringList &  list = QStringList() 
)
unsigned char KviConfigurationFile::readUCharEntry ( const QString &  szKey,
unsigned char  iDefault 
)
unsigned int KviConfigurationFile::readUIntEntry ( const QString &  szKey,
unsigned int  iDefault 
)
unsigned short int KviConfigurationFile::readUShortEntry ( const QString &  szKey,
unsigned short int  usDefault 
)
bool KviConfigurationFile::save ( )
private
void KviConfigurationFile::setFontProperties ( KviCString str,
QFont *  fnt 
)
static
void KviConfigurationFile::setGroup ( const QString &  szGroup)

References getCurrentGroup(), hasGroup(), m_bDirty, m_bPreserveEmptyGroups, and m_szGroup.

Referenced by ConfigDialog::acceptbtn(), KviMainWindow::addWindow(), KviTheme::apply(), config_kvs_cmd_setsection(), config_set_section(), ConfigDialog::ConfigDialog(), KviMircServersIniImport::doImport(), ListWindow::exportList(), KviApplication::findLocalKvircDirectory(), KviIrcServerDataBase::importFromMircIni(), ListWindow::importList(), KviSharedFilesManager::load(), KviKvsPopupManager::load(), KviMediaManager::load(), KviCustomToolBarManager::load(), KviKvsAliasManager::load(), KviRegisteredUserDataBase::load(), KviActionManager::load(), KviKvsScriptAddon::load(), KviThemeInfo::load(), KviAvatarCache::load(), KviUserIdentityManager::load(), KviIrcServerDataBase::load(), OptionsWidget_messageColors::load(), KviStatusBar::load(), KviTextIconManager::load(), KviKvsEventManager::loadAppEvents(), ClassEditorWidget::loadNotBuiltClasses(), KviKvsEventManager::loadRawEvents(), KviSharedFilesManager::save(), KviKvsPopupManager::save(), KviRegisteredChannelDataBase::save(), KviMediaManager::save(), KviCustomToolBarManager::save(), KviKvsAliasManager::save(), KviKvsUserAction::save(), KviCustomToolBarDescriptor::save(), KviRegisteredUserDataBase::save(), KviActionManager::save(), KviKvsScriptAddon::save(), KviThemeInfo::save(), KviUserIdentityManager::save(), KviAvatarCache::save(), KviKvsScriptAddonManager::save(), KviIrcServerDataBase::save(), OptionsWidget_messageColors::save(), KviStatusBar::save(), KviTextIconManager::save(), KviUserIdentity::save(), KviTheme::save(), KviKvsEventManager::saveAppEvents(), KviApplication::saveKvircDirectory(), ClassEditorWidget::saveNotBuiltClasses(), KviKvsEventManager::saveRawEvents(), KviMainWindow::saveWindowProperties(), SetupWizard::SetupWizard(), and url_module_cleanup().

void KviConfigurationFile::setReadOnly ( bool  bReadOnly)
inline

Referenced by config_kvs_fnc_open().

void KviConfigurationFile::setSavePath ( const QString &  savePath)
inline

Referenced by TipWindow::closeConfig().

bool KviConfigurationFile::sync ( )
inline
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(), TipWindow::nextTip(), TipWindow::prevTip(), KviProxyDataBase::save(), KviSharedFilesManager::save(), KviRegisteredChannelDataBase::save(), KviMediaManager::save(), KviNickServRuleSet::save(), KviCustomToolBarManager::save(), KviKvsAliasManager::save(), KviKvsUserAction::save(), KviCustomToolBarDescriptor::save(), KviNickServRule::save(), KviRegisteredUserDataBase::save(), KviKvsScriptAddon::save(), KviThemeInfo::save(), KviInputHistory::save(), KviUserIdentityManager::save(), KviAvatarCache::save(), KviIdentityProfile::save(), KviIdentityProfileSet::save(), KviIrcServerDataBase::save(), OptionsWidget_messageColors::save(), KviStatusBar::save(), KviTextIconManager::save(), KviKvsPopupMenu::save(), KviUserIdentity::save(), KviIrcServer::save(), KviTheme::save(), KviKvsEventManager::saveAppEvents(), BanFrame::saveBans(), KviDefaultScriptManager::saveInternal(), KviApplication::saveKvircDirectory(), ClassEditorWidget::saveNotBuiltClasses(), ScriptEditorImplementation::saveOptions(), KviDebugWindow::saveProperties(), HelpWindow::saveProperties(), AliasEditorWidget::saveProperties(), KviConsoleWindow::saveProperties(), ActionEditorWindow::saveProperties(), KviQueryWindow::saveProperties(), ClassEditorWidget::saveProperties(), KviWindow::saveProperties(), KviChannelWindow::saveProperties(), KviKvsEventManager::saveRawEvents(), KviApplication::saveRecentEntries(), KviStatusBarClock::saveState(), KviStatusBarConnectionTimer::saveState(), KviStatusBarAwayIndicator::saveState(), KviStatusBarUpdateIndicator::saveState(), KviMainWindow::saveWindowProperties(), theme_module_cleanup(), and toolbareditor_module_cleanup().

void KviConfigurationFile::writeEntry ( const QString &  szKey,
const char *  szValue 
)
inline
void KviConfigurationFile::writeEntry ( const QString &  szKey,
const KviPixmap pixmap 
)
void KviConfigurationFile::writeEntry ( const QString &  szKey,
const KviMessageTypeSettings msg 
)
void KviConfigurationFile::writeEntry ( const QString &  szKey,
const QColor &  clr 
)
void KviConfigurationFile::writeEntry ( const QString &  szKey,
QFont &  fnt 
)
void KviConfigurationFile::writeEntry ( const QString &  szKey,
bool  bTrue 
)
void KviConfigurationFile::writeEntry ( const QString &  szKey,
const QRect &  rct 
)
void KviConfigurationFile::writeEntry ( const QString &  szKey,
const QStringList &  list 
)
void KviConfigurationFile::writeEntry ( const QString &  szKey,
const QList< int > &  list 
)
void KviConfigurationFile::writeEntry ( const QString &  szKey,
int  iValue 
)
void KviConfigurationFile::writeEntry ( const QString &  szKey,
unsigned short int  usValue 
)
void KviConfigurationFile::writeEntry ( const QString &  szKey,
unsigned int  iValue 
)
void KviConfigurationFile::writeEntry ( const QString &  szKey,
char  iValue 
)
void KviConfigurationFile::writeEntry ( const QString &  szKey,
unsigned char  iValue 
)

Member Data Documentation

bool KviConfigurationFile::m_bDirty
private
bool KviConfigurationFile::m_bLocal8Bit
private

Referenced by KviConfigurationFile(), load(), and save().

bool KviConfigurationFile::m_bPreserveEmptyGroups
private
bool KviConfigurationFile::m_bReadOnly
private
KviPointerHashTable<QString, KviConfigurationFileGroup>* KviConfigurationFile::m_pDict
private
QString KviConfigurationFile::m_szFileName
private
QString KviConfigurationFile::m_szGroup
private
QString KviConfigurationFile::m_szStrBuffer
private

Referenced by readEntry().


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