Ejemplo n.º 1
0
        public TypeSyntax PortType(CXType type)
        {
            if (type.kind == CXTypeKind.CXType_Pointer)
                return CommonTypes.IntPtrTypeSyntax;

            if (type.kind == CXTypeKind.CXType_ObjCObjectPointer) {
                type = type.GetPointee ();
                return SF.ParseTypeName (type.ToString ());
            }

            if (type.kind == CXTypeKind.CXType_Void)
                return CommonTypes.VoidTypeSyntax;

            if (type.kind == CXTypeKind.CXType_Int)
                return CommonTypes.IntTypeSyntax;

            if (type.kind == CXTypeKind.CXType_Float)
                return CommonTypes.FloatTypeSyntax;

            if (type.kind == CXTypeKind.CXType_Double)
                return CommonTypes.DoubleTypeSyntax;

            return SF.ParseTypeName (Prettify (type));
        }
Ejemplo n.º 2
0
        string Prettify(CXType type)
        {
            if(type.kind == CXTypeKind.CXType_ObjCId)
                return idTypeName;

            string typeName = type.ToString ();
            if (type.kind == CXTypeKind.CXType_Typedef && typeName == "CGFloat")
                return "nfloat";

            return type.ToString ();
        }