X-Git-Url: https://git.saurik.com/cycript.git/blobdiff_plain/e2ce853b4a48f8278dc46e4143aa845b18948651..840966082c867decd624b074661e31945193abea:/Decode.cpp diff --git a/Decode.cpp b/Decode.cpp index 823e6b4..1af478c 100644 --- a/Decode.cpp +++ b/Decode.cpp @@ -56,6 +56,13 @@ CYTypedIdentifier *Primitive::Decode(CYPool &pool) const { return $ CYTypedIdentifier($ CYTypeIntegral(CYTypeSigned, 1)); } +#ifdef __SIZEOF_INT128__ +template <> +CYTypedIdentifier *Primitive::Decode(CYPool &pool) const { + return $ CYTypedIdentifier($ CYTypeInt128(CYTypeSigned)); +} +#endif + template <> CYTypedIdentifier *Primitive::Decode(CYPool &pool) const { return $ CYTypedIdentifier($ CYTypeIntegral(CYTypeSigned, 2)); @@ -81,6 +88,13 @@ CYTypedIdentifier *Primitive::Decode(CYPool &pool) const { return $ CYTypedIdentifier($ CYTypeIntegral(CYTypeUnsigned, 1)); } +#ifdef __SIZEOF_INT128__ +template <> +CYTypedIdentifier *Primitive::Decode(CYPool &pool) const { + return $ CYTypedIdentifier($ CYTypeInt128(CYTypeUnsigned)); +} +#endif + template <> CYTypedIdentifier *Primitive::Decode(CYPool &pool) const { return $ CYTypedIdentifier($ CYTypeIntegral(CYTypeUnsigned, 2)); @@ -139,6 +153,16 @@ CYTypedIdentifier *Object::Decode(CYPool &pool) const { } #endif +CYTypedIdentifier *Enum::Decode(CYPool &pool) const { + CYEnumConstant *values(NULL); + for (size_t i(count); i != 0; --i) + values = $ CYEnumConstant($I(pool.strdup(constants[i - 1].name)), $D(constants[i - 1].value), values); + CYIdentifier *identifier(name == NULL ? NULL : $I(name)); + CYTypedIdentifier *typed(type.Decode(pool)); + _assert(typed->modifier_ == NULL); + return $ CYTypedIdentifier($ CYTypeEnum(identifier, typed->specifier_, values)); +} + CYTypedIdentifier *Aggregate::Decode(CYPool &pool) const { _assert(!overlap);