2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41#ifndef GIMBAL_VARIANT_H
42#define GIMBAL_VARIANT_H
44#include "../../core/gimbal_typedefs.h"
45#include "../../core/gimbal_ctx.h"
46#include "../../strings/gimbal_string_ref.h"
48#include "../classes/gimbal_primitives.h"
49#include "../classes/gimbal_enum.h"
50#include "../classes/gimbal_flags.h"
51#include "../classes/gimbal_opaque.h"
52#include "../instances/gimbal_instance.h"
60#define GblVariant_construct( ...) GblVariant_construct_
(__VA_ARGS__)
62#define GblVariant_set(pVariant, ...) GblVariant_set_
(pVariant, __VA_ARGS__)
64#define GBL_SELF_TYPE GblVariant
72typedef GBL_RESULT (*GblVariantConverterFn)(
GBL_CSELF, GblVariant* pOther);
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
128
129
130
131
225
226
227
228
323
324
325
326
410
411
412
413
416 const GblVariant* pKey,
428 const GblVariant* pKey,
447
448
449
450
492
493
494
495
514
515
516
517
536#if !defined(GBL_DREAMCAST) && !defined(GBL_PSP)
537# define GBL_VARIANT_CONSTRUCT_GENERIC_PLATFORM_ENTRIES()
539# define GBL_VARIANT_CONSTRUCT_GENERIC_PLATFORM_ENTRIES()
540 (int, GblVariant_constructInt32),
544#define GBL_VARIANT_CONSTRUCT_TABLE (
547 (char, GblVariant_constructChar),
548 (uint8_t, GblVariant_constructUint8),
549 (uint16_t, GblVariant_constructUint16),
550 (int16_t, GblVariant_constructInt16),
551 (uint32_t, GblVariant_constructUint32),
553 (int32_t, GblVariant_constructInt32),
554 (uint64_t, GblVariant_constructUint64),
555 (int64_t, GblVariant_constructInt64),
556 (float, GblVariant_constructFloat),
557 (double, GblVariant_constructDouble),
558 (const char*, GblVariant_constructString),
559 (char*, GblVariant_constructString),
560 (GblStringView, GblVariant_constructStringView),
561 (void*, GblVariant_constructPointer),
562 (const void*, GblVariant_constructPointer),
563 (const GblVariant*, GblVariant_constructCopy),
564 (GblVariant*, GblVariant_constructCopy)
568#define GblVariant_construct_1(pVariant) GblVariant_constructNil(pVariant)
571#define GBL_VARIANT_SET_TABLE (
574 (char, GblVariant_setChar),
575 (uint8_t, GblVariant_setUint8),
576 (uint16_t, GblVariant_setUint16),
577 (int16_t, GblVariant_setInt16),
578 (uint32_t, GblVariant_setUint32),
579 (int32_t, GblVariant_setInt32),
580 (uint64_t, GblVariant_setUint64),
581 (int64_t, GblVariant_setInt64),
582 (float, GblVariant_setFloat),
583 (double, GblVariant_setDouble),
584 (char*, GblVariant_setString),
585 (const char*, GblVariant_setString),
586 (GblStringView, GblVariant_setStringView),
587 (const void*, GblVariant_setPointer),
588 (void*, GblVariant_setPointer),
589 (const GblVariant*, GblVariant_setCopy),
590 (GblVariant*, GblVariant_setCopy)
#define GBL_FORWARD_DECLARE_STRUCT(S)
#define GBL_VA_OVERLOAD_CALL(BASE, SUFFIXER,...)
#define GBL_TUPLE_FIRST(...)
#define GBL_VA_OVERLOAD_SUFFIXER_1_N(...)
#define GBL_META_GENERIC_MACRO_NO_DEFAULT
#define GBL_META_GENERIC_MACRO_GENERATE(traits, X)
#define GBL_INVALID_TYPE
GblType UUID of the invalid type.
uint32_t GblHash
Type representing a calculated numeric hash across the codebase.
uint32_t GblEnum
Standard-sized enum type, 32-bits across platforms.
uint32_t GblFlags
Standard-sized flags type, 32-bits across platforms.
void(* GblFnPtr)()
Type used for holding an untyped function pointer.
uint8_t GblBool
Basic boolean type, standardized to sizeof(char)
#define GBL_VARIANT_CONSTRUCT_GENERIC_PLATFORM_ENTRIES()
const char * GblVariant_typeName(const GblVariant *pSelf)
Retrives the GblType UUID of the value contained by the given variant.
#define GBL_VARIANT_INIT
Convience macro for GblVariant value initialization.
GblBool GblVariant_checkTypeCompatible(GblType type)
Checks whether the given value can be represented by a GblVariant (implements GblIVariant)
#define GblVariant_construct(...)
Convenience macro providing a generically-typed constructor method.
const char GblStringRef
Reference-counted, const char*-compatible string type.
Contains a single generic, dynamically typed value.
double GblVariant_toDouble(GblVariant *pSelf)
Convenience method that attempts to convert the variant's type to double and return its value.
GBL_RESULT GblVariant_constructObjectCopy(GblVariant *pSelf, GblObject *pObj)
Convenience wrapper for value copy constructing a variant from a GblObject, increasing its refCount.
GBL_RESULT GblVariant_setInstance(GblVariant *pSelf, GblInstance *pValue)
Convenience wrapper assigning the value of a GblVariant to a GblInstance*.
GBL_RESULT GblVariant_setElement(GblVariant *pSelf, size_t index, GblVariant *pValue)
Sets the value of the table entry with the corresponding integral key to pValue, returning a status c...
GBL_RESULT GblVariant_unregisterConverter(GblType fromType, GblType toType)
Unregisters a converter with the type system from going from one type to another type of variant.
GBL_RESULT GblVariant_setObjectMove(GblVariant *pSelf, GblObject *pValue)
Convenience wrapper which assings the value of the given variant to take ownership of a GblBox refere...
GblVariant * GblVariant_index(const GblVariant *pSelf, const GblVariant *pKey, GblVariant *pValue)
Looks up the table entry with the given pKey, storing its value in pValue and also returning it.
GBL_RESULT GblVariant_valueCopy(const GblVariant *pSelf,...)
Attempts to retrieve a copy of the variant's value and store it into the provided pointer.
GBL_RESULT GblVariant_setDouble(GblVariant *pSelf, double value)
Convenience wrapper assigning the value of a constructed variant to a double.
GblBool GblVariant_isNil(const GblVariant *pSelf)
Returns GBL_TRUE if the value held by the variant is not of type GBL_NIL_TYPE.
GBL_RESULT GblVariant_setValueMove(GblVariant *pSelf, GblType type,...)
Performs a generic value move assignment operation, moving the variadic argument into the variant.
GBL_RESULT GblVariant_constructInt32(GblVariant *pSelf, int32_t value)
Convenience wrapper for value constructing a variant with an int32 value.
void * GblVariant_opaquePeek(const GblVariant *pSelf)
Attempst to fetch the value of the variant as a generic opaque pointer, raising an error upon type mi...
double GblVariant_double(const GblVariant *pSelf)
Attempst to fetch the value of the variant as a double, raising an error upon type mismatch.
GBL_RESULT GblVariant_valuePeek(const GblVariant *pSelf,...)
Attempts to retrieve the actual value stored within the variant and store it into the provided pointe...
size_t GblVariant_toSize(GblVariant *pSelf)
Convenience method that attempts to convert the variant's type to size_t and return its value.
GBL_RESULT GblVariant_setCopy(GblVariant *pSelf, const GblVariant *pOther)
Performs a copy assignment operation, setting pOther to the given variant's value.
GBL_RESULT GblVariant_setPointer(GblVariant *pSelf, GblType ptrType, void *pValue)
Convenience wrapper assigning the value of a constructed variant to that of a pointer-derived type.
GBL_RESULT GblVariant_setEnum(GblVariant *pSelf, GblType enumType, GblEnum value)
Convenience wrapper assigning the value of a constructed variant to that of an enum-derived type.
GBL_RESULT GblVariant_constructObjectMove(GblVariant *pSelf, GblObject *pObj)
Convenience wrapper for value m ove constructing a variant from a GblObject, taking ownership of the ...
GBL_RESULT GblVariant_convert(const GblVariant *pSelf, GblVariant *pToVariant)
Fills pToVariant with the value of pSelf, converted to the type contained by pToVariant.
GBL_RESULT GblVariant_constructUint16(GblVariant *pSelf, uint16_t value)
Convenience wrapper for value constructing a variant with a uint16 value.
GblStringRef * pString
GblStringRef value.
GBL_RESULT GblVariant_constructDateTime(GblVariant *pSelf, const GblDateTime *pDateTime)
Convenience wrapper for value copy constructing a variant with a GblDateTime.
GblFlags GblVariant_flags(const GblVariant *pSelf)
Attempst to fetch the value of the variant as a generic GblFlags value, raising an error upon type mi...
GBL_RESULT GblVariant_constructEnum(GblVariant *pSelf, GblType type, GblEnum value)
Convenience wrapper for value constructing an enum derived variant with its value.
GBL_RESULT GblVariant_setSize(GblVariant *pSelf, size_t value)
Convenience wrapper assigning the value of a constructed variant to a size_t.
GblBitmask bitmask
GblBitmask value.
GBL_RESULT GblVariant_setDateTime(GblVariant *pSelf, const GblDateTime *pDt)
Convenience wrapper copy assigning the value of a constructed variant to a GblDateTime*.
GBL_RESULT GblVariant_setIndex(GblVariant *pSelf, const GblVariant *pKey, GblVariant *pValue)
Sets the value of the table entry with the corresponding GblVariant key to pValue,...
GBL_RESULT GblVariant_setValueCopy(GblVariant *pSelf, GblType type,...)
Performs a generic value copy assignment operation, copying the variadic argument into the variant.
GBL_RESULT GblVariant_setUint16(GblVariant *pSelf, uint16_t value)
Convenience wrapper assigning the value of a constructed variant to a uint16.
GblDateTime * GblVariant_dateTime(const GblVariant *pSelf)
Attempst to fetch the value of the variant as a GblDateTime, raising an error upon type mismatch.
GblInstance * GblVariant_instance(const GblVariant *pSelf)
Attempts to fetch the value of the variant as a GblInstance derived type, returning a pointer to it.
GBL_RESULT result
GBL_RESULT value.
GBL_RESULT GblVariant_constructFlags(GblVariant *pSelf, GblType type, GblFlags value)
Convenience wrapper for value constructing a flags-derived variant with its value.
GBL_RESULT GblVariant_destruct(GblVariant *pSelf)
Destroys the given variant, invoking its destructor and resetting its type and value.
GblBox * GblVariant_boxPeek(const GblVariant *pSelf)
Attempts to fetch the value stored within the variant as a pointer to a GblBox derived type.
GblBox * pBox
GblBox* value.
GBL_RESULT GblVariant_setUint64(GblVariant *pSelf, uint64_t value)
Convenience wrapper assigning the value of a constructed variant to a uint64.
GBL_RESULT GblVariant_constructCopy(GblVariant *pSelf, const GblVariant *pOther)
Invokes the copy constructor, constructing then copying the pOther variant.
GBL_RESULT GblVariant_constructDouble(GblVariant *pSelf, double value)
Convenience wrapper for value constructing a variant with a double value.
GblBool GblVariant_equals(const GblVariant *pSelf, const GblVariant *pOther)
Returns GBL_TRUE if the result of the comparison between two variants is 0 (meaning both equal)
GBL_RESULT GblVariant_setBoxMove(GblVariant *pSelf, GblBox *pValue)
Convenience wrapper which assigns the value of the given variant to take ownership of a GblBox refere...
GBL_RESULT GblVariant_setTypeValue(GblVariant *pSelf, GblType value)
Convenience wrapper assigning the value of a constructed variant to a GblType.
const GblStringRef * GblVariant_toString(GblVariant *pSelf)
Convenience method that attempts to convert the variant's type to string and return its value.
uint32_t GblVariant_toUint32(GblVariant *pSelf)
Convenience method that attempts to convert the variant's type to uint32 and return its value.
GblFlags flags
GblFlags value.
GBL_RESULT GblVariant_constructUint32(GblVariant *pSelf, uint32_t value)
Convenience wrapper for value constructing a variant with a uint32 value.
GblEnum GblVariant_enum(const GblVariant *pSelf)
Attempst to fetch the value of the variant as a generic enum value, raising an error upon type mismat...
GblVariant * GblVariant_element(const GblVariant *pSelf, size_t index, GblVariant *pValue)
Looks up the table entry with the given integral key, storing its value in pValue and also returning ...
GBL_RESULT GblVariant_setOpaqueCopy(GblVariant *pSelf, GblType opaqueType, void *pValue)
Convenience wrapper copy assigning the value of a constructed variant to that of an opaque-derived ty...
GBL_RESULT GblVariant_setUint32(GblVariant *pSelf, uint32_t value)
Convenience wrapper assigning the value of a constructed variant to a uint32.
GblStringView GblVariant_stringView(const GblVariant *pSelf)
Attempst to fetch the value of the variant as a string, returning it within a view,...
GBL_RESULT GblVariant_setInt64(GblVariant *pSelf, int64_t value)
Convenience wrapper assigning the value of a constructed variant to an int64.
GblBool GblVariant_next(const GblVariant *pSelf, GblVariant *pKey, GblVariant *pValue)
Given the current entry's key (or NIL for the first iteration), sets the next key as well as its valu...
GblBool boolean
boolean value
GBL_RESULT GblVariant_constructChar(GblVariant *pSelf, char value)
Convenience wrapper for value constructing a variant with a char value.
GblType typeValue
GblType value.
uint32_t GblVariant_uint32(const GblVariant *pSelf)
Attempst to fetch the value of the variant as a uint32, raising an error upon type mismatch.
GblObject * pObject
GblObject* value.
GblType GblVariant_typeValue(const GblVariant *pSelf)
Attempst to fetch the value of the variant as a GblType, raising an error upon type mismatch.
int GblVariant_compare(const GblVariant *pSelf, const GblVariant *pOther)
Peforms a comparison between the two types of variants, implicitly converting between them if necessa...
size_t GblVariant_size(const GblVariant *pSelf)
Attempst to fetch the value of the variant as a size_t, raising an error upon type mismatch.
char GblVariant_char(const GblVariant *pSelf)
Attempst to fetch the value of the variant as a char, raising an error upon type mismatch.
GBL_RESULT GblVariant_setFloat(GblVariant *pSelf, float value)
Convenience wrapper assigning the value of a constructed variant to a float.
GBL_RESULT GblVariant_constructUint64(GblVariant *pSelf, uint64_t value)
Convenience wrapper for value constructing a variant with a uint64 value.
GblDateTime * GblVariant_toDateTime(GblVariant *pSelf)
Convenience method that attempts to convert the variant's type to GblDateTime and return its value.
GblVariant * GblVariant_field(const GblVariant *pSelf, const char *pName, GblVariant *pValue)
Looks up the talbe entry with the given string key, storing its value in pValue and also returning it...
GblHash GblVariant_hash(const GblVariant *pSelf)
Calculates a 32-bit hash value corresponding to the given variant's value.
GblBool GblVariant_canConvert(GblType fromType, GblType toType)
Returns GBL_TRUE if a method can be found to convert from one type to another type of variant.
GBL_RESULT GblVariant_constructStringRef(GblVariant *pSelf, const GblStringRef *pStrRef)
Convenience wrapper for value move constructing a variant with a GblStringRef (transferring ownership...
GblFlags GblVariant_toFlags(GblVariant *pSelf)
Convenience method that attempts to convert the variant's type to a generic GblFlags and return its v...
GBL_RESULT GblVariant_setStringView(GblVariant *pSelf, GblStringView value)
Convenience wrapper assigning the value of a constructed variant to a copy of the given string view.
GblBox * GblVariant_boxCopy(const GblVariant *pSelf)
Attempts to fetch a copy of the value of the variant by making a new generic GblBox reference,...
GblEnum GblVariant_toEnum(GblVariant *pSelf)
Convenience method that attempts to convert the variant's type to a generic enum and return its value...
GBL_RESULT GblVariant_setStringRef(GblVariant *pSelf, GblStringRef *pRef)
Convenience wrapper move assigning the value of a constructed variant to take the given reference.
GBL_RESULT GblVariant_constructInt64(GblVariant *pSelf, int64_t value)
Convenience wrapper for value constructing a variant with an int64 value.
GBL_RESULT GblVariant_setFlags(GblVariant *pSelf, GblType flagsType, GblFlags value)
Convenience wrapper assigning the value of a constructed variant to that of a GblFlags-derived type.
GBL_RESULT GblVariant_constructUint8(GblVariant *pSelf, uint8_t value)
Convenience wrapper for value constructing a variant with a uint8_t value.
GBL_RESULT GblVariant_valuePeekVa(GblVariant *pSelf, va_list *pVa)
va_list* variant of GblVariant_valuePeek(), where destination pointer comes from a va_list*
GblBox * GblVariant_boxMove(GblVariant *pSelf)
Attempts to take the value stored within the variant as generic GblBox pointer, claiming ownerships o...
uint8_t GblVariant_toUint8(GblVariant *pSelf)
Convenience method that attempts to convert the variant's type to uint8 and return its value.
uint64_t GblVariant_toUint64(GblVariant *pSelf)
Convenience method that attempts to convert the variant's type to uint64 and return its value.
GBL_RESULT GblVariant_constructPointer(GblVariant *pSelf, GblType ptrType, void *pValue)
Convenience wrapper for value constructing a pointer-derived variant with its value.
int16_t GblVariant_toInt16(GblVariant *pSelf)
Convenience method that attempts to convert the variant's type to int16 and return its value.
GBL_RESULT GblVariant_constructString(GblVariant *pSelf, const char *pValue)
Convenience wrapper for value copy constructing a variant with a const char*.
size_t GblVariant_converterCount(void)
Retrieves the current number of type conversion routines held by the type registry.
GblType GblVariant_typeOf(const GblVariant *pSelf)
Retrieves the name of the type of value contained by the given variant.
int64_t GblVariant_toInt64(GblVariant *pSelf)
Convenience method that attempts to convert the variant's type to int64 and return its value.
GblType type
GblType UUID.
GBL_RESULT GblVariant_constructMove(GblVariant *pSelf, GblVariant *pOther)
Invokes the move constructor, constructing then moving the pOther variant.
GBL_RESULT GblVariant_valueMove(GblVariant *pSelf,...)
Attempts to move the value stored within the variant out of it and into the provided pointer.
void * GblVariant_opaqueMove(GblVariant *pSelf)
Attempst to take the value of the variant (claiming ownerships) as a generic opaque pointer,...
GBL_RESULT GblVariant_setBool(GblVariant *pSelf, GblBool value)
Convenience wrapper assigning the value of a constructed variant to a boolean.
GBL_RESULT GblVariant_constructNil(GblVariant *pSelf)
Convenience wrapper for value constructing a variant with a NIL value.
GblObject * GblVariant_objectCopy(const GblVariant *pSelf)
Attempts to fetch a copy of the value of the variant by making a new generic GblObject reference,...
GBL_RESULT GblVariant_valueCopyVa(const GblVariant *pSelf, va_list *pVa)
va_list* variant of GblVariant_valueCopy(), where the destination pointer comes from a va_list*
GBL_RESULT GblVariant_constructBool(GblVariant *pSelf, GblBool value)
Convenience wrapper for value constructing a variant with a bool value.
GBL_RESULT GblVariant_constructOpaqueCopy(GblVariant *pSelf, GblType opaqueType, void *pValue)
Convenience wrapper for value copy constructing a variant from an opaque-derived type pointer.
uint64_t GblVariant_uint64(const GblVariant *pSelf)
Attempst to fetch the value of the variant as a uint64, raising an error upon type mismatch.
uint16_t GblVariant_toUint16(GblVariant *pSelf)
Convenience method that attempts to convert the variant's type to uint16 and return its value.
uint16_t u16
uint16_t value
const GblStringRef * GblVariant_string(const GblVariant *pSelf)
Attempst to fetch the value of the variant as a string, raising an error upon type mismatch.
GBL_RESULT GblVariant_constructDefault(GblVariant *pSelf, GblType type)
Invokes the default constructor for the given type.
GBL_RESULT GblVariant_setString(GblVariant *pSelf, const char *pValue)
Convenience wrapper assigning the value of a constructed variant to a copy of the given string.
uint32_t u32
uint32_t value
GblType GblVariant_toTypeValue(GblVariant *pSelf)
Convenience method that attempts to convert the variant's type to GblType and return its value.
GblEnum enumeration
enum value
GBL_RESULT GblVariant_load(GblVariant *pSelf, const GblStringBuffer *pStr)
Attempts to deserialize a value within a GblStringBuffer to store within the given variant.
GBL_RESULT GblVariant_constructValueCopy(GblVariant *pSelf, GblType type,...)
Invokes the value copy constructor, constructing then copying the given value.
size_t GblVariant_count(const GblVariant *pSelf)
Returns the number of table entries within the given GblVariant.
GBL_RESULT GblVariant_constructFloat(GblVariant *pSelf, float value)
Convenience wrapper for value constructing a variant with a float value.
GBL_RESULT GblVariant_setChar(GblVariant *pSelf, char value)
Convenience wrapper assigning the value of a constructed variant to a character.
GBL_RESULT GblVariant_setBoxCopy(GblVariant *pSelf, GblBox *pValue)
Convenience wrapper which assigns the value of the given variant to that of a new reference to a GblB...
char GblVariant_toChar(GblVariant *pSelf)
Convenience method that attempts to convert the variant's type to char and return its value.
GBL_RESULT GblVariant_constructSize(GblVariant *pSelf, size_t value)
Convenience wrapper for value copy constructing a variant with a size_t.
GblBool GblVariant_isValid(const GblVariant *pSelf)
Returns GBL_TRUE if the value held by the given variant is not of GBL_INVALID_TYPE.
uint8_t GblVariant_uint8(const GblVariant *pSelf)
Attempst to fetch the value of the variant as a uint8, raising an error upon type mismatch.
int32_t GblVariant_toInt32(GblVariant *pSelf)
Convenience method that attempts to convert the variant's type to int32 and return its value.
GBL_RESULT GblVariant_constructBoxMove(GblVariant *pSelf, GblBox *pValue)
Convenience wrapper for value move constructing a variant from a GblBox, taking ownership of the refe...
GBL_RESULT GblVariant_setObjectCopy(GblVariant *pSelf, GblObject *pValue)
Convenience wrapper which assigns the value of the given variant to that of a new reference to a GblO...
void * GblVariant_pointer(const GblVariant *pSelf)
Attempst to fetch the value of the variant as a generic pointer, raising an error upon type mismatch.
GBL_RESULT GblVariant_setInt16(GblVariant *pSelf, int16_t value)
Convenience wrapper assigning the value of a constructed variant to an int16.
GBL_RESULT GblVariant_setMove(GblVariant *pSelf, GblVariant *pOther)
Performs a move assignment operation, moving the given variant's value into pOther.
GBL_RESULT GblVariant_registerConverter(GblType fromType, GblType toType, GblVariantConverterFn pFnConv)
Registers a converter with the type system for going from one type of variant to another.
GblBool GblVariant_toBool(GblVariant *pSelf)
Convenience method that attempts to convert the variant's type to bool and return its value.
GBL_RESULT GblVariant_constructOpaqueMove(GblVariant *pSelf, GblType opaqueType, void *pValue)
Convenience wrapper for value move constructing a variant from an opaque-derived type pointer.
GblBool GblVariant_bool(const GblVariant *pSelf)
Attempst to fetch the value of the variant as a bool, raising an error upon type mismatch.
float GblVariant_float(const GblVariant *pSelf)
Attempst to fetch the value of the variant as a float, raising an error upon type mismatch.
GBL_RESULT GblVariant_constructBoxCopy(GblVariant *pSelf, GblBox *pValue)
Convenience wrapper for value copy constructing a variant from a GblBox, increasing its refCount.
GBL_RESULT GblVariant_invalidate(GblVariant *pSelf)
Clears and resets the given variants type and value. ONLY call after being the source of a move opera...
int16_t GblVariant_int16(const GblVariant *pSelf)
Attempst to fetch the value of the variant as an int16, raising an error upon type mismatch.
GBL_RESULT GblVariant_setValueCopyVa(GblVariant *pSelf, GblType type, va_list *pVarArgs)
va_list* variation of GblVariant_setValueCopy(), where the value is sourdced from a va_list*
GBL_RESULT GblVariant_constructStringView(GblVariant *pSelf, GblStringView value)
Convenience wrapper for value copy constructing a string variant from a string view.
GblObject * GblVariant_objectMove(GblVariant *pSelf)
Attempts to take the value stored within the variant as generic GblObject pointer,...
GBL_RESULT GblVariant_setOpaqueMove(GblVariant *pSelf, GblType opaqueType, void *pValue)
Convenience wrapper move assigning the value of a constructed variant to that of an opaque-derived ty...
GblObject * GblVariant_objectPeek(const GblVariant *pSelf)
Attempts to fetch the value stored within the variant as a pointer to a GblObject derived type.
GBL_RESULT GblVariant_constructValueMoveVa(GblVariant *pSelf, GblType type, va_list *pList)
va_list* variation of GblVariant_constructValueMove()
GBL_RESULT GblVariant_constructValueCopyVa(GblVariant *pSelf, GblType type, va_list *pList)
va_list* variation of GblVariant_constructValueCopy()
GblStringView GblVariant_toStringView(GblVariant *pSelf)
Convenience method that attempts to convert the variant's type to string view and return its value.
void * GblVariant_opaqueCopy(const GblVariant *pSelf)
Attempst to fetch a copy of the value of the variant as a generic opaque pointer, raising an error up...
GblInstance * pInstance
GblInstance* value.
GblDateTime * pDateTime
GblDateTime value.
GBL_RESULT GblVariant_valueMoveVa(GblVariant *pSelf, va_list *pVa)
va_list* variant of GblVariant_valueMove(), where destination pointer comes from a va_list*
GBL_RESULT GblVariant_constructTypeValue(GblVariant *pSelf, GblType type)
Convenience wrapper for value constructing a variant from a GblType.
uint64_t u64
uint64_t value
GBL_RESULT GblVariant_constructInt16(GblVariant *pSelf, int16_t value)
Convenience wrapper for value constructing a variant with an int16 value.
GblFnPtr pFnPtr
function pointer value
GBL_RESULT GblVariant_setValueMoveVa(GblVariant *pSelf, GblType type, va_list *pVarArgs)
va_list* variation of GblVariant_setValueMove(), where the value is sourced from a va_list*
float GblVariant_toFloat(GblVariant *pSelf)
Convenience method that attempts to convert the variant's type to float and return its value.
GBL_RESULT GblVariant_setUint8(GblVariant *pSelf, uint8_t value)
Convenience wrapper assigning the value of a constructed variant to a uint8.
void * GblVariant_toPointer(GblVariant *pSelf)
Convenience method that attempts to convert the variant's type to pointer and return its value.
int64_t GblVariant_int64(const GblVariant *pSelf)
Attempst to fetch the value of the variant as an int64, raising an error upon type mismatch.
uint16_t GblVariant_uint16(const GblVariant *pSelf)
Attempst to fetch the value of the variant as a uint16, raising an error upon type mismatch.
GBL_RESULT GblVariant_setNil(GblVariant *pSelf)
Convenience wrapper assigning the value of a constructed variant to NIL.
GBL_RESULT GblVariant_constructInstance(GblVariant *pSelf, GblInstance *pValue)
Convenience wrapper for value constructing a variant from a GblInstance pointer.
GBL_RESULT GblVariant_setInt32(GblVariant *pSelf, int32_t value)
Convenience wrapper assigning the value of a constructed variant to an int32.
GBL_RESULT GblVariant_setField(GblVariant *pSelf, const char *pName, GblVariant *pValue)
Sets the value of the table entry with the corresponding string key to pValue, returning a status cod...
int32_t GblVariant_int32(const GblVariant *pSelf)
Attempst to fetch the value of the variant as an int32, raising an error upon type mismatch.
GBL_RESULT GblVariant_constructValueMove(GblVariant *pSelf, GblType type,...)
Invokes the value move constructor, constructing then moving the given value.
GBL_RESULT GblVariant_save(const GblVariant *pSelf, GblStringBuffer *pString)
Attempts to serialize the value stored within the given variant to a GblStringBuffer.