KVIrc
4.9.2
DeveloperAPIs
|
This class defines a new data type which contains hash data. More...
#include <KviKvsHash.h>
Public Member Functions | |
void | appendAsString (QString &szBuffer) const |
Appends data to the hash converting it into a string. More... | |
void | clear () |
clear the hash More... | |
const KviPointerHashTable < QString, KviKvsVariant > * | dict () |
Returns the internal dictionary of the hash. More... | |
KviKvsVariant * | find (const QString &szKey) const |
Returns the element associated to the given key. More... | |
KviKvsVariant * | get (const QString &szKey) |
Returns the element associated to the given key. More... | |
bool | isEmpty () const |
Returns true if the hash is empty. More... | |
KviKvsHash () | |
Constructs the hash data. More... | |
KviKvsHash (const KviKvsHash &hash) | |
Constructs the hash data. More... | |
void | serialize (QString &szResult) |
Serializes the hash to a given buffer. More... | |
void | set (const QString &szKey, KviKvsVariant *pVal) |
Sets an element into the hash. More... | |
kvs_uint_t | size () const |
Returns the size of the hash. More... | |
void | unset (const QString &szKey) |
Unsets an element from the hash. More... | |
~KviKvsHash () | |
Destroys the array data. More... | |
Private Attributes | |
KviPointerHashTable< QString, KviKvsVariant > * | m_pDict |
This class defines a new data type which contains hash data.
KviKvsHash::KviKvsHash | ( | ) |
Constructs the hash data.
References m_pDict, and KviPointerHashTable< Key, T >::setAutoDelete().
KviKvsHash::KviKvsHash | ( | const KviKvsHash & | hash | ) |
Constructs the hash data.
This is a carbon copy
hash | The hash to copy from |
References KviPointerHashTableIterator< Key, T >::current(), KviPointerHashTableIterator< Key, T >::currentKey(), m_pDict, KviPointerHashTable< Key, T >::replace(), and KviPointerHashTable< Key, T >::setAutoDelete().
KviKvsHash::~KviKvsHash | ( | ) |
Destroys the array data.
References m_pDict.
void KviKvsHash::appendAsString | ( | QString & | szBuffer | ) | const |
Appends data to the hash converting it into a string.
szBuffer | The string to append |
References KviPointerHashTableIterator< Key, T >::current(), and m_pDict.
Referenced by KviKvsVariant::appendAsString(), and KviKvsVariant::asString().
void KviKvsHash::clear | ( | ) |
clear the hash
References KviPointerHashTable< Key, T >::clear(), and m_pDict.
const KviPointerHashTable< QString, KviKvsVariant > * KviKvsHash::dict | ( | ) |
Returns the internal dictionary of the hash.
References m_pDict.
Referenced by KviKvsVariant::castToArray(), KviKvsVariant::convertToArray(), KviKvsVariant::dump(), KviKvsTreeNodeOperationArrayAppend::execute(), KviKvsCoreFunctions::KVSCF(), objects_kvs_fnc_variables(), and OptionsWidget_textEncoding::OptionsWidget_textEncoding().
KviKvsVariant * KviKvsHash::find | ( | const QString & | szKey | ) | const |
Returns the element associated to the given key.
szKey | The key of the element to retrieve |
References KviPointerHashTable< Key, T >::find(), and m_pDict.
Referenced by KviKvsTreeNodeExtendedScopeVariable::evaluateReadOnly(), KviKvsTreeNodeGlobalVariable::evaluateReadOnly(), KviKvsTreeNodeLocalVariable::evaluateReadOnly(), KviKvsTreeNodeObjectField::evaluateReadOnlyInObjectScope(), and KviKvsTreeNodeHashElement::evaluateReadOnlyInObjectScope().
KviKvsVariant * KviKvsHash::get | ( | const QString & | szKey | ) |
Returns the element associated to the given key.
If the element doesn't exists, it returns an empty element. If the index is out of hash bounds, it increases the hash size, fillin the hash in with empty strings.
szKey | The key of the element to retrieve |
References KviPointerHashTable< Key, T >::find(), m_pDict, and KviPointerHashTable< Key, T >::replace().
Referenced by KviKvsTreeNodeExtendedScopeVariable::evaluateReadWrite(), KviKvsTreeNodeGlobalVariable::evaluateReadWrite(), KviKvsTreeNodeLocalVariable::evaluateReadWrite(), KviKvsTreeNodeObjectField::evaluateReadWriteInObjectScope(), and KviKvsTreeNodeHashElement::evaluateReadWriteInObjectScope().
bool KviKvsHash::isEmpty | ( | ) | const |
Returns true if the hash is empty.
References KviPointerHashTable< Key, T >::isEmpty(), and m_pDict.
Referenced by KviKvsVariant::asBoolean(), KviKvsVariantComparison::compareBoolHash(), KviKvsVariantComparison::compareHObjectHash(), KviKvsVariantComparison::compareIntHash(), KviKvsVariantComparison::compareRealHash(), KviKvsVariantComparison::compareStringHash(), KviKvsVariant::isEmpty(), and KviKvsVariant::isEqualToNothing().
void KviKvsHash::serialize | ( | QString & | szResult | ) |
Serializes the hash to a given buffer.
szResult | The buffer to store |
References KviPointerHashTableIterator< Key, T >::current(), KviPointerHashTableIterator< Key, T >::currentKey(), m_pDict, and KviKvsVariant::serializeString().
Referenced by KviKvsVariant::serialize().
void KviKvsHash::set | ( | const QString & | szKey, |
KviKvsVariant * | pVal | ||
) |
Sets an element into the hash.
szKey | The key of the element to set |
pVal | The value to set |
References m_pDict, and KviPointerHashTable< Key, T >::replace().
Referenced by file_kvs_fnc_diskSpace(), KviKvsCoreFunctions::KVSCF(), KVSO_CLASS_FUNCTION(), language_kvs_cmd_detect(), KviIrcMessage::messageTagsKvsHash(), package_kvs_fnc_info(), KvsObject_colorDialog::slotColorSelected(), KvsObject_colorDialog::slotCurrentColorChanged(), spellchecker_enumerate_dicts(), KviXmlHandler::startElement(), texticons_kvs_fnc_get(), theme_kvs_fnc_info(), and KviKvsVariant::unserializeHash().
kvs_uint_t KviKvsHash::size | ( | ) | const |
Returns the size of the hash.
References KviPointerHashTable< Key, T >::count(), and m_pDict.
Referenced by KviKvsVariant::castToInteger(), KviKvsVariant::compare(), KviKvsVariantComparison::compareArrayHash(), KviKvsTreeNodeHashCount::evaluateReadOnlyInObjectScope(), and KviKvsCoreFunctions::KVSCF().
void KviKvsHash::unset | ( | const QString & | szKey | ) |
Unsets an element from the hash.
szKey | The key of the element to unset |
References m_pDict, and KviPointerHashTable< Key, T >::remove().
Referenced by KviKvsHashElement::~KviKvsHashElement().
|
private |
Referenced by appendAsString(), clear(), dict(), find(), get(), isEmpty(), KviKvsHash(), serialize(), set(), size(), unset(), and ~KviKvsHash().