KVIrc
4.9.2
DeveloperAPIs
|
This class defines a new data type which contains variant data. More...
#include <KviKvsVariant.h>
Public Member Functions | |
void | appendAsString (QString &szBuffer) const |
Appends the variant data to a representative string. More... | |
KviKvsArray * | array () const |
Returns the array contained in the variant data. More... | |
bool | asBoolean () const |
Always evaluates to a boolean value. More... | |
bool | asHObject (kvs_hobject_t &hObject) const |
Evaluates to an object handle. More... | |
bool | asInteger (kvs_int_t &iVal) const |
Eevaluates Integer, Real and String representing an Integer. More... | |
bool | asNumber (KviKvsNumber &n) const |
Eevaluates Integer, Real and String representing a Real or Integer. More... | |
bool | asReal (kvs_real_t &dVal) const |
Eevaluates Integer, Real and String representing a Real. More... | |
void | asString (QString &szBuffer) const |
Evaluates anything to a string. More... | |
bool | boolean () const |
Returns the boolean contained in the variant data. More... | |
void | castToArray (KviKvsArrayCast *pCast) const |
Casts the variant data to an array. More... | |
void | castToInteger (kvs_int_t &iVal) const |
Casts the variant data to an integer. More... | |
void | castToNumber (KviKvsNumber &number) const |
Casts the variant data to a number. More... | |
int | compare (const KviKvsVariant *pOther, bool bPreferNumeric=false) const |
Compares two variants. More... | |
void | convertToArray () |
Converts this variant to an array. More... | |
void | copyFrom (const KviKvsVariant *pVariant) |
Copies a variant from another. More... | |
void | copyFrom (const KviKvsVariant &variant) |
Copies a variant from another. More... | |
void | dump (const char *pcPrefix) const |
Dumps the variant data. More... | |
void | getTypeName (QString &szBuffer) const |
Gets the type from a variant and returns its name. More... | |
KviKvsHash * | hash () const |
Returns the hash contained in the variant data. More... | |
kvs_hobject_t | hobject () const |
Returns the object handle contained in the variant data. More... | |
kvs_int_t | integer () const |
Returns the integer contained in the variant data. More... | |
bool | isArray () const |
Returns true if the variant is an array. More... | |
bool | isBoolean () const |
Returns true if the variant is boolean. More... | |
bool | isEmpty () const |
Returns true if the variant is empty. More... | |
bool | isEqualToNothing () const |
Returns true if the variant is nothing, false, null, 0 or an empty string. More... | |
bool | isHash () const |
Returns true if the variant is an hash. More... | |
bool | isHObject () const |
Returns true if the variant is a hObject. More... | |
bool | isInteger () const |
Returns true if the variant is an integer. More... | |
bool | isNothing () const |
Returns true if the variant is empty. More... | |
bool | isNumeric () const |
Returns true if the variant is numeric. More... | |
bool | isReal () const |
Returns true if the variant is a double floating point. More... | |
bool | isScalar () const |
Returns true if the variant is a scalar. More... | |
bool | isString () const |
Returns true if the variant is a string. More... | |
KviKvsVariant () | |
Constructs the variant data. More... | |
KviKvsVariant (const KviKvsVariant &variant) | |
Constructs the variant data. More... | |
KviKvsVariant (const QString &szString, bool bEscape=false) | |
Constructs the variant data. More... | |
KviKvsVariant (const char *pcString, bool bEscape=false) | |
Constructs the variant data. More... | |
KviKvsVariant (QString *pszString, bool bEscape=false) | |
Constructs the variant data. More... | |
KviKvsVariant (kvs_int_t iInteger, bool bEscape=false) | |
Constructs the variant data. More... | |
KviKvsVariant (kvs_real_t dReal) | |
Constructs the variant data. More... | |
KviKvsVariant (kvs_real_t *pReal) | |
Constructs the variant data. More... | |
KviKvsVariant (bool bBoolean) | |
Constructs the variant data. More... | |
KviKvsVariant (KviKvsArray *pArray) | |
Constructs the variant data. More... | |
KviKvsVariant (KviKvsHash *pHash) | |
Constructs the variant data. More... | |
KviKvsVariant (kvs_hobject_t hObject) | |
Constructs the variant data. More... | |
void | operator= (const KviKvsVariant &variant) |
Allows to create a variant using a carbon copy method. More... | |
kvs_real_t | real () const |
Returns the double floating point contained in the variant data. More... | |
void | serialize (QString &szResult) |
Serializes the variant data using the JSON format. More... | |
void | setArray (KviKvsArray *pArray) |
Sets the variant data as array. More... | |
void | setBoolean (bool bBoolean) |
Sets the variant data as boolean. More... | |
void | setHash (KviKvsHash *pHash) |
Sets the variant data as hash. More... | |
void | setHObject (kvs_hobject_t hObject) |
Sets the variant data as hObject. More... | |
void | setInteger (kvs_int_t iInteger) |
Sets the variant data as integer. More... | |
void | setNothing () |
Clears the variant data. More... | |
void | setReal (kvs_real_t dReal) |
Sets the variant data as double floating point. More... | |
void | setReal (kvs_real_t *pReal) |
Sets the variant data as double floating point. More... | |
void | setString (const QString &szString) |
Sets the variant data as string. More... | |
void | setString (QString *pszString) |
Sets the variant data as string. More... | |
const QString & | string () const |
Returns the string contained in the variant data. More... | |
void | takeFrom (KviKvsVariant *pVariant) |
Copies a variant from another and destroys the second one. More... | |
void | takeFrom (KviKvsVariant &variant) |
Copies a variant from another and destroys the second one. More... | |
KviKvsVariantData::Type | type () |
Returns the type of the variant data. More... | |
~KviKvsVariant () | |
Destroys the variant data. More... | |
Static Public Member Functions | |
static void | serializeString (QString &szBuffer) |
Replaces escapes chars and serialize the string in the given buffer. More... | |
static KviKvsVariant * | unserialize (const QString &szBuffer) |
Unserializes the variant data using the JSON format. More... | |
Protected Attributes | |
KviKvsVariantData * | m_pData |
Static Private Member Functions | |
static KviKvsVariant * | unserialize (const QChar **ppAux) |
Unserializes the variant data using the JSON format. More... | |
static KviKvsVariant * | unserializeArray (const QChar **ppAux) |
Unserializes an array into a variant data using the JSON format. More... | |
static KviKvsVariant * | unserializeBool (const QChar **ppAux, bool bBool) |
Unserializes a boolean into a variant data using the JSON format. More... | |
static KviKvsVariant * | unserializeHash (const QChar **ppAux) |
Unserializes a hash into a variant data using the JSON format. More... | |
static KviKvsVariant * | unserializeInteger (const QChar **ppAux, QString &szData) |
Unserializes an integer into a variant data using the JSON format. More... | |
static KviKvsVariant * | unserializeNull (const QChar **ppAux) |
Unserializes null into a variant data using the JSON format. More... | |
static KviKvsVariant * | unserializeNumber (const QChar **ppAux) |
Unserializes a number into a variant data using the JSON format. More... | |
static KviKvsVariant * | unserializeReal (const QChar **ppAux, QString &szData) |
Unserializes a double floating point into a variant data using the JSON format. More... | |
static void | unserializeString (const QChar **ppAux, QString &szBuffer) |
Unserializes a string into a variant data using the JSON format. More... | |
static KviKvsVariant * | unserializeString (const QChar **ppAux) |
Unserializes a string into a variant data using the JSON format. More... | |
Friends | |
class | KviKvsVariantComparison |
This class defines a new data type which contains variant data.
A variant data is a data which can assume different data types. This is very useful when you don't know in advance which data type you have to manage.
KviKvsVariant::KviKvsVariant | ( | ) |
Constructs the variant data.
References m_pData.
Referenced by castToArray(), convertToArray(), unserializeArray(), unserializeBool(), unserializeHash(), unserializeInteger(), unserializeNull(), unserializeReal(), and unserializeString().
KviKvsVariant::KviKvsVariant | ( | const KviKvsVariant & | variant | ) |
Constructs the variant data.
This is a carbon copy
variant | The variant data to use as a copy |
References m_pData, and KviKvsVariantData::m_uRefs.
KviKvsVariant::KviKvsVariant | ( | const QString & | szString, |
bool | bEscape = false |
||
) |
Constructs the variant data.
szString | The string data to use as variant data |
bEscape | Whether to escape the data in KVS |
References KviQString::escapeKvs(), KviKvsVariantData::m_eType, m_pData, KviKvsVariantData::m_u, KviKvsVariantData::m_uRefs, KviKvsVariantData::DataType::pString, and KviKvsVariantData::String.
KviKvsVariant::KviKvsVariant | ( | const char * | pcString, |
bool | bEscape = false |
||
) |
Constructs the variant data.
pcString | The string data to use as variant data |
bEscape | Whether to escape the data in KVS |
References KviQString::escapeKvs(), KviKvsVariantData::m_eType, m_pData, KviKvsVariantData::m_u, KviKvsVariantData::m_uRefs, KviKvsVariantData::DataType::pString, and KviKvsVariantData::String.
KviKvsVariant::KviKvsVariant | ( | QString * | pszString, |
bool | bEscape = false |
||
) |
Constructs the variant data.
pszString | The string data to use as variant data |
bEscape | Whether to escape the data in KVS |
References KviQString::escapeKvs(), KviKvsVariantData::m_eType, m_pData, KviKvsVariantData::m_u, KviKvsVariantData::m_uRefs, KviKvsVariantData::DataType::pString, and KviKvsVariantData::String.
KviKvsVariant::KviKvsVariant | ( | kvs_int_t | iInteger, |
bool | bEscape = false |
||
) |
Constructs the variant data.
iInteger | The integer data to use as variant data |
bEscape | Whether to escape the data in KVS |
References KviKvsVariantData::DataType::iInt, KviKvsVariantData::Integer, KviKvsVariantData::m_eType, m_pData, KviKvsVariantData::m_u, and KviKvsVariantData::m_uRefs.
KviKvsVariant::KviKvsVariant | ( | kvs_real_t | dReal | ) |
Constructs the variant data.
dReal | The double floating point data to use as variant data |
References KviKvsVariantData::m_eType, m_pData, KviKvsVariantData::m_u, KviKvsVariantData::m_uRefs, KviKvsVariantData::DataType::pReal, and KviKvsVariantData::Real.
KviKvsVariant::KviKvsVariant | ( | kvs_real_t * | pReal | ) |
Constructs the variant data.
pReal | The double floating point data to use as variant data |
References KviKvsVariantData::m_eType, m_pData, KviKvsVariantData::m_u, KviKvsVariantData::m_uRefs, KviKvsVariantData::DataType::pReal, and KviKvsVariantData::Real.
KviKvsVariant::KviKvsVariant | ( | bool | bBoolean | ) |
Constructs the variant data.
bBoolean | The boolean data to use as variant data |
References KviKvsVariantData::DataType::bBoolean, KviKvsVariantData::Boolean, KviKvsVariantData::m_eType, m_pData, KviKvsVariantData::m_u, and KviKvsVariantData::m_uRefs.
KviKvsVariant::KviKvsVariant | ( | KviKvsArray * | pArray | ) |
Constructs the variant data.
pArray | The array data to use as variant data |
References KviKvsVariantData::Array, KviKvsVariantData::m_eType, m_pData, KviKvsVariantData::m_u, KviKvsVariantData::m_uRefs, KviKvsVariantData::DataType::pArray, and pArray.
KviKvsVariant::KviKvsVariant | ( | KviKvsHash * | pHash | ) |
Constructs the variant data.
pHash | The hash data to use as variant data |
References KviKvsVariantData::Hash, KviKvsVariantData::m_eType, m_pData, KviKvsVariantData::m_u, KviKvsVariantData::m_uRefs, and KviKvsVariantData::DataType::pHash.
KviKvsVariant::KviKvsVariant | ( | kvs_hobject_t | hObject | ) |
Constructs the variant data.
hObject | The hObject data to use as variant data |
References KviKvsVariantData::HObject, KviKvsVariantData::DataType::hObject, KviKvsVariantData::m_eType, m_pData, KviKvsVariantData::m_u, and KviKvsVariantData::m_uRefs.
KviKvsVariant::~KviKvsVariant | ( | ) |
Destroys the variant data.
References DETACH_CONTENTS.
void KviKvsVariant::appendAsString | ( | QString & | szBuffer | ) | const |
Appends the variant data to a representative string.
szBuffer | The string buffer to save |
References KviKvsHash::appendAsString(), KviKvsArray::appendAsString(), KviQString::appendNumber(), KviKvsVariantData::Array, KviKvsVariantData::DataType::bBoolean, KviKvsVariantData::Boolean, KviKvsVariantData::Hash, KviKvsVariantData::HObject, KviKvsVariantData::DataType::hObject, KviKvsVariantData::DataType::iInt, KviKvsVariantData::Integer, KviKvsVariantData::m_eType, m_pData, KviKvsVariantData::m_u, KviKvsVariantData::DataType::pArray, KviKvsVariantData::DataType::pHash, KviKvsVariantData::DataType::pReal, KviKvsVariantData::DataType::pString, KviKvsVariantData::Real, and KviKvsVariantData::String.
Referenced by KviKvsArray::appendAsString(), KviKvsTreeNodeCompositeData::evaluateReadOnly(), KviKvsTreeNodeMultipleParameterIdentifier::evaluateReadOnly(), KviKvsTreeNodeOperationStringAppend::execute(), and KviKvsParameterProcessor::process().
|
inline |
Returns the array contained in the variant data.
Referenced by KviKvsTreeNodeArrayCount::evaluateReadOnlyInObjectScope(), KviKvsTreeNodeArrayElement::evaluateReadOnlyInObjectScope(), KviKvsTreeNodeArrayElement::evaluateReadWriteInObjectScope(), KviKvsTreeNodeSpecialCommandForeach::execute(), KviKvsTreeNodeOperationArrayAppend::execute(), KviKvsObject::function_setProperty(), KvsObject_textedit::functionsetColor(), KviKvsCoreFunctions::KVSCF(), KVSO_CLASS_FUNCTION(), KviKvsParameterProcessor::process(), and KviCellItemDelegate::sizeHint().
bool KviKvsVariant::asBoolean | ( | ) | const |
Always evaluates to a boolean value.
References KviKvsVariantData::Array, KviKvsVariantData::DataType::bBoolean, KviKvsVariantData::Boolean, KviKvsVariantData::Hash, KviKvsVariantData::HObject, KviKvsVariantData::DataType::hObject, KviKvsVariantData::DataType::iInt, KviKvsVariantData::Integer, KviKvsHash::isEmpty(), KviKvsArray::isEmpty(), KviKvsVariantData::m_eType, m_pData, KviKvsVariantData::m_u, KviKvsVariantData::DataType::pArray, KviKvsVariantData::DataType::pHash, KviKvsVariantData::DataType::pReal, KviKvsVariantData::DataType::pString, KviKvsVariantData::Real, KviKvsVariantData::String, and KviQString::toI64().
Referenced by KviInputEditor::checkWordSpelling(), dcc_kvs_parse_default_parameters(), KviKvsPopupMenuItem::evaluateCondition(), KviKvsTreeNodeExpressionUnaryOperatorLogicalNot::evaluateReadOnly(), KvsObject_widget::eventFilter(), KviKvsTreeNodeSpecialCommandWhile::execute(), KviKvsTreeNodeSpecialCommandDo::execute(), KviKvsTreeNodeSpecialCommandIf::execute(), KviKvsTreeNodeSpecialCommandFor::execute(), KviKvsObject::function_setProperty(), KviXmlHandler::handleKvsCallReturnValue(), KVSO_CLASS_FUNCTION(), KvsObject_tableWidget::paint(), KviKvsParameterProcessor::process(), and KvsObject_socket::slotNewConnection().
bool KviKvsVariant::asHObject | ( | kvs_hobject_t & | hObject | ) | const |
Evaluates to an object handle.
hObject | The hObject buffer to save |
References KviKvsVariantData::DataType::bBoolean, KviKvsVariantData::Boolean, KviKvsVariantData::HObject, KviKvsVariantData::DataType::hObject, KviKvsVariantData::DataType::iInt, KviKvsVariantData::Integer, KviKvsVariantData::m_eType, m_pData, KviKvsVariantData::m_u, KviKvsVariantData::DataType::pString, and KviKvsVariantData::String.
Referenced by KVSO_CLASS_FUNCTION(), KviKvsTreeNodeScopeOperator::objectFromVariant(), and KviKvsParameterProcessor::process().
bool KviKvsVariant::asInteger | ( | kvs_int_t & | iVal | ) | const |
Eevaluates Integer, Real and String representing an Integer.
iVal | The integer buffer to save |
References KviKvsVariantData::DataType::bBoolean, KviKvsVariantData::Boolean, KviKvsVariantData::DataType::iInt, KviKvsVariantData::Integer, KviKvsVariantData::m_eType, m_pData, KviKvsVariantData::m_u, KviKvsVariantData::DataType::pReal, KviKvsVariantData::DataType::pString, KviKvsVariantData::Real, KviKvsVariantData::String, and KviQString::toI64().
Referenced by asNumber(), castToNumber(), KviKvsTreeNodeConstantData::convertStringConstantToNumeric(), dcc_kvs_cmd_send(), KviKvsTreeNodeArrayElement::evaluateIndex(), KviKvsTreeNodeOperationDecrement::execute(), KviKvsTreeNodeOperationIncrement::execute(), KviKvsTreeNodeOperationSelfAnd::execute(), KviKvsTreeNodeOperationSelfOr::execute(), KviKvsTreeNodeOperationSelfShl::execute(), KviKvsTreeNodeOperationSelfShr::execute(), KviKvsTreeNodeOperationSelfXor::execute(), file_kvs_cmd_writeBytes(), KviKvsObject::function_setProperty(), KvsObject_textedit::functionsetColor(), KviKvsCoreCallbackCommands::KVSCCC(), KviKvsCoreSimpleCommands::KVSCSC(), KVSO_CLASS_FUNCTION(), notifier_kvs_cmd_message(), KviKvsParameterProcessor::process(), KviCellItemDelegate::sizeHint(), str_kvs_fnc_printf(), and toolbar_kvs_cmd_removeitem().
bool KviKvsVariant::asNumber | ( | KviKvsNumber & | n | ) | const |
Eevaluates Integer, Real and String representing a Real or Integer.
n | The number buffer to save |
References asInteger(), asReal(), KviKvsNumber::DataType::dReal, KviKvsNumber::DataType::iInt, KviKvsVariantData::DataType::iInt, KviKvsNumber::Integer, isInteger(), isReal(), m_pData, KviKvsNumber::m_type, KviKvsNumber::m_u, KviKvsVariantData::m_u, KviKvsVariantData::DataType::pReal, and KviKvsNumber::Real.
Referenced by KviKvsTreeNodeExpressionUnaryOperator::evaluateOperand(), KviKvsTreeNodeExpressionBinaryOperator::evaluateOperands(), KviKvsTreeNodeSpecialCommandSwitchLabelCase::execute(), KviKvsTreeNodeOperationSelfDivision::execute(), KviKvsTreeNodeOperationSelfModulus::execute(), KviKvsTreeNodeOperationSelfMultiplication::execute(), KviKvsTreeNodeOperationSelfSubtraction::execute(), KviKvsTreeNodeOperationSelfSum::execute(), KviKvsCoreFunctions::KVSCF(), str_kvs_fnc_isnumber(), and str_kvs_fnc_isunsignednumber().
bool KviKvsVariant::asReal | ( | kvs_real_t & | dVal | ) | const |
Eevaluates Integer, Real and String representing a Real.
dVal | The double floating point buffer to save |
References KviKvsVariantData::DataType::bBoolean, KviKvsVariantData::Boolean, KviKvsVariantData::DataType::iInt, KviKvsVariantData::Integer, KviKvsVariantData::m_eType, m_pData, KviKvsVariantData::m_u, KviKvsVariantData::DataType::pReal, KviKvsVariantData::DataType::pString, KviKvsVariantData::Real, and KviKvsVariantData::String.
Referenced by asNumber(), castToNumber(), compare(), KviKvsVariantComparison::compareIntString(), KviKvsVariantComparison::compareRealString(), KviKvsVariantComparison::compareStringHObject(), KviKvsTreeNodeConstantData::convertStringConstantToNumeric(), KviKvsTreeNodeOperationDecrement::execute(), KviKvsTreeNodeOperationIncrement::execute(), KviKvsObject::function_setProperty(), isEqualToNothing(), KviKvsCoreFunctions::KVSCF(), KVSO_CLASS_FUNCTION(), KviKvsParameterProcessor::process(), and str_kvs_fnc_printf().
void KviKvsVariant::asString | ( | QString & | szBuffer | ) | const |
Evaluates anything to a string.
szBuffer | The string buffer to save |
References KviKvsHash::appendAsString(), KviKvsArray::appendAsString(), KviKvsVariantData::Array, KviKvsVariantData::DataType::bBoolean, KviKvsVariantData::Boolean, KviKvsVariantData::Hash, KviKvsVariantData::HObject, KviKvsVariantData::DataType::hObject, KviKvsVariantData::DataType::iInt, KviKvsVariantData::Integer, KviKvsVariantData::m_eType, m_pData, KviKvsVariantData::m_u, KviKvsVariantData::DataType::pArray, KviKvsVariantData::DataType::pHash, KviKvsVariantData::DataType::pReal, KviKvsVariantData::DataType::pString, KviKvsVariantData::Real, and KviKvsVariantData::String.
Referenced by KviChannelWindow::closeEvent(), KviKvsVariantComparison::compareIntString(), KviKvsVariantComparison::compareRealString(), dcc_kvs_cmd_send(), dcc_kvs_parse_default_parameters(), KviKvsScript::evaluateAsString(), KviKvsPopupMenuItemWithTextAndIcon::evaluateIcon(), KviKvsTreeNodeStringCast::evaluateReadOnly(), KviKvsTreeNodeMultipleParameterIdentifier::evaluateReadOnly(), KviKvsTreeNodeHashElement::evaluateReadOnlyInObjectScope(), KviKvsTreeNodeHashElement::evaluateReadWriteInObjectScope(), KviKvsPopupMenuItemWithTextAndIcon::evaluateText(), KvsObject_widget::eventFilter(), KviKvsTreeNodeRebindingSwitch::execute(), KviKvsTreeNodeSpecialCommandSwitchLabelCase::execute(), KviKvsTreeNodeSpecialCommandClass::execute(), KviKvsTreeNodeSpecialCommandSwitchLabelMatch::execute(), KviKvsTreeNodeSpecialCommandSwitchLabelRegexp::execute(), KviKvsTreeNodeSpecialCommandDefpopup::execute(), KviKvsTreeNodeOperationStringAppend::execute(), KviKvsTreeNodeOperationStringAppendWithComma::execute(), KviKvsTreeNodeOperationStringAppendWithSpace::execute(), KviKvsTreeNodeOperationStringTransliteration::execute(), KviKvsTreeNodeOperationStringSubstitution::execute(), file_kvs_cmd_writeBytes(), file_kvs_cmd_writeLines(), KviInputEditor::fillSpellCheckerCorrectionsPopup(), KviKvsVariantList::firstAsString(), KviKvsObject::function_setProperty(), KvsObject_textedit::functionsetColor(), KviKvsSwitchList::getAsStringIfExisting(), KviWindow::getDefaultLogFileName(), KviKvsCoreCallbackCommands::KVSCCC(), KviKvsCoreFunctions::KVSCF(), KviKvsCoreSimpleCommands::KVSCSC(), KVSO_CLASS_FUNCTION(), KviKvsVariantList::nextAsString(), OptionsWidget_textEncoding::OptionsWidget_textEncoding(), PluginManager::pluginCall(), popup_kvs_cmd_show(), KviKvsParameterProcessor::process(), KviKvsScript::run(), str_kvs_fnc_grep(), str_kvs_fnc_join(), str_kvs_fnc_printf(), KviIrcContext::terminateConnectionRequest(), theme_kvs_cmd_pack(), toolbar_kvs_cmd_removeitem(), KviKvsProcessAsyncOperation::trigger(), upnp_kvs_cmd_addPortMapping(), urllist_module_event_onUrl(), and KviIrcConnection::useRealName().
|
inline |
Returns the boolean contained in the variant data.
void KviKvsVariant::castToArray | ( | KviKvsArrayCast * | pCast | ) | const |
Casts the variant data to an array.
Always evaluates to an array
pCast | The array buffer to save |
References KviKvsVariantData::Array, KviPointerHashTableIterator< Key, T >::current(), KviKvsHash::dict(), KviKvsVariantData::Hash, KviKvsVariant(), KviKvsVariantData::m_eType, m_pData, KviKvsVariantData::m_u, KviKvsVariantData::DataType::pArray, pArray, KviKvsVariantData::DataType::pHash, KviKvsArrayCast::set(), and KviKvsArray::set().
Referenced by KviInputEditor::fillSpellCheckerCorrectionsPopup(), and KviKvsParameterProcessor::process().
void KviKvsVariant::castToInteger | ( | kvs_int_t & | iVal | ) | const |
Casts the variant data to an integer.
Always evaluates to an integer
iVal | The integer buffer to save |
References KviKvsVariantData::Array, KviKvsVariantData::DataType::bBoolean, KviKvsVariantData::Boolean, KviKvsVariantData::Hash, KviKvsVariantData::HObject, KviKvsVariantData::DataType::hObject, KviKvsVariantData::DataType::iInt, KviKvsVariantData::Integer, KviKvsVariantData::m_eType, m_pData, KviKvsVariantData::m_u, KviKvsVariantData::DataType::pArray, KviKvsVariantData::DataType::pHash, KviKvsVariantData::DataType::pReal, KviKvsVariantData::DataType::pString, KviKvsVariantData::Real, KviKvsHash::size(), KviKvsArray::size(), KviKvsVariantData::String, and KviQString::toI64().
Referenced by castToNumber(), and KviKvsCoreFunctions::KVSCF().
void KviKvsVariant::castToNumber | ( | KviKvsNumber & | number | ) | const |
Casts the variant data to a number.
Always evaluates to some number
number | The string buffer to save |
References asInteger(), asReal(), castToInteger(), KviKvsNumber::DataType::dReal, KviKvsNumber::DataType::iInt, KviKvsVariantData::DataType::iInt, KviKvsNumber::Integer, isInteger(), isReal(), m_pData, KviKvsNumber::m_type, KviKvsNumber::m_u, KviKvsVariantData::m_u, KviKvsVariantData::DataType::pReal, and KviKvsNumber::Real.
int KviKvsVariant::compare | ( | const KviKvsVariant * | pOther, |
bool | bPreferNumeric = false |
||
) | const |
Compares two variants.
Returns -1 if this variant is greater than the other, 0 if they are equal, 1 if the other is greater. If bPreferNumeric is true then a conversion to a numeric format is first attempted
pOther | The second variant to compare |
bPreferNumeric | Whether to cast to a numeric format |
References KviKvsVariantData::Array, asReal(), KviKvsVariantData::DataType::bBoolean, KviKvsVariantData::Boolean, CMP_EQUAL, CMP_OTHERGREATER, CMP_THISGREATER, KviKvsVariantComparison::compareArrayHash(), KviKvsVariantComparison::compareBoolArray(), KviKvsVariantComparison::compareBoolHash(), KviKvsVariantComparison::compareBoolHObject(), KviKvsVariantComparison::compareBoolString(), KviKvsVariantComparison::compareHObjectArray(), KviKvsVariantComparison::compareHObjectHash(), KviKvsVariantComparison::compareIntArray(), KviKvsVariantComparison::compareIntBool(), KviKvsVariantComparison::compareIntHash(), KviKvsVariantComparison::compareIntHObject(), KviKvsVariantComparison::compareIntReal(), KviKvsVariantComparison::compareIntString(), KviKvsVariantComparison::compareRealArray(), KviKvsVariantComparison::compareRealBool(), KviKvsVariantComparison::compareRealHash(), KviKvsVariantComparison::compareRealHObject(), KviKvsVariantComparison::compareRealString(), KviKvsVariantComparison::compareStringArray(), KviKvsVariantComparison::compareStringHash(), KviKvsVariantComparison::compareStringHObject(), KviKvsVariantData::Hash, KviKvsVariantData::HObject, KviKvsVariantData::DataType::hObject, KviKvsVariantData::DataType::iInt, KviKvsVariantData::Integer, isEqualToNothing(), KviKvsVariantData::m_eType, m_pData, KviKvsVariantData::m_u, KviKvsVariantData::DataType::pArray, KviKvsVariantData::DataType::pHash, KviKvsVariantData::DataType::pReal, KviKvsVariantData::DataType::pString, KviKvsVariantData::Real, KviKvsHash::size(), KviKvsArray::size(), and KviKvsVariantData::String.
Referenced by kvi_compare().
void KviKvsVariant::convertToArray | ( | ) |
Converts this variant to an array.
References KviKvsVariantData::Array, KviPointerHashTableIterator< Key, T >::current(), KviKvsHash::dict(), KviKvsVariantData::Hash, KviKvsVariant(), KviKvsVariantData::m_eType, m_pData, KviKvsVariantData::m_u, pArray, KviKvsVariantData::DataType::pHash, KviKvsArray::set(), and setArray().
Referenced by KviKvsTreeNodeOperationArrayAppend::execute().
void KviKvsVariant::copyFrom | ( | const KviKvsVariant * | pVariant | ) |
Copies a variant from another.
pVariant | The variant to copy from |
References DETACH_CONTENTS, m_pData, and KviKvsVariantData::m_uRefs.
Referenced by KviKvsTreeNodeConstantData::evaluateReadOnly(), KviKvsTreeNodeExtendedScopeVariable::evaluateReadOnly(), KviKvsTreeNodeLocalVariable::evaluateReadOnly(), KviKvsTreeNodeGlobalVariable::evaluateReadOnly(), KviKvsTreeNodeSingleParameterIdentifier::evaluateReadOnly(), KviKvsTreeNodeExpressionConstantOperand::evaluateReadOnly(), KviKvsTreeNodeObjectField::evaluateReadOnlyInObjectScope(), KviKvsTreeNodeHashElement::evaluateReadOnlyInObjectScope(), KviKvsTreeNodeArrayElement::evaluateReadOnlyInObjectScope(), KviKvsTreeNodeParameterReturn::execute(), KviKvsTreeNodeSpecialCommandForeach::execute(), and KviKvsProcessAsyncOperation::trigger().
void KviKvsVariant::copyFrom | ( | const KviKvsVariant & | variant | ) |
Copies a variant from another.
variant | The variant to copy from |
References DETACH_CONTENTS, m_pData, and KviKvsVariantData::m_uRefs.
void KviKvsVariant::dump | ( | const char * | pcPrefix | ) | const |
Dumps the variant data.
pcPrefix | The prefix of the data |
References KviKvsVariantData::Array, KviKvsVariantData::DataType::bBoolean, KviKvsVariantData::Boolean, KviKvsHash::dict(), KviKvsVariantData::Hash, KviKvsVariantData::HObject, KviKvsVariantData::DataType::hObject, KviKvsVariantData::DataType::iInt, KviKvsVariantData::Integer, KviKvsVariantData::m_eType, m_pData, KviKvsVariantData::m_u, KviKvsVariantData::DataType::pArray, KviKvsVariantData::DataType::pHash, KviKvsVariantData::DataType::pReal, KviKvsVariantData::DataType::pString, KviKvsVariantData::Real, and KviKvsVariantData::String.
Referenced by KviKvsTreeNodeConstantData::dump(), and KviKvsTreeNodeExpressionConstantOperand::dump().
void KviKvsVariant::getTypeName | ( | QString & | szBuffer | ) | const |
Gets the type from a variant and returns its name.
szBuffer | The buffer to save the type name |
References KviKvsVariantData::Array, KviKvsVariantData::Boolean, KviKvsVariantData::Hash, KviKvsVariantData::HObject, KviKvsVariantData::Integer, KviKvsVariantData::m_eType, m_pData, KviKvsVariantData::Real, and KviKvsVariantData::String.
Referenced by KviKvsTreeNodeHashCount::evaluateReadOnlyInObjectScope(), KviKvsTreeNodeHashElement::evaluateReadOnlyInObjectScope(), KviKvsTreeNodeHashReferenceAssert::evaluateReadOnlyInObjectScope(), KviKvsTreeNodeArrayCount::evaluateReadOnlyInObjectScope(), KviKvsTreeNodeArrayElement::evaluateReadOnlyInObjectScope(), KviKvsTreeNodeArrayReferenceAssert::evaluateReadOnlyInObjectScope(), KviKvsTreeNodeHashElement::evaluateReadWriteInObjectScope(), KviKvsTreeNodeArrayElement::evaluateReadWriteInObjectScope(), KviKvsParameterProcessor::handleParameterTypeError(), KviKvsCoreFunctions::KVSCF(), and KVSO_CLASS_FUNCTION().
|
inline |
Returns the hash contained in the variant data.
Referenced by KviKvsTreeNodeHashCount::evaluateReadOnlyInObjectScope(), KviKvsTreeNodeHashElement::evaluateReadOnlyInObjectScope(), KviKvsTreeNodeHashElement::evaluateReadWriteInObjectScope(), KviKvsTreeNodeOperationArrayAppend::execute(), KviKvsCoreFunctions::KVSCF(), KVSO_CLASS_FUNCTION(), OptionsWidget_textEncoding::OptionsWidget_textEncoding(), and KviKvsParameterProcessor::process().
|
inline |
Returns the object handle contained in the variant data.
Referenced by KviKvsObject::function_setProperty().
|
inline |
Returns the integer contained in the variant data.
|
inline |
Returns true if the variant is an array.
References KviKvsVariantData::Array.
Referenced by KviKvsTreeNodeArrayCount::evaluateReadOnlyInObjectScope(), KviKvsTreeNodeArrayElement::evaluateReadOnlyInObjectScope(), KviKvsTreeNodeArrayReferenceAssert::evaluateReadOnlyInObjectScope(), KviKvsTreeNodeArrayElement::evaluateReadWriteInObjectScope(), KviKvsObject::function_setProperty(), KvsObject_textedit::functionsetColor(), KVSO_CLASS_FUNCTION(), KviKvsParameterProcessor::process(), and KviCellItemDelegate::sizeHint().
|
inline |
Returns true if the variant is boolean.
References KviKvsVariantData::Boolean.
Referenced by dcc_kvs_cmd_send(), and KVSO_CLASS_FUNCTION().
bool KviKvsVariant::isEmpty | ( | ) | const |
Returns true if the variant is empty.
References KviKvsVariantData::Array, KviKvsVariantData::Hash, KviKvsVariantData::HObject, KviKvsVariantData::DataType::hObject, KviKvsHash::isEmpty(), KviKvsArray::isEmpty(), KviKvsVariantData::m_eType, m_pData, KviKvsVariantData::m_u, KviKvsVariantData::DataType::pArray, KviKvsVariantData::DataType::pHash, KviKvsVariantData::DataType::pString, and KviKvsVariantData::String.
Referenced by KviKvsObjectClass::allocateInstance(), KviKvsTreeNodeSpecialCommandForeach::execute(), KviKvsParameterProcessor::handleParameterTypeError(), KviKvsCoreCallbackCommands::KVSCCC(), KviKvsCoreFunctions::KVSCF(), KVSO_CLASS_FUNCTION(), KviKvsArrayElement::~KviKvsArrayElement(), and KviKvsHashElement::~KviKvsHashElement().
bool KviKvsVariant::isEqualToNothing | ( | ) | const |
Returns true if the variant is nothing, false, null, 0 or an empty string.
References KviKvsVariantData::Array, asReal(), KviKvsVariantData::DataType::bBoolean, KviKvsVariantData::Boolean, KviKvsVariantData::Hash, KviKvsVariantData::HObject, KviKvsVariantData::DataType::hObject, KviKvsVariantData::DataType::iInt, KviKvsVariantData::Integer, KviKvsHash::isEmpty(), KviKvsArray::isEmpty(), KviKvsVariantData::m_eType, m_pData, KviKvsVariantData::m_u, KviKvsVariantData::DataType::pArray, KviKvsVariantData::DataType::pHash, KviKvsVariantData::DataType::pReal, KviKvsVariantData::DataType::pString, KviKvsVariantData::Real, and KviKvsVariantData::String.
Referenced by compare(), and KviKvsVariantComparison::compareBoolString().
|
inline |
Returns true if the variant is an hash.
References KviKvsVariantData::Hash.
Referenced by KviKvsTreeNodeHashCount::evaluateReadOnlyInObjectScope(), KviKvsTreeNodeHashElement::evaluateReadOnlyInObjectScope(), KviKvsTreeNodeHashReferenceAssert::evaluateReadOnlyInObjectScope(), KviKvsTreeNodeHashElement::evaluateReadWriteInObjectScope(), KVSO_CLASS_FUNCTION(), and KviKvsParameterProcessor::process().
|
inline |
Returns true if the variant is a hObject.
References KviKvsVariantData::HObject.
Referenced by KviKvsObject::function_setProperty(), and KVSO_CLASS_FUNCTION().
|
inline |
Returns true if the variant is an integer.
References KviKvsVariantData::Integer.
Referenced by asNumber(), castToNumber(), and KVSO_CLASS_FUNCTION().
|
inline |
Returns true if the variant is empty.
Referenced by KviKvsTreeNodeHashCount::evaluateReadOnlyInObjectScope(), KviKvsTreeNodeHashElement::evaluateReadOnlyInObjectScope(), KviKvsTreeNodeHashReferenceAssert::evaluateReadOnlyInObjectScope(), KviKvsTreeNodeArrayCount::evaluateReadOnlyInObjectScope(), KviKvsTreeNodeArrayElement::evaluateReadOnlyInObjectScope(), KviKvsTreeNodeArrayReferenceAssert::evaluateReadOnlyInObjectScope(), KviKvsTreeNodeHashElement::evaluateReadWriteInObjectScope(), KviKvsTreeNodeArrayElement::evaluateReadWriteInObjectScope(), KVSO_CLASS_FUNCTION(), and KviKvsProcessAsyncOperation::trigger().
|
inline |
Returns true if the variant is numeric.
References KviKvsVariantData::Integer, and KviKvsVariantData::Real.
|
inline |
Returns true if the variant is a double floating point.
References KviKvsVariantData::Real.
Referenced by asNumber(), castToNumber(), and KVSO_CLASS_FUNCTION().
|
inline |
Returns true if the variant is a scalar.
References KviKvsVariantData::Integer, KviKvsVariantData::Real, and KviKvsVariantData::String.
|
inline |
Returns true if the variant is a string.
References KviKvsVariantData::String.
Referenced by KviKvsTreeNodeConstantData::convertStringConstantToNumeric(), KviKvsTreeNodeStringCast::evaluateReadOnly(), KviKvsParameterProcessor::handleParameterTypeError(), and KVSO_CLASS_FUNCTION().
|
inline |
Allows to create a variant using a carbon copy method.
variant | The variant to copy from |
|
inline |
Returns the double floating point contained in the variant data.
void KviKvsVariant::serialize | ( | QString & | szResult | ) |
Serializes the variant data using the JSON format.
szResult | The buffer to store the serialization |
References KviKvsVariantData::Array, KviKvsVariantData::DataType::bBoolean, KviKvsVariantData::Boolean, KviKvsVariantData::Hash, KviKvsVariantData::HObject, KviKvsVariantData::DataType::iInt, KviKvsVariantData::Integer, KviKvsVariantData::m_eType, m_pData, KviKvsVariantData::m_u, KviKvsVariantData::Nothing, KviKvsVariantData::DataType::pArray, KviKvsVariantData::DataType::pHash, KviKvsVariantData::DataType::pReal, KviKvsVariantData::DataType::pString, KviKvsVariantData::Real, KviKvsArray::serialize(), KviKvsHash::serialize(), serializeString(), and KviKvsVariantData::String.
Referenced by KviKvsCoreFunctions::KVSCF(), and KviKvsArray::serialize().
|
static |
Replaces escapes chars and serialize the string in the given buffer.
szBuffer | The buffer to store the serialization |
Referenced by KviKvsHash::serialize(), and serialize().
void KviKvsVariant::setArray | ( | KviKvsArray * | pArray | ) |
Sets the variant data as array.
pArray | The value to set |
References KviKvsVariantData::Array, KviKvsVariantData::m_eType, m_pData, KviKvsVariantData::m_u, KviKvsVariantData::DataType::pArray, pArray, and RENEW_VARIANT_DATA.
Referenced by chan_kvs_fnc_banexceptionlist(), chan_kvs_fnc_banlist(), chan_kvs_fnc_invitelist(), chan_kvs_fnc_masklist(), chan_kvs_fnc_users(), config_kvs_fnc_filelist(), config_kvs_fnc_keylist(), config_kvs_fnc_sectionlist(), context_kvs_fnc_list(), convertToArray(), dcc_kvs_fnc_sessionList(), KviKvsTreeNodeArrayElement::evaluateReadWriteInObjectScope(), file_kvs_fnc_allSizes(), file_kvs_fnc_ls(), file_kvs_fnc_readBytes(), file_kvs_fnc_readLines(), KviKvsObject::function_children(), KviKvsObject::function_listProperties(), KviKvsObject::function_property(), KvsObject_textedit::functionCursorPosition(), objects_kvs_fnc_classes(), objects_kvs_fnc_instances(), objects_kvs_fnc_listObjects(), regchan_kvs_fnc_list(), reguser_kvs_fnc_list(), reguser_kvs_fnc_mask(), spellchecker_kvs_suggestions(), str_kvs_fnc_grep(), str_kvs_fnc_split(), system_kvs_fnc_dbus(), toolbar_kvs_fnc_items(), toolbar_kvs_fnc_list(), userlist_kvs_fnc_selected(), and window_kvs_fnc_list().
void KviKvsVariant::setBoolean | ( | bool | bBoolean | ) |
Sets the variant data as boolean.
bBoolean | The value to set |
References KviKvsVariantData::DataType::bBoolean, KviKvsVariantData::Boolean, KviKvsVariantData::m_eType, m_pData, KviKvsVariantData::m_u, and RENEW_VARIANT_DATA.
Referenced by action_kvs_fnc_exists(), action_kvs_fnc_isEnabled(), addon_kvs_fnc_exists(), KviKvsObjectStandardTrueReturnFunctionHandler::call(), KviKvsObjectStandardFalseReturnFunctionHandler::call(), chan_kvs_fnc_isdead(), chan_kvs_fnc_ison(), config_kvs_fnc_hassection(), config_kvs_fnc_readonly(), dcc_kvs_fnc_isFileDownload(), dcc_kvs_fnc_isFileTransfer(), dcc_kvs_fnc_isFileUpload(), dialog_kvs_fnc_yesno(), KviKvsTreeNodeExpressionUnaryOperatorLogicalNot::evaluateReadOnly(), file_kvs_fnc_exists(), KviKvsObject::function_property(), KvsObject_textedit::functionAtBeginning(), KvsObject_textedit::functionAtEnd(), KvsObject_textedit::functionbold(), KvsObject_textedit::functionisUndoRedoEnabled(), KvsObject_textedit::functionitalic(), KvsObject_textedit::functionModified(), KvsObject_textedit::functionunderline(), mask_kvs_fnc_hasnumerichost(), mask_kvs_fnc_match(), math_kvs_fnc_isinf(), my_kvs_fnc_serverIsIPV6(), my_kvs_fnc_serverIsSSL(), notifier_kvs_fnc_isEnabled(), objects_kvs_fnc_exists(), options_kvs_fnc_isdialog(), perl_kvs_fnc_isAvailable(), popup_kvs_fnc_exists(), popup_kvs_fnc_isEmpty(), python_kvs_fnc_isAvailable(), regchan_kvs_fnc_find(), regchan_kvs_fnc_match(), reguser_kvs_fnc_isIgnoreEnabled(), serverdb_kvs_fnc_networkExists(), serverdb_kvs_fnc_serverExists(), snd_kvs_fnc_ismuted(), spellchecker_kvs_check(), str_kvs_fnc_contains(), str_kvs_fnc_equal(), str_kvs_fnc_evpVerify(), str_kvs_fnc_isempty(), str_kvs_fnc_isnumber(), str_kvs_fnc_isunsignednumber(), str_kvs_fnc_match(), system_kvs_fnc_checkModule(), tmphighlight_kvs_fnc_ischannelhighlighted(), tmphighlight_kvs_fnc_isnickhighlighted(), toolbar_kvs_fnc_exists(), toolbar_kvs_fnc_isVisible(), trayicon_kvs_fnc_isvisible(), upnp_kvs_fnc_isGatewayAvailable(), window_kvs_fnc_exists(), window_kvs_fnc_hasInput(), window_kvs_fnc_hasOutput(), window_kvs_fnc_hasUserFocus(), and window_kvs_fnc_isDocked().
void KviKvsVariant::setHash | ( | KviKvsHash * | pHash | ) |
Sets the variant data as hash.
pHash | The value to set |
References KviKvsVariantData::Hash, KviKvsVariantData::m_eType, m_pData, KviKvsVariantData::m_u, KviKvsVariantData::DataType::pHash, and RENEW_VARIANT_DATA.
Referenced by KviKvsTreeNodeHashElement::evaluateReadWriteInObjectScope(), file_kvs_fnc_diskSpace(), language_kvs_cmd_detect(), objects_kvs_fnc_classAllHandlers(), objects_kvs_fnc_variables(), package_kvs_fnc_info(), spellchecker_kvs_available_dictionaries(), texticons_kvs_fnc_get(), and theme_kvs_fnc_info().
void KviKvsVariant::setHObject | ( | kvs_hobject_t | hObject | ) |
Sets the variant data as hObject.
hObject | The value to set |
References KviKvsVariantData::HObject, KviKvsVariantData::DataType::hObject, KviKvsVariantData::m_eType, m_pData, KviKvsVariantData::m_u, and RENEW_VARIANT_DATA.
Referenced by KviKvsObject::function_findChild(), KviKvsObject::function_parent(), and KviKvsObject::function_signalSender().
void KviKvsVariant::setInteger | ( | kvs_int_t | iInteger | ) |
Sets the variant data as integer.
iInteger | The value to set |
References KviKvsVariantData::DataType::iInt, KviKvsVariantData::Integer, KviKvsVariantData::m_eType, m_pData, KviKvsVariantData::m_u, and RENEW_VARIANT_DATA.
Referenced by chan_kvs_fnc_admincount(), chan_kvs_fnc_bancount(), chan_kvs_fnc_banexceptioncount(), chan_kvs_fnc_halfopcount(), chan_kvs_fnc_invitecount(), chan_kvs_fnc_limit(), chan_kvs_fnc_maskcount(), chan_kvs_fnc_opcount(), chan_kvs_fnc_ownercount(), chan_kvs_fnc_usercount(), chan_kvs_fnc_userjointime(), chan_kvs_fnc_userlastactiontime(), chan_kvs_fnc_usermodelevel(), chan_kvs_fnc_useropcount(), chan_kvs_fnc_voicecount(), config_kvs_fnc_readonly(), context_kvs_fnc_queueSize(), KviKvsTreeNodeConstantData::convertStringConstantToNumeric(), dcc_kvs_fnc_averageSpeed(), dcc_kvs_fnc_currentSpeed(), dcc_kvs_fnc_ircContext(), dcc_kvs_fnc_session(), dcc_kvs_fnc_transferredBytes(), KviKvsTreeNodeParameterCount::evaluateReadOnly(), KviKvsTreeNodeExpressionUnaryOperatorNegate::evaluateReadOnly(), KviKvsTreeNodeExpressionUnaryOperatorBitwiseNot::evaluateReadOnly(), KviKvsTreeNodeHashCount::evaluateReadOnlyInObjectScope(), KviKvsTreeNodeArrayCount::evaluateReadOnlyInObjectScope(), KviKvsTreeNodeOperationDecrement::execute(), KviKvsTreeNodeOperationIncrement::execute(), KviKvsTreeNodeOperationSelfAnd::execute(), KviKvsTreeNodeOperationSelfDivision::execute(), KviKvsTreeNodeOperationSelfModulus::execute(), KviKvsTreeNodeOperationSelfMultiplication::execute(), KviKvsTreeNodeOperationSelfOr::execute(), KviKvsTreeNodeOperationSelfShl::execute(), KviKvsTreeNodeOperationSelfShr::execute(), KviKvsTreeNodeOperationSelfSubtraction::execute(), KviKvsTreeNodeOperationSelfSum::execute(), KviKvsTreeNodeOperationSelfXor::execute(), file_kvs_fnc_size(), file_kvs_fnc_time(), KviKvsObject::function_childCount(), KviKvsObject::function_property(), KviKvsObject::function_startTimer(), KvsObject_http::functionCurrentId(), KvsObject_http::functionGet(), KvsObject_textedit::functionlines(), KvsObject_textedit::functionMaxLines(), KvsObject_textedit::functionNumLines(), KvsObject_http::functionPost(), my_kvs_fnc_globalIdle(), str_kvs_fnc_charsum(), str_kvs_fnc_cmp(), str_kvs_fnc_find(), str_kvs_fnc_findfirst(), str_kvs_fnc_findlast(), str_kvs_fnc_len(), system_kvs_fnc_dbus(), system_kvs_fnc_htoni(), system_kvs_fnc_ntohi(), texticons_kvs_fnc_get(), KviKvsObject::timerEvent(), window_kvs_fnc_activityLevel(), window_kvs_fnc_activityTemperature(), window_kvs_fnc_console(), window_kvs_fnc_context(), window_kvs_fnc_highlightLevel(), and window_kvs_fnc_open().
void KviKvsVariant::setNothing | ( | ) |
Clears the variant data.
References DELETE_VARIANT_CONTENTS, m_pData, and KviKvsVariantData::m_uRefs.
Referenced by addon_kvs_fnc_version(), avatar_kvs_fnc_name(), avatar_kvs_fnc_path(), KviKvsObjectStandardNothingReturnFunctionHandler::call(), chan_kvs_fnc_getflag(), chan_kvs_fnc_matchban(), chan_kvs_fnc_matchbanexception(), chan_kvs_fnc_matchinvite(), chan_kvs_fnc_matchmask(), chan_kvs_fnc_matchqban(), KviKvsTreeNodeGlobalVariable::evaluateReadOnly(), KviKvsTreeNodeExtendedScopeVariable::evaluateReadOnly(), KviKvsTreeNodeLocalVariable::evaluateReadOnly(), KviKvsTreeNodeSingleParameterIdentifier::evaluateReadOnly(), KviKvsTreeNodeMultipleParameterIdentifier::evaluateReadOnly(), KviKvsTreeNodeCoreFunctionCall::evaluateReadOnly(), KviKvsTreeNodeModuleFunctionCall::evaluateReadOnly(), KviKvsTreeNodeAliasFunctionCall::evaluateReadOnly(), KviKvsTreeNodeObjectField::evaluateReadOnlyInObjectScope(), KviKvsTreeNodeThisObjectFunctionCall::evaluateReadOnlyInObjectScope(), KviKvsTreeNodeHashElement::evaluateReadOnlyInObjectScope(), KviKvsTreeNodeBaseObjectFunctionCall::evaluateReadOnlyInObjectScope(), KviKvsTreeNodeArrayElement::evaluateReadOnlyInObjectScope(), KviKvsTreeNodeParameterReturn::execute(), KviKvsTreeNodeSpecialCommandUnset::execute(), KviKvsTreeNodeSpecialCommandForeach::execute(), KviKvsObject::function_listProperties(), KviKvsObject::function_property(), KviKvsObject::function_setProperty(), popup_kvs_fnc_currentItemId(), and userlist_kvs_fnc_selected().
void KviKvsVariant::setReal | ( | kvs_real_t | dReal | ) |
Sets the variant data as double floating point.
dReal | The value to set |
References KviKvsVariantData::m_eType, m_pData, KviKvsVariantData::m_u, KviKvsVariantData::DataType::pReal, KviKvsVariantData::Real, and RENEW_VARIANT_DATA.
Referenced by KviKvsTreeNodeConstantData::convertStringConstantToNumeric(), KviKvsTreeNodeExpressionUnaryOperatorNegate::evaluateReadOnly(), KviKvsTreeNodeOperationDecrement::execute(), KviKvsTreeNodeOperationIncrement::execute(), KviKvsTreeNodeOperationSelfDivision::execute(), KviKvsTreeNodeOperationSelfModulus::execute(), KviKvsTreeNodeOperationSelfMultiplication::execute(), KviKvsTreeNodeOperationSelfSubtraction::execute(), KviKvsTreeNodeOperationSelfSum::execute(), KviKvsObject::function_property(), math_kvs_fnc_e(), math_kvs_fnc_pi(), and math_kvs_fnc_pow().
void KviKvsVariant::setReal | ( | kvs_real_t * | pReal | ) |
Sets the variant data as double floating point.
pReal | The value to set |
References KviKvsVariantData::m_eType, m_pData, KviKvsVariantData::m_u, KviKvsVariantData::DataType::pReal, KviKvsVariantData::Real, and RENEW_VARIANT_DATA.
void KviKvsVariant::setString | ( | const QString & | szString | ) |
Sets the variant data as string.
szString | The value to set |
References KviKvsVariantData::m_eType, m_pData, KviKvsVariantData::m_u, KviKvsVariantData::DataType::pString, RENEW_VARIANT_DATA, and KviKvsVariantData::String.
Referenced by addon_kvs_fnc_version(), avatar_kvs_fnc_name(), avatar_kvs_fnc_path(), chan_kvs_fnc_common(), chan_kvs_fnc_getflag(), chan_kvs_fnc_getUrl(), chan_kvs_fnc_key(), chan_kvs_fnc_matchban(), chan_kvs_fnc_matchbanexception(), chan_kvs_fnc_matchinvite(), chan_kvs_fnc_matchmask(), chan_kvs_fnc_matchqban(), chan_kvs_fnc_modeParam(), chan_kvs_fnc_name(), chan_kvs_fnc_topic(), chan_kvs_fnc_topicsetat(), chan_kvs_fnc_topicsetby(), config_kvs_fnc_filename(), config_kvs_fnc_id(), config_kvs_fnc_open(), config_kvs_fnc_read(), config_kvs_fnc_section(), context_kvs_fnc_getSSLCertInfo(), dcc_kvs_fnc_connectionType(), dcc_kvs_fnc_getSSLCertInfo(), dcc_kvs_fnc_localFileName(), dcc_kvs_fnc_localFileSize(), dcc_kvs_fnc_localHost(), dcc_kvs_fnc_localIp(), dcc_kvs_fnc_localNick(), dcc_kvs_fnc_localPort(), dcc_kvs_fnc_localUser(), dcc_kvs_fnc_protocol(), dcc_kvs_fnc_remoteFileName(), dcc_kvs_fnc_remoteFileSize(), dcc_kvs_fnc_remoteHost(), dcc_kvs_fnc_remoteIp(), dcc_kvs_fnc_remoteNick(), dcc_kvs_fnc_remotePort(), dcc_kvs_fnc_remoteUser(), dcc_kvs_fnc_transferStatus(), dumpChildObjects(), KviKvsTreeNodeStringCast::evaluateReadOnly(), KviKvsTreeNodeCompositeData::evaluateReadOnly(), KviKvsTreeNodeMultipleParameterIdentifier::evaluateReadOnly(), KviKvsTreeNodeParameterReturn::execute(), KviKvsTreeNodeOperationStringAppend::execute(), KviKvsTreeNodeOperationStringAppendWithComma::execute(), KviKvsTreeNodeOperationStringAppendWithSpace::execute(), KviKvsTreeNodeOperationStringTransliteration::execute(), KviKvsTreeNodeOperationStringSubstitution::execute(), file_kvs_fnc_cwd(), file_kvs_fnc_digest(), file_kvs_fnc_extractfilename(), file_kvs_fnc_extractpath(), file_kvs_fnc_fixpath(), file_kvs_fnc_globaldir(), file_kvs_fnc_homedir(), file_kvs_fnc_localdir(), file_kvs_fnc_ps(), file_kvs_fnc_read(), file_kvs_fnc_rootdir(), file_kvs_fnc_type(), KviKvsObject::function_className(), KviKvsObject::function_name(), KviKvsObject::function_property(), KviKvsObject::function_signalName(), KvsObject_http::functionErrorString(), KvsObject_http::functionReadAll(), KvsObject_textedit::functionText(), KvsObject_textedit::functiontextFormat(), KvsObject_textedit::functionTextLine(), KvsObject_textedit::functionWordWrap(), log_kvs_fnc_export(), log_kvs_fnc_file(), mask_kvs_fnc_host(), mask_kvs_fnc_nick(), mask_kvs_fnc_user(), my_kvs_fnc_host(), my_kvs_fnc_ip(), my_kvs_fnc_network(), my_kvs_fnc_nick(), my_kvs_fnc_server(), my_kvs_fnc_umode(), my_kvs_fnc_user(), objects_kvs_fnc_listObjects(), objects_kvs_fnc_name(), perl_kvs_cmd_begin(), PluginManager::pluginCall(), popup_kvs_fnc_currentItemId(), proxydb_kvs_fnc_protocol(), python_kvs_cmd_begin(), regchan_kvs_fnc_property(), reguser_kvs_fnc_exactMatch(), reguser_kvs_fnc_getIgnoreFlags(), reguser_kvs_fnc_mask(), reguser_kvs_fnc_match(), reguser_kvs_fnc_matchProperty(), reguser_kvs_fnc_property(), str_kvs_fnc_append(), str_kvs_fnc_chop(), str_kvs_fnc_digest(), str_kvs_fnc_evpSign(), str_kvs_fnc_evpVerify(), str_kvs_fnc_fromclipboard(), str_kvs_fnc_insert(), str_kvs_fnc_join(), str_kvs_fnc_left(), str_kvs_fnc_lefttofirst(), str_kvs_fnc_lefttolast(), str_kvs_fnc_localelowcase(), str_kvs_fnc_localeupcase(), str_kvs_fnc_lowcase(), str_kvs_fnc_mid(), str_kvs_fnc_prepend(), str_kvs_fnc_printf(), str_kvs_fnc_replace(), str_kvs_fnc_right(), str_kvs_fnc_rightfromfirst(), str_kvs_fnc_rightfromlast(), str_kvs_fnc_section(), str_kvs_fnc_strip(), str_kvs_fnc_stripcolors(), str_kvs_fnc_stripleft(), str_kvs_fnc_stripright(), str_kvs_fnc_token(), str_kvs_fnc_upcase(), str_kvs_fnc_urlencode(), str_kvs_fnc_word(), system_kvs_fnc_clipboard(), system_kvs_fnc_dbus(), system_kvs_fnc_getenv(), system_kvs_fnc_hostname(), system_kvs_fnc_osmachine(), system_kvs_fnc_osname(), system_kvs_fnc_osnodename(), system_kvs_fnc_osrelease(), system_kvs_fnc_ostype(), system_kvs_fnc_osversion(), system_kvs_fnc_selection(), texticons_kvs_fnc_get(), upnp_kvs_fnc_getExternalIpAddress(), window_kvs_fnc_caption(), window_kvs_fnc_cryptEngine(), window_kvs_fnc_inputText(), and window_kvs_fnc_type().
void KviKvsVariant::setString | ( | QString * | pszString | ) |
Sets the variant data as string.
pszString | The value to set |
References KviKvsVariantData::m_eType, m_pData, KviKvsVariantData::m_u, KviKvsVariantData::DataType::pString, RENEW_VARIANT_DATA, and KviKvsVariantData::String.
|
inline |
Returns the string contained in the variant data.
References KviQString::Empty.
Referenced by KviKvsParameterProcessor::handleParameterTypeError().
void KviKvsVariant::takeFrom | ( | KviKvsVariant * | pVariant | ) |
Copies a variant from another and destroys the second one.
pVariant | The variant to take from |
References DETACH_CONTENTS, and m_pData.
Referenced by KviKvsTreeNodeOperationAssignment::execute().
void KviKvsVariant::takeFrom | ( | KviKvsVariant & | variant | ) |
Copies a variant from another and destroys the second one.
variant | The variant to take from |
References DETACH_CONTENTS, and m_pData.
|
inline |
Returns the type of the variant data.
References KviKvsVariantData::Nothing.
Referenced by KviKvsTreeNodeOperationArrayAppend::execute(), KviKvsCoreFunctions::KVSCF(), and KVSO_CLASS_FUNCTION().
|
static |
Unserializes the variant data using the JSON format.
szBuffer | The buffer where is stored the serialization |
Referenced by KviKvsCoreFunctions::KVSCF(), KVSO_CLASS_FUNCTION(), unserializeArray(), and unserializeHash().
|
staticprivate |
Unserializes the variant data using the JSON format.
ppAux | The pointer where the serialization is located |
References unserializeArray(), unserializeBool(), unserializeHash(), unserializeNull(), unserializeNumber(), and unserializeString().
|
staticprivate |
Unserializes an array into a variant data using the JSON format.
ppAux | The pointer where the serialization is located |
References i, KviKvsVariant(), pArray, KviKvsArray::set(), and unserialize().
Referenced by unserialize().
|
staticprivate |
Unserializes a boolean into a variant data using the JSON format.
ppAux | The pointer where the serialization is located |
bBool | Whether the variant is true or false |
References KviQString::equalCIN(), and KviKvsVariant().
Referenced by unserialize().
|
staticprivate |
Unserializes a hash into a variant data using the JSON format.
ppAux | The pointer where the serialization is located |
References i, KviKvsVariant(), KviKvsHash::set(), unserialize(), and unserializeString().
Referenced by unserialize().
|
staticprivate |
Unserializes an integer into a variant data using the JSON format.
ppAux | The pointer where the serialization is located |
szData | The buffer where the serialization is stored |
References KviKvsVariant().
Referenced by unserializeNumber().
|
staticprivate |
Unserializes null into a variant data using the JSON format.
ppAux | The pointer where the serialization is located |
References KviQString::equalCIN(), and KviKvsVariant().
Referenced by unserialize().
|
staticprivate |
Unserializes a number into a variant data using the JSON format.
ppAux | The pointer where the serialization is located |
References unserializeInteger(), and unserializeReal().
Referenced by unserialize().
|
staticprivate |
Unserializes a double floating point into a variant data using the JSON format.
ppAux | The pointer where the serialization is located |
szData | The buffer where the serialization is stored |
References KviKvsVariant().
Referenced by unserializeNumber().
|
staticprivate |
Unserializes a string into a variant data using the JSON format.
ppAux | The pointer where the serialization is located |
szBuffer | The buffer to store the unserialization |
References i.
Referenced by unserialize(), unserializeHash(), and unserializeString().
|
staticprivate |
Unserializes a string into a variant data using the JSON format.
ppAux | The pointer where the serialization is located |
References KviKvsVariant(), szBuffer, and unserializeString().
|
friend |
|
protected |
Referenced by appendAsString(), asBoolean(), asHObject(), asInteger(), asNumber(), asReal(), asString(), castToArray(), castToInteger(), castToNumber(), compare(), KviKvsVariantComparison::compareArrayHash(), KviKvsVariantComparison::compareBoolArray(), KviKvsVariantComparison::compareBoolHash(), KviKvsVariantComparison::compareBoolHObject(), KviKvsVariantComparison::compareBoolString(), KviKvsVariantComparison::compareHObjectArray(), KviKvsVariantComparison::compareHObjectHash(), KviKvsVariantComparison::compareIntArray(), KviKvsVariantComparison::compareIntBool(), KviKvsVariantComparison::compareIntHash(), KviKvsVariantComparison::compareIntHObject(), KviKvsVariantComparison::compareIntReal(), KviKvsVariantComparison::compareIntString(), KviKvsVariantComparison::compareRealArray(), KviKvsVariantComparison::compareRealBool(), KviKvsVariantComparison::compareRealHash(), KviKvsVariantComparison::compareRealHObject(), KviKvsVariantComparison::compareRealString(), KviKvsVariantComparison::compareStringArray(), KviKvsVariantComparison::compareStringHash(), KviKvsVariantComparison::compareStringHObject(), convertToArray(), copyFrom(), dump(), getTypeName(), isEmpty(), isEqualToNothing(), KviKvsVariant(), serialize(), setArray(), setBoolean(), setHash(), setHObject(), setInteger(), setNothing(), setReal(), setString(), and takeFrom().