void* DaoValue_TryCastCdata( DaoValue *self, DaoType *type ) { if( self->type == DAO_OBJECT ){ self = (DaoValue*) DaoObject_CastCdata( (DaoObject*) self, type ); } if( self == NULL || self->type != DAO_CDATA ) return NULL; if( self->type != DAO_CDATA ) return NULL; return DaoCdata_CastData( & self->xCdata, type ); }
void* DaoValue_TryCastCdataTC( DaoValue *self, DaoTypeCore *core ) { DaoType *type = NULL; if( self->type == DAO_OBJECT ){ type = DaoVmSpace_GetType( self->xObject.defClass->nameSpace->vmSpace, core ); self = (DaoValue*) DaoObject_CastCdata( (DaoObject*) self, type ); } if( self == NULL || self->type != DAO_CDATA ) return NULL; if( self->type != DAO_CDATA ) return NULL; type = DaoVmSpace_GetType( self->xCstruct.ctype->aux->xCtype.nameSpace->vmSpace, core ); return DaoCdata_CastData( & self->xCdata, type ); }
void* DaoValue_TryCastCdata( DaoValue *self, DaoType *type ) { if( self->type != DAO_CDATA ) return NULL; return DaoCdata_CastData( & self->xCdata, type ); }