KVIrc  4.9.2
DeveloperAPIs
Public Member Functions | Static Public Member Functions | Protected Attributes | Static Private Member Functions | Friends | List of all members
KviKvsVariant Class Reference

This class defines a new data type which contains variant data. More...

#include <KviKvsVariant.h>

+ Inheritance diagram for KviKvsVariant:

Public Member Functions

void appendAsString (QString &szBuffer) const
 Appends the variant data to a representative string. More...
 
KviKvsArrayarray () 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...
 
KviKvsHashhash () 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 KviKvsVariantunserialize (const QString &szBuffer)
 Unserializes the variant data using the JSON format. More...
 

Protected Attributes

KviKvsVariantDatam_pData
 

Static Private Member Functions

static KviKvsVariantunserialize (const QChar **ppAux)
 Unserializes the variant data using the JSON format. More...
 
static KviKvsVariantunserializeArray (const QChar **ppAux)
 Unserializes an array into a variant data using the JSON format. More...
 
static KviKvsVariantunserializeBool (const QChar **ppAux, bool bBool)
 Unserializes a boolean into a variant data using the JSON format. More...
 
static KviKvsVariantunserializeHash (const QChar **ppAux)
 Unserializes a hash into a variant data using the JSON format. More...
 
static KviKvsVariantunserializeInteger (const QChar **ppAux, QString &szData)
 Unserializes an integer into a variant data using the JSON format. More...
 
static KviKvsVariantunserializeNull (const QChar **ppAux)
 Unserializes null into a variant data using the JSON format. More...
 
static KviKvsVariantunserializeNumber (const QChar **ppAux)
 Unserializes a number into a variant data using the JSON format. More...
 
