xoofx/CppAst.NET

how to check for exact CppType in the compilation?

danyhm opened this issue · 1 comments

Hello,

this seems like a newbie question however I can't seem to find a way to check for the exact CppType in any location.

suppose I have a function and the return type is "Unsigned int"

the function.ReturnType is CppType and that Cpptype is an abstract class that based on the type other classed implement it like CppPrimitiveType etc.

my question is that In the VS2019 debugger I can see that the "Kind" field is there however it's not public and I don't want to use reflection to get the value. how can I know which primitive type I'm dealing with? like how can I compare it with CppPrimitiveType members or CppPrimitiveKind members to see exactly what primitive that is?

Never mind i found it.

for anyone else having this issue. you should check the TypeKind and based on that cast the obj to appropriate subclass