| 10 | static inline const char *getName() { return "cpp.Int64"; } |
| 11 | static inline String toString( const void *inValue ) { return String( *(Int64 *)inValue ); } |
| 12 | static inline void handler(DynamicHandlerOp op, void *ioValue,int inSize, void *outResult) |
| 13 | { |
| 14 | if (op==dhoToString) |
| 15 | *(String *)outResult = toString(ioValue); |
| 16 | else if (op==dhoGetClassName) |
| 17 | *(const char **)outResult = getName(); |
| 18 | else if (op==dhoFromDynamic) |
| 19 | { |
| 20 | StructHandlerDynamicParams *params = (StructHandlerDynamicParams *)outResult; |
| 21 | cpp::Int64 &value = *(cpp::Int64 *)ioValue; |
| 22 | params->outProcessed = true; |
| 23 | if (!params->inData) |
| 24 | value = 0; |
| 25 | else |
| 26 | value = params->inData->__ToInt64(); |
| 27 | } |
| 28 | else if (op==dhoToDynamic) |
| 29 | { |
| 30 | Dynamic value = *(cpp::Int64 *)ioValue; |
| 31 | *(hx::Object **)outResult = value.mPtr; |
| 32 | } |
| 33 | else if (op==dhoIs) |
| 34 | { |
| 35 | StructHandlerDynamicParams *params = (StructHandlerDynamicParams *)outResult; |
| 36 | hx::Object *obj = params->inData; |
| 37 | int type = obj->__GetType(); |
| 38 | params->outProcessed = type==vtInt || type==vtInt64; |
| 39 | } |
| 40 | else |
| 41 | return DefaultStructHandler::handler(op,ioValue,inSize, outResult); |
| 42 | } |
| 43 | }; |
| 44 | |
| 45 | typedef Struct<Int64,Int64Handler> Int64Struct; |