static KviKvsVariantunserializeReal (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 KviKvsVariantunserializeString (const QChar **ppAux)
 Unserializes a string into a variant data using the JSON format. More...
 

Friends

class KviKvsVariantComparison
 

Detailed Description

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.

Warning
This class must NOT have virtual functions nor destructor otherwise it will happily crash on windows when it is allocated in modules and destroyed anywhere else around...

Constructor & Destructor Documentation

KviKvsVariant::KviKvsVariant ( )
KviKvsVariant::KviKvsVariant ( const KviKvsVariant variant)

Constructs the variant data.

This is a carbon copy

Parameters
variantThe variant data to use as a copy
Returns
KviKvsVariant

References m_pData, and KviKvsVariantData::m_uRefs.

KviKvsVariant::KviKvsVariant ( const QString &  szString,
bool  bEscape = false 
)

Constructs the variant data.

Parameters
szStringThe string data to use as variant data
bEscapeWhether to escape the data in KVS
Returns
KviKvsVariant

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.

Parameters
pcStringThe string data to use as variant data
bEscapeWhether to escape the data in KVS
Warning
Without this constructor gcc chooses the conversion (const char *)->(void *) instead of (const char *)->(QString) and obviously calls the wrong constructor
Returns
KviKvsVariant

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.

Parameters
pszStringThe string data to use as variant data
bEscapeWhether to escape the data in KVS
Returns
KviKvsVariant

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.

Parameters
iIntegerThe integer data to use as variant data
bEscapeWhether to escape the data in KVS
Returns
KviKvsVariant

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.

Parameters
dRealThe double floating point data to use as variant data
Returns
KviKvsVariant

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.

Parameters
pRealThe double floating point data to use as variant data
Returns
KviKvsVariant

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.

Parameters
bBooleanThe boolean data to use as variant data
Returns
KviKvsVariant

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.

Parameters
pArrayThe array data to use as variant data
Returns
KviKvsVariant

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.

Parameters
pHashThe hash data to use as variant data
Returns
KviKvsVariant

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.

Parameters
hObjectThe hObject data to use as variant data
Returns
KviKvsVariant

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.

Member Function Documentation

void KviKvsVariant::appendAsString ( QString &  szBuffer) const
KviKvsArray* KviKvsVariant::array ( ) const
inline
bool KviKvsVariant::asBoolean ( ) const
bool KviKvsVariant::asHObject ( kvs_hobject_t hObject) const
bool KviKvsVariant::asInteger ( kvs_int_t iVal) const
bool KviKvsVariant::asNumber ( KviKvsNumber n) const
bool KviKvsVariant::asReal ( kvs_real_t dVal) const
void KviKvsVariant::asString ( QString &  szBuffer) const

Evaluates anything to a string.

Parameters
szBufferThe string buffer to save
Returns
bool

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

bool KviKvsVariant::boolean ( ) const
inline

Returns the boolean contained in the variant data.

Returns
bool
void KviKvsVariant::castToArray ( KviKvsArrayCast pCast) const
void KviKvsVariant::castToInteger ( kvs_int_t iVal) const
void KviKvsVariant::castToNumber ( KviKvsNumber number) const
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

Parameters
pOtherThe second variant to compare
bPreferNumericWhether to cast to a numeric format
Returns
int

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 ( )
void KviKvsVariant::copyFrom ( const KviKvsVariant pVariant)
void KviKvsVariant::copyFrom ( const KviKvsVariant variant)

Copies a variant from another.

Parameters
variantThe variant to copy from
Returns
void

References DETACH_CONTENTS, m_pData, and KviKvsVariantData::m_uRefs.

void KviKvsVariant::dump ( const char *  pcPrefix) const
void KviKvsVariant::getTypeName ( QString &  szBuffer) const
KviKvsHash* KviKvsVariant::hash ( ) const
inline
kvs_hobject_t KviKvsVariant::hobject ( ) const
inline

Returns the object handle contained in the variant data.

Returns
kvs_hobject_t

Referenced by KviKvsObject::function_setProperty().

kvs_int_t KviKvsVariant::integer ( ) const
inline

Returns the integer contained in the variant data.

Returns
kvs_int_t
bool KviKvsVariant::isArray ( ) const
inline
bool KviKvsVariant::isBoolean ( ) const
inline

Returns true if the variant is boolean.

Returns
bool

References KviKvsVariantData::Boolean.

Referenced by dcc_kvs_cmd_send(), and KVSO_CLASS_FUNCTION().

bool KviKvsVariant::isEmpty ( ) const
bool KviKvsVariant::isEqualToNothing ( ) const
bool KviKvsVariant::isHash ( ) const
inline
bool KviKvsVariant::isHObject ( ) const
inline

Returns true if the variant is a hObject.

Returns
bool

References KviKvsVariantData::HObject.

Referenced by KviKvsObject::function_setProperty(), and KVSO_CLASS_FUNCTION().

bool KviKvsVariant::isInteger ( ) const
inline

Returns true if the variant is an integer.

Returns
bool

References KviKvsVariantData::Integer.

Referenced by asNumber(), castToNumber(), and KVSO_CLASS_FUNCTION().

bool KviKvsVariant::isNothing ( ) const
inline
bool KviKvsVariant::isNumeric ( ) const
inline

Returns true if the variant is numeric.

Returns
bool

References KviKvsVariantData::Integer, and KviKvsVariantData::Real.

bool KviKvsVariant::isReal ( ) const
inline

Returns true if the variant is a double floating point.

Returns
bool

References KviKvsVariantData::Real.

Referenced by asNumber(), castToNumber(), and KVSO_CLASS_FUNCTION().

bool KviKvsVariant::isScalar ( ) const
inline

Returns true if the variant is a scalar.

Returns
bool

References KviKvsVariantData::Integer, KviKvsVariantData::Real, and KviKvsVariantData::String.

bool KviKvsVariant::isString ( ) const
inline
void KviKvsVariant::operator= ( const KviKvsVariant variant)
inline

Allows to create a variant using a carbon copy method.

Parameters
variantThe variant to copy from
Returns
void
kvs_real_t KviKvsVariant::real ( ) const
inline

Returns the double floating point contained in the variant data.

Returns
kvs_real_t
void KviKvsVariant::serialize ( QString &  szResult)
void KviKvsVariant::serializeString ( QString &  szBuffer)
static

Replaces escapes chars and serialize the string in the given buffer.

Parameters
szBufferThe buffer to store the serialization
Returns
void

Referenced by KviKvsHash::serialize(), and serialize().

void KviKvsVariant::setArray ( KviKvsArray pArray)
void KviKvsVariant::setBoolean ( bool  bBoolean)

Sets the variant data as boolean.

Parameters
bBooleanThe value to set
Returns
void

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)
void KviKvsVariant::setHObject ( kvs_hobject_t  hObject)
void KviKvsVariant::setInteger ( kvs_int_t  iInteger)

Sets the variant data as integer.

Parameters
iIntegerThe value to set
Returns
void

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 ( )
void KviKvsVariant::setReal ( kvs_real_t  dReal)
void KviKvsVariant::setReal ( kvs_real_t pReal)

Sets the variant data as double floating point.

Parameters
pRealThe value to set
Returns
void

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.

Parameters
szStringThe value to set
Returns
void

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.

Parameters
pszStringThe value to set
Returns
void

References KviKvsVariantData::m_eType, m_pData, KviKvsVariantData::m_u, KviKvsVariantData::DataType::pString, RENEW_VARIANT_DATA, and KviKvsVariantData::String.

const QString& KviKvsVariant::string ( ) const
inline

Returns the string contained in the variant data.

