KVIrc  4.9.2
DeveloperAPIs
Macros
KviKvsVariant.cpp File Reference
#include "KviKvsVariant.h"
#include "KviKvsArrayCast.h"
#include "KviKvsHash.h"
#include "KviKvsArray.h"
#include <math.h>
#include <cinttypes>

Macros

#define CMP_EQUAL   0
 
#define CMP_OTHERGREATER   1
 
#define CMP_THISGREATER   -1
 
#define DELETE_VARIANT_CONTENTS
 
#define DETACH_CONTENTS
 
#define RENEW_VARIANT_DATA
 

Macro Definition Documentation

#define CMP_EQUAL   0

Referenced by KviKvsVariant::compare().

#define CMP_OTHERGREATER   1

Referenced by KviKvsVariant::compare().

#define CMP_THISGREATER   -1

Referenced by KviKvsVariant::compare().

#define DELETE_VARIANT_CONTENTS
Value:
switch(m_pData->m_eType) \
{ \
delete m_pData->m_u.pArray; \
break; \
delete m_pData->m_u.pHash; \
break; \
delete m_pData->m_u.pString; \
break; \
delete m_pData->m_u.pReal; \
break; \
default: /* make gcc happy */ \
break; \
}
Definition: KviKvsVariant.h:126
Definition: KviKvsVariant.h:124
Definition: KviKvsVariant.h:128
Definition: KviKvsVariant.h:127
case
Definition: KviKvsParser.cpp:3130

Referenced by KviKvsVariant::setNothing().

#define DETACH_CONTENTS
Value:
if(m_pData) \
{ \
if(m_pData->m_uRefs <= 1) \
{ \
DELETE_VARIANT_CONTENTS \
delete m_pData; \
} \
else \
{ \
m_pData->m_uRefs--; \
} \
}
if(m_pFile) delete m_pFile

Referenced by KviKvsVariant::copyFrom(), KviKvsVariant::takeFrom(), and KviKvsVariant::~KviKvsVariant().

#define RENEW_VARIANT_DATA
Value:
if(m_pData) \
{ \
if(m_pData->m_uRefs > 1) \
{ \
m_pData->m_uRefs--; \
m_pData = new KviKvsVariantData; \
m_pData->m_uRefs = 1; \
} \
else \
{ \
} \
} \
else \
{ \
m_pData = new KviKvsVariantData; \
m_pData->m_uRefs = 1; \
}
The class which holds the type of the variant data.
Definition: KviKvsVariant.h:114
unsigned int m_uRefs
Definition: KviKvsVariant.h:149
if(m_pFile) delete m_pFile
#define DELETE_VARIANT_CONTENTS
Definition: KviKvsVariant.cpp:339

Referenced by KviKvsVariant::setArray(), KviKvsVariant::setBoolean(), KviKvsVariant::setHash(), KviKvsVariant::setHObject(), KviKvsVariant::setInteger(), KviKvsVariant::setReal(), and KviKvsVariant::setString().