![]() |
Gray C++ Libraries
0.0.2
A set of C++ libraries for MSVC, GNU on Windows, WinCE, Linux
|
#include <cVariantData.h>
Public Member Functions | |
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 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... | |
Public Attributes | |
union { | |
} | m_u |
Static Public Attributes | |
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... | |
Friends | |
class | cVariantArrayT |
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... | |
The 'value' (or data) portion of the variant. union of all supported data types. VARTYPE_TYPE MUST be known and ASSUMED to use this directly. _WIN32 max inline data size = 12 bytes = 3 * sizeof(UINT) like tagVARIANT = COM sizeof(VARIANT) = 16 bytes (_WIN32)
|
static |
With 2 pointers assumed to point at variants data. used with Blob, get_DataPtr(), get_DataSize() NOT the same as serialize. Dangerous. mostly used for cStructElem. (with some exceptions)
|
protected |
VARTYPE_Array
|
protected |
VARTYPE_Array
|
protected |
VARTYPE_ArrayT
|
protected |
VARTYPE_ArrayT
|
protected |
VARTYPE_Atom
|
protected |
VARTYPE_Atom
|
protected |
VARTYPE_GUID VARTYPE_Blob
|
protected |
VARTYPE_GUID VARTYPE_Blob
|
protected |
VARTYPE_Map
|
protected |
VARTYPE_StringExp VARTYPE_String
|
protected |
VARTYPE_StringExp VARTYPE_String
|
protected |
VARTYPE_StringW
|
protected |
VARTYPE_StringW
|
protected |
VARTYPE_XObj
|
protected |
Destroy the contents.
cVariantArray & GrayLib::cVariantData::dref_Array | ( | ) | const |
ASSUME VARTYPE_Array:
cVariantArrayT & GrayLib::cVariantData::dref_ArrayT | ( | ) | const |
ASSUME VARTYPE_ArrayT:
const cAtomRef & GrayLib::cVariantData::dref_Atom | ( | ) | const |
ASSUME VARTYPE_Atom
cHeapBlock & GrayLib::cVariantData::dref_Blob | ( | ) | const |
ASSUME VARTYPE_Blob, VARTYPE_GUID
cVariantMapPtr & GrayLib::cVariantData::dref_Map | ( | ) | const |
ASSUME VARTYPE_Map
const cStringA & GrayLib::cVariantData::dref_String | ( | ) | const |
ASSUME VARTYPE_StringExp VARTYPE_String:
const cStringW & GrayLib::cVariantData::dref_StringW | ( | ) | const |
ASSUME VARTYPE_StringW:
CIXObjPtr & GrayLib::cVariantData::dref_XObj | ( | ) | const |
ASSUME VARTYPE_XObj
|
protected |
Get a raw generic pointer to data. NOT always the same as &m_u if CTYPE_FLAG_Alloc type. used with GetDataSize, Blob, get_DataSize(), CompareDataPtr() NOT the same as serialize.
|
protected |
Get size of the actual data. (Not ref if CTYPE_FLAG_Alloc) used with GetDataPtr, Blob, get_DataPtr(), CompareDataPtr() NOT the same as serialize size. Like GetHeapStats ?
|
protected |
|
protected |
VARTYPE_Array Convert the array to a string (comma separated values). assume symmetrical re-parse as array.
|
protected |
VARTYPE_ArrayT Convert the array to a string (comma separated values). assume symmetrical re-parse as array.
|
protected |
VARTYPE_Blob, VARTYPE_GUID Get an encoded string for binary blob data. Just a VARTYPE_StringExp
|
protected |
VARTYPE_CY into a string
|
protected |
VARTYPE_CYS into a string
|
protected |
VARTYPE_HResult Describe the HRESULT error code.
|
protected |
Make the value (or best representation we can make of it) into the string. GetStrExpUnk result is VARTYPE_StringExp that may be used with put_StrExpUnk() etc. Quote strings if it seems reasonable.
|
inlinestaticnoexcept |
Get the cVariantTypeDef metadata for the VARTYPE_TYPE.
|
protected |
Copy from another cVariantData.
|
protected |
Set a zero value of a specific VARTYPE_TYPE. Compliment of isZeroVar()
|
protected |
Not isNoType() but nearly the same. i.e. empty string or array. Null but it has Type info. nothing of any real value here?
|
static |
Can the 2 types be interchanged in general. ignore overflow/range issues. Numbers, strings, times
|
inlinestaticnoexcept |
|
protected |
All EmptyVar(s) are also ZeroVar(s) but not all zero is empty. Opposite of SetZeroVar();
HRESULT GrayLib::cVariantData::SerializeInputType | ( | cStreamInput & | file, |
VARTYPE_TYPE | eVarType | ||
) |
Read data from a known/assumed VARTYPE_TYPE eVarType. ASSUME: any previous contents are already freed.
HRESULT GrayLib::cVariantData::SerializeOutputType | ( | cStreamOutput & | file, |
VARTYPE_TYPE | eVarType | ||
) | const |
write out (binary format) just the data (m_u) and assume we already know the VARTYPE_TYPE. must match get_DataSize()
|
friend |
|
static |
type metadata.
union { ... } GrayLib::cVariantData::m_u |
|
static |
show unsigned as hex when converting to string. default=true
For looking up UID as XObject. GRAYLIB_LINK cXObjMgr::isSingleCreated()
|
static |
For cVariant UID to XObject conversion.