Returns
const QString &

References KviQString::Empty.

Referenced by KviKvsParameterProcessor::handleParameterTypeError().

void KviKvsVariant::takeFrom ( KviKvsVariant pVariant)

Copies a variant from another and destroys the second one.

Parameters
pVariantThe variant to take from
Returns
void

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.

Parameters
variantThe variant to take from
Returns
void

References DETACH_CONTENTS, and m_pData.

KviKvsVariantData::Type KviKvsVariant::type ( )
inline
KviKvsVariant * KviKvsVariant::unserialize ( const QString &  szBuffer)
static

Unserializes the variant data using the JSON format.

Parameters
szBufferThe buffer where is stored the serialization
Returns
KviKvsVariant *

Referenced by KviKvsCoreFunctions::KVSCF(), KVSO_CLASS_FUNCTION(), unserializeArray(), and unserializeHash().

KviKvsVariant * KviKvsVariant::unserialize ( const QChar **  ppAux)
staticprivate

Unserializes the variant data using the JSON format.

Parameters
ppAuxThe pointer where the serialization is located
Returns
KviKvsVariant *

References unserializeArray(), unserializeBool(), unserializeHash(), unserializeNull(), unserializeNumber(), and unserializeString().

KviKvsVariant * KviKvsVariant::unserializeArray ( const QChar **  ppAux)
staticprivate

Unserializes an array into a variant data using the JSON format.

Parameters
ppAuxThe pointer where the serialization is located
Returns
KviKvsVariant *

References i, KviKvsVariant(), pArray, KviKvsArray::set(), and unserialize().

Referenced by unserialize().

KviKvsVariant * KviKvsVariant::unserializeBool ( const QChar **  ppAux,
bool  bBool 
)
staticprivate

Unserializes a boolean into a variant data using the JSON format.

Parameters
ppAuxThe pointer where the serialization is located
bBoolWhether the variant is true or false
Returns
KviKvsVariant *

References KviQString::equalCIN(), and KviKvsVariant().

Referenced by unserialize().

KviKvsVariant * KviKvsVariant::unserializeHash ( const QChar **  ppAux)
staticprivate

Unserializes a hash into a variant data using the JSON format.

Parameters
ppAuxThe pointer where the serialization is located
Returns
KviKvsVariant *

References i, KviKvsVariant(), KviKvsHash::set(), unserialize(), and unserializeString().

Referenced by unserialize().

KviKvsVariant * KviKvsVariant::unserializeInteger ( const QChar **  ppAux,
QString &  szData 
)
staticprivate

Unserializes an integer into a variant data using the JSON format.

Parameters
ppAuxThe pointer where the serialization is located
szDataThe buffer where the serialization is stored
Returns
KviKvsVariant *

References KviKvsVariant().

Referenced by unserializeNumber().

KviKvsVariant * KviKvsVariant::unserializeNull ( const QChar **  ppAux)
staticprivate

Unserializes null into a variant data using the JSON format.

Parameters
ppAuxThe pointer where the serialization is located
Returns
KviKvsVariant *

References KviQString::equalCIN(), and KviKvsVariant().

Referenced by unserialize().

KviKvsVariant * KviKvsVariant::unserializeNumber ( const QChar **  ppAux)
staticprivate

Unserializes a number into a variant data using the JSON format.

Parameters
ppAuxThe pointer where the serialization is located
Returns
KviKvsVariant *

References unserializeInteger(), and unserializeReal().

Referenced by unserialize().

KviKvsVariant * KviKvsVariant::unserializeReal ( const QChar **  ppAux,
QString &  szData 
)
staticprivate

Unserializes a double floating point into a variant data using the JSON format.

Parameters
ppAuxThe pointer where the serialization is located
szDataThe buffer where the serialization is stored
Returns
KviKvsVariant *

References KviKvsVariant().

Referenced by unserializeNumber().

void KviKvsVariant::unserializeString ( const QChar **  ppAux,
QString &  szBuffer 
)
staticprivate

Unserializes a string into a variant data using the JSON format.

Parameters
ppAuxThe pointer where the serialization is located
szBufferThe buffer to store the unserialization
Returns
void

References i.

Referenced by unserialize(), unserializeHash(), and unserializeString().

KviKvsVariant * KviKvsVariant::unserializeString ( const QChar **  ppAux)
staticprivate

Unserializes a string into a variant data using the JSON format.

Parameters
ppAuxThe pointer where the serialization is located
Returns
KviKvsVariant *

References KviKvsVariant(), szBuffer, and unserializeString().

Friends And Related Function Documentation

friend class KviKvsVariantComparison
friend

Member Data Documentation

KviKvsVariantData* KviKvsVariant::m_pData
protected

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