![]() |
Gray C++ Libraries
0.0.2
A set of C++ libraries for MSVC, GNU on Windows, WinCE, Linux
|
#include <cVariant.h>
Public Member Functions | |
cVariant () noexcept | |
cVariant (const ATOMCHAR_t **ppArrayArgs, ITERATE_t iArgQty) | |
cVariant (const cVariantArray &aVals) | |
cVariant (const cVariantArrayT &aVals) | |
cVariant (const cAtomRef &atomVal) | |
cVariant (const cStringA &strAVal) | |
cVariant (const cStringW &strWVal) | |
cVariant (const char *pszVal) | |
cVariant (const wchar_t *pwsVal) | |
store as cString. More... | |
cVariant (const cTimeInt &timei) | |
BSTR. More... | |
cVariant (const cTimeDouble &timed) | |
cVariant (const GUID &guid) | |
cVariant (const cVarMap &rMap) | |
cVariant (cVariantMap *pMap) | |
cVariant (IXObject *pXObj) | |
cVariant (VARTYPE_TYPE eVarType, UINT32 uVal) | |
cVariant (VARTYPE_TYPE eVarType, UINT64 uVal) | |
cVariant (VARTYPE_TYPE eVarType, const void *pvData, size_t nLen=0) | |
cVariant (const THIS_t &vVal) | |
cVariant (THIS_t &&ref) noexcept | |
~cVariant () | |
size_t | GetHeapStats (OUT ITERATE_t &iAllocCount) const |
VARTYPE_TYPE | get_VarType () const noexcept |
const cVariantTypeDef & | get_VarTypeDef () const noexcept |
bool | isNoType () const noexcept |
bool | isVarTypeNumeric () const noexcept |
bool | isVarTypeFloat () const noexcept |
bool | isVarTypeString () const noexcept |
bool | isNumSigned () const noexcept |
bool | isStringA () const noexcept |
UTF8 format string. char*. More... | |
bool | isStringW () const noexcept |
UNICODE format string. wchar_t*. More... | |
bool | isTime () const noexcept |
a time stamp? More... | |
bool | isArray () const noexcept |
bool | isStringExp () const noexcept |
bool | isXObj () const noexcept |
bool | isHResult () const noexcept |
size_t | get_DataSize () const |
const void * | get_DataPtr () const |
COMPARE_t | Compare (const cVariant &vVar) const |
bool | IsEqualTo (const THIS_t &vVar) const |
bool | operator== (const THIS_t &vVar) const |
bool | operator!= (const THIS_t &vVar) const |
bool | isHResultError () const |
bool | isEmptyVar () const |
bool | isZeroVar () const |
Not exactly VARTYPE_NoType but nearly the same. i.e. empty string or array. More... | |
void | SetZeroVar (VARTYPE_TYPE eVarType=VARTYPE_NoType) |
All isEmptyVar(s) are also isZeroVar(s) More... | |
void | SetNoType () |
empty example of the type. More... | |
void | SetClear () |
void | put_Var (const cVariant &vVar) |
void | SetVarData (VARTYPE_TYPE eVarType, const void *pData, size_t iLen) |
bool | SetVarType (VARTYPE_TYPE eVarType, const cVariant &vVal) |
const char * | get_StrCA () const |
void | put_StrCA (const char *x) |
const wchar_t * | get_StrCW () const |
constant string. DANGEROUS?! (string must persist) More... | |
void | put_StrCW (const wchar_t *x) |
const GChar_t * | get_StrC () const |
constant string. DANGEROUS?! (string must persist) More... | |
void | put_StrC (const GChar_t *x) |
cAtomRef | get_Atom () const |
void | put_Atom (cAtomRef x) |
cString | get_Str () const |
void | put_Str (cString x) |
cStringA | get_StrA () const |
void | put_StrA (cStringA x) |
cStringW | get_StrW () const |
void | put_StrW (cStringW x) |
cStringA | get_StrExp () const |
void | put_StrExp (cStringA x) |
double | get_TimeDouble () const |
void | put_TimeDouble (double x) |
TIMESEC_t | get_TimeInt () const |
void | put_TimeInt (TIMESEC_t x) |
CYS_t | get_CYS () const |
void | put_CYS (CYS_t x) |
CY_t | get_CY () const |
void | put_CY (CY_t x) |
UID_t | get_UID () const |
void | put_UID (UID_t x) |
HRESULT | get_HResult () const |
void | put_HResult (HRESULT x) |
COLORREF | get_Color () const |
void | put_Color (COLORREF x) |
cVariantVector3< float > | get_Vector3 () const |
void | put_Vector3 (const float *x) |
void | put_Int (int nVal) |
int | get_Int () const |
template<typename _TYPE_CH > | |
cStringT< _TYPE_CH > | get_StrT () const |
void | put_UID (const IXObject *pXObj) |
void | put_Array (const cVariantArray &aVars) |
void | put_ArrayT (const cVariantArrayT &aVals) |
void | put_Vector3 (float x, float y, float z) |
IXObject * | get_XObj () const |
void | put_XObj (IXObject *pXObj) |
void | SetTimeIntNow () |
void | SetTimeDoubleNow () |
void | StrExpIgnore () |
Convert VARTYPE_StringExp to VARTYPE_String. More... | |
void | SetVarTypeSimplest (bool bKeepFloat) |
HRESULT | put_StrExpUnk (const ATOMCHAR_t *pStrExp) |
partially parse an expression string. (if simple types) More... | |
HRESULT | put_StrExpEval (const ATOMCHAR_t *pStrExp) |
cVariant | get_VarExpEval () const |
StrLen_t | GetStrExpUnk (ATOMCHAR_t *pszStr, StrLen_t iLenMax, bool bInArray=false) const |
CY_t | GetCY (bool bAssumeNaked=false, CY_t uValMul=k_CYMul) const |
void | SetBlobData (const void *pData, size_t nSize, VARTYPE_TYPE eVarType=VARTYPE_Blob) |
void | put_Blob (const cHeapBlock &b, VARTYPE_TYPE eVarType=VARTYPE_Blob) |
size_t | GetBlobData (void *pData, size_t nSizeMax) const |
size_t | SetBlobStr (VARTYPE_TYPE eVarType, const ATOMCHAR_t *pszStr) |
cHeapBlock & | MakeRefBlob (VARTYPE_TYPE eVarType) |
operator const char * () const | |
const THIS_t & | operator= (const char *x) |
operator const wchar_t * () const | |
const THIS_t & | operator= (const wchar_t *x) |
operator cStringA () const | |
const THIS_t & | operator= (const cStringA &x) |
operator cStringW () const | |
const THIS_t & | operator= (const cStringW &x) |
const THIS_t & | operator= (const THIS_t &vVal) |
void | SetMove (THIS_t &ref) |
THIS_t & | operator= (THIS_t &&ref) |
void | put_Map (cVariantMap *pMap) |
Map helpers. More... | |
const cVariant & | GetMapVar (const ATOMCHAR_t *pszName) const |
cVariantMapPtr | MakeMap () |
cVariant & | MakeMapVar (const ATOMCHAR_t *pszName) |
HRESULT | SetMapVar (const ATOMCHAR_t *pszName, const cVariant &vSet) |
const THIS_t & | operator[] (const ATOMCHAR_t *pszName) const |
THIS_t & | operator[] (const ATOMCHAR_t *pszName) |
ITERATE_t | get_ArraySize () const |
Array helpers. Use of these indicates it should be converted to an array! More... | |
ITERATE_t | MakeArraySize (bool bBreakQuotes=false) |
Parse also ! More... | |
THIS_t & | MakeArrayElement (ITERATE_t index=k_ITERATE_BAD) |
cVariantArray & | MakeArray () |
bool | IsArrayChild (const cVariant &vVal) const |
ITERATE_t | SetArray (const ATOMCHAR_t **ppArgs, ITERATE_t iArgQty, ITERATE_t nQtyAppend=0) |
ITERATE_t | SetArrayParse (const ATOMCHAR_t *pszStr) |
void | RemoveArrayElement (ITERATE_t index, ITERATE_t iQty=1) |
bool | InsertArrayElement (ITERATE_t index, const cVariant &vVal) |
double | get_ArrayRangeDouble () const |
ITERATE_t | AppendArray (cVariant &vValArray) |
Append a variant array to the array. More... | |
const THIS_t & | GetArrayElement (ITERATE_t index) const |
const THIS_t & | operator[] (ITERATE_t index) const |
bool | SetArrayElement (ITERATE_t index, const cVariant &vVal) |
void | AddArrayElement (const THIS_t &vVal) |
THIS_t & | operator[] (ITERATE_t index) |
void | SetArrayStrCA (ITERATE_t index, const char *Val) |
void | AddArrayStrCA (const char *Val) |
void | SetArrayStrCW (ITERATE_t index, const wchar_t *Val) |
void | AddArrayStrCW (const wchar_t *Val) |
void | SetArrayStrC (ITERATE_t index, const GChar_t *Val) |
void | AddArrayStrC (const GChar_t *Val) |
void | SetArrayAtom (ITERATE_t index, cAtomRef Val) |
void | AddArrayAtom (cAtomRef Val) |
void | SetArrayStr (ITERATE_t index, cString Val) |
void | AddArrayStr (cString Val) |
void | SetArrayStrA (ITERATE_t index, cStringA Val) |
void | AddArrayStrA (cStringA Val) |
void | SetArrayStrW (ITERATE_t index, cStringW Val) |
void | AddArrayStrW (cStringW Val) |
void | SetArrayStrExp (ITERATE_t index, cStringA Val) |
void | AddArrayStrExp (cStringA Val) |
void | SetArrayUID (ITERATE_t index, UID_t Val) |
void | AddArrayUID (UID_t Val) |
void | SetArrayTimeInt (ITERATE_t index, TIMESEC_t Val) |
void | AddArrayTimeInt (TIMESEC_t Val) |
void | SetArrayVector3 (ITERATE_t index, const float *Val) |
void | AddArrayVector3 (const float *Val) |
void | SetArrayInt (ITERATE_t index, int Val) |
void | AddArrayInt (int Val) |
void | SetArrayXObj (ITERATE_t index, IXObject *Val) |
void | AddArrayXObj (IXObject *Val) |
void | AddArrayUID (const IXObject *pObj) |
HRESULT | SerializeOutput (cStreamOutput &file) const |
Serialize out/in to a byte stream. More... | |
HRESULT | SerializeInputType (cStreamInput &file, VARTYPE_TYPE eVarType) |
HRESULT | SerializeInput (cStreamInput &file) |
HRESULT | Serialize (cArchive &a) |
UNITTEST_FRIEND (cVariant) | |
template<> | |
cStringT< char > | get_StrT () const |
template<> | |
cStringT< wchar_t > | get_StrT () const |
![]() | |
cVariantArray & | dref_Array () const |
cVariantArrayT & | dref_ArrayT () const |
const cAtomRef & | dref_Atom () const |
const cStringA & | dref_String () const |
const cStringW & | dref_StringW () const |
cHeapBlock & | dref_Blob () const |
cVariantMapPtr & | dref_Map () const |
CIXObjPtr & | dref_XObj () const |
HRESULT | SerializeOutputType (cStreamOutput &file, VARTYPE_TYPE eVarType) const |
HRESULT | SerializeInputType (cStreamInput &file, VARTYPE_TYPE eVarType) |
Static Public Member Functions | |
static bool GRAYCALL | v_Var2Strings (cArrayStringA &a, cVariant &vVal) |
static void GRAYCALL | v_Strings2Var (cVariant &vVal, const cArrayStringA &a) |
![]() | |
static const cVariantTypeDef & | GetVarTypeDef (VARTYPE_TYPE eVarType) noexcept |
static bool GRAYCALL | IsVarTypeCompatible (VARTYPE_TYPE eVarType1, VARTYPE_TYPE eVarType2) |
static COMPARE_t GRAYCALL | CompareDataPtr (VARTYPE_TYPE eVarType, const void *pData1, const void *pData2) |
static bool | IsXObj (VARTYPE_TYPE eVarType) noexcept |
![]() | |
static StrLen_t GRAYCALL | CopyLenQ (ATOMCHAR_t *pszDst, const ATOMCHAR_t *pszSrc, StrLen_t iLenMax, STR_BLOCK_TYPE eBlock) |
When converting to string. More... | |
Static Public Attributes | |
static const cVariant | k_VarNULL |
VARTYPE_NoType isNoType() More... | |
![]() | |
static const cVariantTypeDef | k_VarTypeDef [VARTYPE_QTY] |
type metadata. More... | |
static IXObjMgr * | sm_pIXObjMgr = nullptr |
For cVariant UID to XObject conversion. More... | |
static bool | sm_bShowUnsignedAsHex = true |
show unsigned as hex when converting to string. default=true More... | |
![]() | |
static const ITERATE_t | k_MaxElements = 64*1024 |
(arbitrary) Max elements that may be parsed in array or map. More... | |
static const ITERATE_t | k_MaxElements2 = 256 |
arbitrary max for simple things. More... | |
static const CYS_t | k_CYSMul = 100 |
2 fixed places = cents. CYS_t More... | |
static const CY_t | k_CYMul = 10000 |
4 fixed places = hundredths of a cent. CY_t More... | |
Protected Member Functions | |
void | InitVar (const cVariant &vVar) |
void | InitVar (VARTYPE_TYPE eVarType, const void *pStr, size_t iLen) |
void | EmptyLast () |
const cStringA & | ref_StrA () const |
![]() | |
void | DestructData (VARTYPE_TYPE eVarType) |
void | construct_Array (ITERATE_t iSize) |
void | construct_Array (const cVariantArray &a) |
void | construct_ArrayT (ITERATE_t iSize, VARTYPE_TYPE eVarTypeElem) |
void | construct_ArrayT (const cVariantArrayT &a) |
void | construct_Atom (const cAtomRef &a) |
void | construct_Atom (const ATOMCHAR_t *p) |
void | construct_String (const cStringA &s) |
void | construct_String (const char *pszVal) |
void | construct_StringW (const cStringW &s) |
void | construct_StringW (const wchar_t *pwVal) |
void | construct_Blob (const void *pData, size_t nSize) |
void | construct_Blob (const cHeapBlock &b) |
void | construct_Map (cVariantMap *p) |
void | construct_XObj (IXObject *p) |
size_t | GetDataSize (VARTYPE_TYPE eVarType) const |
const void * | GetDataPtr (VARTYPE_TYPE eVarType) const |
size_t | GetHeapStats (VARTYPE_TYPE eVarType, OUT ITERATE_t &iAllocCount) const |
bool | IsEmptyVar (VARTYPE_TYPE eVarType) const |
bool | IsZeroVar (VARTYPE_TYPE eVarType) const |
void | InitZeroVar (VARTYPE_TYPE eVarType) |
void | InitVar (VARTYPE_TYPE eVarType, const cVariantData &vVal) |
StrLen_t | GetStr_Array (ATOMCHAR_t *pszStr, StrLen_t iLenMax) const |
StrLen_t | GetStr_ArrayT (ATOMCHAR_t *pszStr, StrLen_t iLenMax) const |
StrLen_t | GetStr_CY (ATOMCHAR_t *pszStr, StrLen_t iLenMax) const |
StrLen_t | GetStr_CYS (ATOMCHAR_t *pszStr, StrLen_t iLenMax) const |
StrLen_t | GetStr_Blob (ATOMCHAR_t *pszStr, StrLen_t nLenMax) const |
StrLen_t | GetStr_HResult (ATOMCHAR_t *pszStr, StrLen_t iLenMax, bool bQuote=true) const |
StrLen_t | GetStrExpT (VARTYPE_TYPE eVarType, ATOMCHAR_t *pszStr, StrLen_t iLenMax, bool bInArray=true) const |
Protected Attributes | |
VARTYPE_TYPE | m_eVarType |
type for cVariantData. VT_NULL or VARTYPE (for COM). really held in a single BYTE More... | |
Additional Inherited Members | |
![]() | |
typedef INT32 | CYS_t |
type for 2 fixed point int for currency/money. More... | |
typedef INT64 | CY_t |
type for 4 fixed point int for currency/money. More... | |
![]() | |
union { | |
} | m_u |
Holds a value of various/any type. morph-able type. ASSUME always convertible to/from a string. similar to: the MFC/ATL/COM VARIANT type. CComVariant or _variant_t for ATL. based on VARIANT COleVariant for MFC, CDBVariant for ODBC, var in c# or JavaScript.
|
inlinenoexcept |
GrayLib::cVariant::cVariant | ( | const ATOMCHAR_t ** | ppArrayArgs, |
ITERATE_t | iArgQty | ||
) |
input array of strings.
GrayLib::cVariant::cVariant | ( | const cVariantArray & | aVals | ) |
GrayLib::cVariant::cVariant | ( | const cVariantArrayT & | aVals | ) |
GrayLib::cVariant::cVariant | ( | const cAtomRef & | atomVal | ) |
VARTYPE_Atom
GrayLib::cVariant::cVariant | ( | const cStringA & | strAVal | ) |
VARTYPE_String
GrayLib::cVariant::cVariant | ( | const cStringW & | strWVal | ) |
VARTYPE_StringW
GrayLib::cVariant::cVariant | ( | const char * | pszVal | ) |
VARTYPE_String UTF8
GrayLib::cVariant::cVariant | ( | const wchar_t * | pwsVal | ) |
store as cString.
VARTYPE_StringW
GrayLib::cVariant::cVariant | ( | const cTimeInt & | timei | ) |
BSTR.
GrayLib::cVariant::cVariant | ( | const cTimeDouble & | timed | ) |
GrayLib::cVariant::cVariant | ( | const GUID & | guid | ) |
GrayLib::cVariant::cVariant | ( | const cVarMap & | rMap | ) |
GrayLib::cVariant::cVariant | ( | cVariantMap * | pMap | ) |
GrayLib::cVariant::cVariant | ( | IXObject * | pXObj | ) |
|
inline |
Assign specific/special types with a static value. VARTYPE_UID, VARTYPE_Color, VARTYPE_HResult, VARTYPE_CYS
|
inline |
Assign specific/special types with a static value. ASSERT( eVarType == VARTYPE_TimeInt || eVarType == VARTYPE_CY );
|
inline |
Assign specific/special types with a pointer. ASSERT( eVarType == VARTYPE_Blob || eVarType == VARTYPE_GUID || isStaticSize());
|
inline |
|
inlinenoexcept |
move constructor
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Append a variant array to the array.
|
protected |
Destroy contents, but Don't bother clearing m_eVarType
double GrayLib::cVariant::get_ArrayRangeDouble | ( | ) | const |
This is a weird case. move out of here ??? Get a random value in a range. or set of weighted ranges. Numbers in { ... }
ITERATE_t GrayLib::cVariant::get_ArraySize | ( | ) | const |
Array helpers. Use of these indicates it should be converted to an array!
cAtomRef GrayLib::cVariant::get_Atom | ( | ) | const |
get atom.
COLORREF GrayLib::cVariant::get_Color | ( | ) | const |
cVariant::CY_t GrayLib::cVariant::get_CY | ( | ) | const |
cVariant::CYS_t GrayLib::cVariant::get_CYS | ( | ) | const |
const void * GrayLib::cVariant::get_DataPtr | ( | ) | const |
Get a raw generic pointer to data. NOT always the same as &m_u. if CTYPE_FLAG_Alloc type. used with Blob, get_DataSize(), CompareDataPtr() NOT the same as serialize.
size_t GrayLib::cVariant::get_DataSize | ( | ) | const |
Get size of the actual data. (Not ref if CTYPE_FLAG_Alloc) used with Blob, get_DataPtr(), CompareDataPtr() NOT the same as serialize.
HRESULT GrayLib::cVariant::get_HResult | ( | ) | const |
VARTYPE_HResult
|
inline |
cString GrayLib::cVariant::get_Str | ( | ) | const |
cStringA GrayLib::cVariant::get_StrA | ( | ) | const |
Get a raw string. for display. not necessarily parsable with put_StrExpUnk() Similar to get_StrCA() Non quoted.
const GChar_t * GrayLib::cVariant::get_StrC | ( | ) | const |
constant string. DANGEROUS?! (string must persist)
const char * GrayLib::cVariant::get_StrCA | ( | ) | const |
Similar to get_StrA()
const wchar_t * GrayLib::cVariant::get_StrCW | ( | ) | const |
constant string. DANGEROUS?! (string must persist)
cStringA GrayLib::cVariant::get_StrExp | ( | ) | const |
Get a string that will get parsed with put_StrExpUnk() or put_StrExpEval(). Is properly escaped. may have quotes commands, etc.
|
inline |
|
inline |
|
inline |
cStringW GrayLib::cVariant::get_StrW | ( | ) | const |
Non quoted.
double GrayLib::cVariant::get_TimeDouble | ( | ) | const |
VARTYPE_TimeDouble cTimeDouble number of days since Y date.
TIMESEC_t GrayLib::cVariant::get_TimeInt | ( | ) | const |
VARTYPE_TimeInt Number of seconds from X date. cTimeInt
UID_t GrayLib::cVariant::get_UID | ( | ) | const |
cVariant GrayLib::cVariant::get_VarExpEval | ( | ) | const |
|
inlinenoexcept |
|
inlinenoexcept |
cVariantVector3< float > GrayLib::cVariant::get_Vector3 | ( | ) | const |
VARTYPE_Vector3 an array of 3 floats. but not dynamically allocated.
IXObject * GrayLib::cVariant::get_XObj | ( | ) | const |
do not change the variant. Just get a copy
size_t GrayLib::cVariant::GetBlobData | ( | void * | pData, |
size_t | nSizeMax | ||
) | const |
Get the data for a memory blob.
cVariant::CY_t GrayLib::cVariant::GetCY | ( | bool | bAssumeNaked = false , |
CY_t | uValMul = k_CYMul |
||
) | const |
VARTYPE_CY, VARTYPE_CYS Get currency/money value. uValMul = k_CYMul bAssumeNaked = If converting from a string and no decimal point is present. true = assume string is total number of tenths.
size_t GrayLib::cVariant::GetHeapStats | ( | OUT ITERATE_t & | iAllocCount | ) | const |
const cVariant & GrayLib::cVariant::GetMapVar | ( | const ATOMCHAR_t * | pszName | ) | const |
|
inline |
Quote strings if it seems reasonable.
|
protected |
Copy from another cVariant. don't bother freeing previous contents of *this
|
protected |
Set the new variant with data of get_DataPtr() form. don't bother freeing previous contents. assume un-init values.
insert element into array.
|
inlinenoexcept |
Is this an array of something?
bool GrayLib::cVariant::IsArrayChild | ( | const cVariant & | vVal | ) | const |
Is vVal one of my children?
bool GrayLib::cVariant::isEmptyVar | ( | ) | const |
Not isNoType() but nearly the same. i.e. empty string or array. Null but it has Type info. nothing of any real value here?
|
inline |
|
inlinenoexcept |
an HResult error code type result? may be success code.
|
inline |
|
inlinenoexcept |
no value was set ?
|
inlinenoexcept |
|
inlinenoexcept |
UTF8 format string. char*.
|
inlinenoexcept |
Is this string some sort of unparsed expression.
|
inlinenoexcept |
UNICODE format string. wchar_t*.
|
inlinenoexcept |
a time stamp?
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
bool GrayLib::cVariant::isZeroVar | ( | ) | const |
Not exactly VARTYPE_NoType but nearly the same. i.e. empty string or array.
All EmptyVar(s) are also ZeroVar(s) but not all zero is empty. Opposite of SetZeroVar();
cVariantArray & GrayLib::cVariant::MakeArray | ( | ) |
force to VARTYPE_Array. attempt to preserve current variant as part of the array.
Get an array element reference that i could modify. if it does not exist then create it.
ITERATE_t GrayLib::cVariant::MakeArraySize | ( | bool | bBreakQuotes = false | ) |
Parse also !
Try to convert existing data to array.
cVariantMapPtr GrayLib::cVariant::MakeMap | ( | ) |
cVariant & GrayLib::cVariant::MakeMapVar | ( | const ATOMCHAR_t * | pszName | ) |
cHeapBlock & GrayLib::cVariant::MakeRefBlob | ( | VARTYPE_TYPE | eVarType | ) |
VARTYPE_Blob, VARTYPE_GUID
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
void GrayLib::cVariant::put_Array | ( | const cVariantArray & | aVars | ) |
void GrayLib::cVariant::put_ArrayT | ( | const cVariantArrayT & | aVals | ) |
void GrayLib::cVariant::put_Atom | ( | cAtomRef | x | ) |
|
inline |
void GrayLib::cVariant::put_Color | ( | COLORREF | x | ) |
void GrayLib::cVariant::put_CY | ( | cVariant::CY_t | nVal | ) |
VARTYPE_CY Put currency/money value. k_CYMul
void GrayLib::cVariant::put_CYS | ( | cVariant::CYS_t | nVal | ) |
void GrayLib::cVariant::put_HResult | ( | HRESULT | x | ) |
VARTYPE_HResult
|
inline |
void GrayLib::cVariant::put_Map | ( | cVariantMap * | pMap | ) |
Map helpers.
void GrayLib::cVariant::put_Str | ( | cString | x | ) |
VARTYPE_String
void GrayLib::cVariant::put_StrA | ( | cStringA | x | ) |
Assume any escape sequence stuff in here is supposed to be here.
void GrayLib::cVariant::put_StrC | ( | const GChar_t * | x | ) |
void GrayLib::cVariant::put_StrCA | ( | const char * | x | ) |
If we know the string is in constant space or storage is secure. just store the pointer.
void GrayLib::cVariant::put_StrCW | ( | const wchar_t * | x | ) |
void GrayLib::cVariant::put_StrExp | ( | cStringA | x | ) |
A string expression that may be parsed/evaluated at some later time. VARTYPE_StringExp
HRESULT GrayLib::cVariant::put_StrExpEval | ( | const ATOMCHAR_t * | pStrExp | ) |
HRESULT GrayLib::cVariant::put_StrExpUnk | ( | const ATOMCHAR_t * | pStrExp | ) |
partially parse an expression string. (if simple types)
Do a partial interpretation of this unknown expression string. VARTYPE_StringExp Try to guess what its proper VarType is from string format. No maths/symbolics are evaluated.
void GrayLib::cVariant::put_StrW | ( | cStringW | x | ) |
Assume any escape sequence stuff in here is supposed to be here.
void GrayLib::cVariant::put_TimeDouble | ( | double | x | ) |
VARTYPE_TimeDouble
void GrayLib::cVariant::put_TimeInt | ( | TIMESEC_t | x | ) |
void GrayLib::cVariant::put_UID | ( | const IXObject * | pXObj | ) |
void GrayLib::cVariant::put_UID | ( | UID_t | x | ) |
void GrayLib::cVariant::put_Vector3 | ( | const float * | x | ) |
VARTYPE_Vector3 The same as an array of 3 floats.
void GrayLib::cVariant::put_Vector3 | ( | float | x, |
float | y, | ||
float | z | ||
) |
void GrayLib::cVariant::put_XObj | ( | IXObject * | pXObj | ) |
pVal usage count is incremented!
|
protected |
VARTYPE_StringExp,VARTYPE_String or VARTYPE_Atom
remove the N'th element of the array.
HRESULT GrayLib::cVariant::SerializeInput | ( | cStreamInput & | file | ) |
HRESULT GrayLib::cVariant::SerializeInputType | ( | cStreamInput & | file, |
VARTYPE_TYPE | eVarType | ||
) |
HRESULT GrayLib::cVariant::SerializeOutput | ( | cStreamOutput & | file | ) | const |
Serialize out/in to a byte stream.
prefix with the data type. it may not be known.
ITERATE_t GrayLib::cVariant::SetArray | ( | const ATOMCHAR_t ** | ppArgs, |
ITERATE_t | iArgQty, | ||
ITERATE_t | nQtyAppend = 0 |
||
) |
Parse an array of strings into a variant array. put_StrExpUnk
if it does not exist then create it !
|
inline |
ITERATE_t GrayLib::cVariant::SetArrayParse | ( | const ATOMCHAR_t * | pszStr | ) |
Parse a string for an Array
|
inline |
|
inline |
|
inline |
void GrayLib::cVariant::SetBlobData | ( | const void * | pData, |
size_t | nSize, | ||
VARTYPE_TYPE | eVarType = VARTYPE_Blob |
||
) |
size_t GrayLib::cVariant::SetBlobStr | ( | VARTYPE_TYPE | eVarType, |
const ATOMCHAR_t * | pszStr | ||
) |
VARTYPE_Blob Set a binary blob from encoded string. VARTYPE_StringExp
|
inline |
HRESULT GrayLib::cVariant::SetMapVar | ( | const ATOMCHAR_t * | pszName, |
const cVariant & | vSet | ||
) |
|
inline |
|
inline |
empty example of the type.
void GrayLib::cVariant::SetTimeDoubleNow | ( | ) |
set the time to be now.
void GrayLib::cVariant::SetTimeIntNow | ( | ) |
set the time to be now.
void GrayLib::cVariant::SetVarData | ( | VARTYPE_TYPE | eVarType, |
const void * | pData, | ||
size_t | iLen | ||
) |
Set blob like types of data. VARTYPE_Blob, VARTYPE_GUID or isStaticSized()
bool GrayLib::cVariant::SetVarType | ( | VARTYPE_TYPE | eVarType, |
const cVariant & | vVal | ||
) |
convert to a new variant type from the value of another variant. make sure its VARTYPE_TYPE is set/converted to eVarType
void GrayLib::cVariant::SetVarTypeSimplest | ( | bool | bKeepFloat | ) |
reduce VARTYPE_TYPE to a smallest that can hold the value accurately.
void GrayLib::cVariant::SetZeroVar | ( | VARTYPE_TYPE | eVarType = VARTYPE_NoType | ) |
All isEmptyVar(s) are also isZeroVar(s)
Set a zero value of a specific VARTYPE_TYPE. Not the same as NULL/NoType. (Not sure why anyone cares about the type really) Compliment of isZeroVar()
void GrayLib::cVariant::StrExpIgnore | ( | ) |
Convert VARTYPE_StringExp to VARTYPE_String.
Convert VARTYPE_StringExp to VARTYPE_String if it looks like an expression just make it a string. Evaluate it later or never.
GrayLib::cVariant::UNITTEST_FRIEND | ( | cVariant | ) |
|
static |
get cArrayStringA (array of strings) as a cVariant
|
static |
set cArrayStringA (array of strings) from a cVariant,
|
static |
VARTYPE_NoType isNoType()
|
protected |
type for cVariantData. VT_NULL or VARTYPE (for COM). really held in a single BYTE