diff --git a/Cpp/include/RG3/Cpp/TypeBaseInfo.h b/Cpp/include/RG3/Cpp/TypeBaseInfo.h new file mode 100644 index 0000000..a23b6f5 --- /dev/null +++ b/Cpp/include/RG3/Cpp/TypeBaseInfo.h @@ -0,0 +1,29 @@ +#pragma once + +#include +#include +#include + +#include + + +namespace rg3::cpp +{ + /** + * Base information about type (what kind, name, pretty name, namespace, where defined) + */ + struct TypeBaseInfo + { + cpp::TypeKind eKind {}; + std::string sName {}; + std::string sPrettyName {}; + cpp::CppNamespace sNameSpace {}; + cpp::DefinitionLocation sDefLocation {}; + + TypeBaseInfo(); + TypeBaseInfo(const TypeBaseInfo& copy); + TypeBaseInfo(TypeBaseInfo&& move) noexcept; + TypeBaseInfo& operator=(const TypeBaseInfo& copy); + TypeBaseInfo& operator=(TypeBaseInfo&& move) noexcept; + }; +} \ No newline at end of file diff --git a/Cpp/include/RG3/Cpp/TypeStatement.h b/Cpp/include/RG3/Cpp/TypeStatement.h index d11c160..6b4a67a 100644 --- a/Cpp/include/RG3/Cpp/TypeStatement.h +++ b/Cpp/include/RG3/Cpp/TypeStatement.h @@ -2,6 +2,7 @@ #include #include +#include #include #include @@ -11,7 +12,10 @@ namespace rg3::cpp { struct TypeStatement { + // Reference TypeReference sTypeRef {}; + + // Statement location std::optional sDefinitionLocation {}; bool bIsConst { false }; bool bIsPointer { false }; @@ -19,6 +23,10 @@ namespace rg3::cpp bool bIsReference { false }; bool bIsTemplateSpecialization { false }; + // Type info + TypeBaseInfo sBaseInfo {}; + + // Globals static const TypeStatement g_sVoid; // globally known void type bool isVoid() const; diff --git a/Cpp/source/TypeBaseInfo.cpp b/Cpp/source/TypeBaseInfo.cpp new file mode 100644 index 0000000..4ddb32c --- /dev/null +++ b/Cpp/source/TypeBaseInfo.cpp @@ -0,0 +1,55 @@ +#include + + +namespace rg3::cpp +{ + TypeBaseInfo::TypeBaseInfo() = default; + TypeBaseInfo::TypeBaseInfo(const TypeBaseInfo& copy) + : eKind(copy.eKind) + , sName(copy.sName) + , sPrettyName(copy.sPrettyName) + , sNameSpace(copy.sNameSpace) + , sDefLocation(copy.sDefLocation) + {} + + TypeBaseInfo::TypeBaseInfo(TypeBaseInfo&& move) noexcept + : eKind(move.eKind) + , sName(std::move(move.sName)) + , sPrettyName(std::move(move.sPrettyName)) + , sNameSpace(std::move(move.sNameSpace)) + , sDefLocation(std::move(move.sDefLocation)) + { + move.eKind = {}; + move.sName = {}; + move.sPrettyName = {}; + move.sNameSpace = {}; + move.sDefLocation = {}; + } + + TypeBaseInfo& TypeBaseInfo::operator=(const TypeBaseInfo& copy) + { + eKind = copy.eKind; + sName = copy.sName; + sPrettyName = copy.sPrettyName; + sNameSpace = copy.sNameSpace; + sDefLocation = copy.sDefLocation; + return *this; + } + + TypeBaseInfo& TypeBaseInfo::operator=(TypeBaseInfo&& move) noexcept + { + eKind = move.eKind; + sName = std::move(move.sName); + sPrettyName = std::move(move.sPrettyName); + sNameSpace = std::move(move.sNameSpace); + sDefLocation = std::move(move.sDefLocation); + + move.eKind = {}; + move.sName = {}; + move.sPrettyName = {}; + move.sNameSpace = {}; + move.sDefLocation = {}; + + return *this; + } +} \ No newline at end of file diff --git a/Extension/rg3py/__init__.py b/Extension/rg3py/__init__.py index 7c152f0..4b480ac 100644 --- a/Extension/rg3py/__init__.py +++ b/Extension/rg3py/__init__.py @@ -24,4 +24,5 @@ from .rg3py import CppCompilerIssueKind from .rg3py import CppCompilerIssue from .rg3py import CppTypeReference -from .rg3py import ClangRuntime \ No newline at end of file +from .rg3py import ClangRuntime +from .rg3py import TypeBaseInfo diff --git a/LLVM/include/RG3/LLVM/Utils.h b/LLVM/include/RG3/LLVM/Utils.h index cff1cc1..0419980 100644 --- a/LLVM/include/RG3/LLVM/Utils.h +++ b/LLVM/include/RG3/LLVM/Utils.h @@ -1,9 +1,10 @@ #pragma once +#include #include #include #include -#include +#include #include #include @@ -11,15 +12,6 @@ namespace rg3::llvm { - struct TypeBaseInfo - { - cpp::TypeKind eKind; - std::string sName; - std::string sPrettyName; - cpp::CppNamespace sNameSpace; - cpp::DefinitionLocation sDefLocation; - }; - struct Utils { static void getDeclInfo(const clang::Decl* decl, rg3::cpp::CppNamespace& nameSpace); @@ -28,7 +20,7 @@ namespace rg3::llvm static cpp::ClassEntryVisibility getDeclVisibilityLevel(const clang::Decl* decl); - static bool getQualTypeBaseInfo(const clang::QualType& qualType, TypeBaseInfo& baseInfo, const clang::ASTContext& astContext); + static bool getQualTypeBaseInfo(const clang::QualType& qualType, cpp::TypeBaseInfo& baseInfo, const clang::ASTContext& astContext); static void fillTypeStatementFromQualType(rg3::cpp::TypeStatement& typeStatement, clang::QualType qt, const clang::ASTContext& astContext); diff --git a/LLVM/source/Utils.cpp b/LLVM/source/Utils.cpp index c98e8b6..a1434b8 100644 --- a/LLVM/source/Utils.cpp +++ b/LLVM/source/Utils.cpp @@ -88,7 +88,7 @@ namespace rg3::llvm return cpp::ClassEntryVisibility::CEV_PRIVATE; } - bool Utils::getQualTypeBaseInfo(const clang::QualType& qualType, TypeBaseInfo& baseInfo, const clang::ASTContext& astContext) + bool Utils::getQualTypeBaseInfo(const clang::QualType& qualType, cpp::TypeBaseInfo& baseInfo, const clang::ASTContext& astContext) { if (qualType->isTypedefNameType()) // must be first! { @@ -158,6 +158,7 @@ namespace rg3::llvm baseInfo.sNameSpace = baseInfo.sNameSpace; baseInfo.sPrettyName = baseInfo.sNameSpace.isEmpty() ? correctedName : fmt::format("{}::{}", baseInfo.sNameSpace.asString(), correctedName); baseInfo.sDefLocation = aDefLocation; + baseInfo.eKind = cpp::TypeKind::TK_STRUCT_OR_CLASS; return true; } @@ -224,16 +225,18 @@ namespace rg3::llvm const clang::SourceManager& sm = astContext.getSourceManager(); { - TypeBaseInfo typeBaseInfo {}; + cpp::TypeBaseInfo typeBaseInfo {}; if (!getQualTypeBaseInfo(qt, typeBaseInfo, astContext)) { // Use "pure" view typeStatement.sTypeRef = cpp::TypeReference(qt.getUnqualifiedType().getAsString()); + typeStatement.sBaseInfo = {}; // invalid in this case } else { // Use correct view typeStatement.sTypeRef = cpp::TypeReference(typeBaseInfo.sPrettyName); + typeStatement.sBaseInfo = typeBaseInfo; } } @@ -241,16 +244,18 @@ namespace rg3::llvm if (qt->isPointerType() || qt->isReferenceType()) { - TypeBaseInfo typeBaseInfo {}; + cpp::TypeBaseInfo typeBaseInfo {}; if (!getQualTypeBaseInfo(qt->getPointeeType().getUnqualifiedType(), typeBaseInfo, astContext)) { // Use "pure" view typeStatement.sTypeRef = cpp::TypeReference(qt->getPointeeType().getUnqualifiedType().getAsString()); + typeStatement.sBaseInfo = {}; // override to invalid } else { // Use correct view typeStatement.sTypeRef = cpp::TypeReference(typeBaseInfo.sPrettyName); + typeStatement.sBaseInfo = typeBaseInfo; // override } typeStatement.bIsPointer = qt->isPointerType(); diff --git a/LLVM/source/Visitors/CxxTemplateSpecializationVisitor.cpp b/LLVM/source/Visitors/CxxTemplateSpecializationVisitor.cpp index 74d59b2..76f28ee 100644 --- a/LLVM/source/Visitors/CxxTemplateSpecializationVisitor.cpp +++ b/LLVM/source/Visitors/CxxTemplateSpecializationVisitor.cpp @@ -371,6 +371,7 @@ namespace rg3::llvm::visitors // Override type name & location in sTargetStmt from sCoreStmt stmt.sTypeRef = sTargetStmt.sTypeRef; + stmt.sBaseInfo = sTargetStmt.sBaseInfo; stmt.sDefinitionLocation = sTargetStmt.sDefinitionLocation; stmt.bIsConst = sTargetStmt.bIsConst || stmt.bIsConst; stmt.bIsPointer = sTargetStmt.bIsPointer || stmt.bIsPointer; diff --git a/PyBind/rg3py.pyi b/PyBind/rg3py.pyi index 860f366..537c489 100644 --- a/PyBind/rg3py.pyi +++ b/PyBind/rg3py.pyi @@ -169,6 +169,9 @@ class TypeStatement: @property def type_ref(self) -> CppTypeReference: ... + @property + def type_info(self) -> TypeBaseInfo: ... + @property def location(self) -> Optional[Location]: ... @@ -193,6 +196,23 @@ class TypeStatement: def get_name(self) -> str: ... +class TypeBaseInfo: + @property + def kind(self) -> CppTypeKind: ... + + @property + def namespace(self) -> CppNamespace: ... + + @property + def location(self) -> Location: ... + + @property + def name(self) -> str: ... + + @property + def pretty_name(self) -> str: ... + + class FunctionArgument: @property def type_info(self) -> TypeStatement: ... diff --git a/PyBind/source/PyBind.cpp b/PyBind/source/PyBind.cpp index bbadeb1..15ef6e6 100644 --- a/PyBind/source/PyBind.cpp +++ b/PyBind/source/PyBind.cpp @@ -10,6 +10,7 @@ #include #include #include +#include #include #include @@ -152,6 +153,16 @@ namespace rg3::pybind::wrappers static const std::string s_Null {}; return boost::python::str(arg.asString(s_Null)); } + + static boost::python::str TypeBaseInfo_getName(const rg3::cpp::TypeBaseInfo& sInfo) + { + return boost::python::str(sInfo.sName); + } + + static boost::python::str TypeBaseInfo_getPrettyName(const rg3::cpp::TypeBaseInfo& sInfo) + { + return boost::python::str(sInfo.sPrettyName); + } } @@ -250,17 +261,26 @@ BOOST_PYTHON_MODULE(rg3py) .add_property("value", make_getter(&rg3::cpp::EnumEntry::iValue), "Value of entry") ; + class_("TypeBaseInfo") + .add_property("kind", make_getter(&rg3::cpp::TypeBaseInfo::eKind), "Kind of type") + .add_property("namespace", make_getter(&rg3::cpp::TypeBaseInfo::sNameSpace), "Namespace where type declared") + .add_property("location", make_getter(&rg3::cpp::TypeBaseInfo::sDefLocation), "Place where type declared") + .add_property("name", &rg3::pybind::wrappers::TypeBaseInfo_getName, "Name of type without namespace") + .add_property("pretty_name", &rg3::pybind::wrappers::TypeBaseInfo_getPrettyName, "Prettified name of type (included namespace and full form of name)") + ; + class_("TypeStatement") .add_property("type_ref", make_getter(&rg3::cpp::TypeStatement::sTypeRef), "Reference to type info") - .add_property("location", &rg3::pybind::wrappers::TypeStatement_getDefinitionLocation) + .add_property("type_info", make_getter(&rg3::cpp::TypeStatement::sBaseInfo), "Base information about type") + .add_property("location", &rg3::pybind::wrappers::TypeStatement_getDefinitionLocation, "(optional) Where type statement info defined (not a type!)") .add_property("is_const", make_getter(&rg3::cpp::TypeStatement::bIsConst), "Is declaration constant") .add_property("is_const_ptr", make_getter(&rg3::cpp::TypeStatement::bIsPtrConst), "Is pointer type with const qualifier (unused when is_ptr is False)") .add_property("is_ptr", make_getter(&rg3::cpp::TypeStatement::bIsPointer), "Is declaration pointer") .add_property("is_ref", make_getter(&rg3::cpp::TypeStatement::bIsReference), "Is declaration reference") .add_property("is_template", make_getter(&rg3::cpp::TypeStatement::bIsTemplateSpecialization), "Is declaration presented via template specialization") - .add_property("is_void", &rg3::cpp::TypeStatement::isVoid) + .add_property("is_void", &rg3::cpp::TypeStatement::isVoid, "Is type C++ void or not") - .def("get_name", &rg3::pybind::wrappers::TypeStatement_getTypeName) + .def("get_name", &rg3::pybind::wrappers::TypeStatement_getTypeName, "Return name of the type") ; class_("FunctionArgument") diff --git a/Tests/Unit/source/Tests_MemberFunctions.cpp b/Tests/Unit/source/Tests_MemberFunctions.cpp index 72e6347..377ee6f 100644 --- a/Tests/Unit/source/Tests_MemberFunctions.cpp +++ b/Tests/Unit/source/Tests_MemberFunctions.cpp @@ -152,6 +152,10 @@ struct TransformComponent ASSERT_EQ(asClass->getFunctions()[0].vArguments[0].sType.bIsPtrConst, true); ASSERT_EQ(asClass->getFunctions()[0].vArguments[0].sType.bIsPointer, false); ASSERT_EQ(asClass->getFunctions()[0].vArguments[0].sType.bIsReference, true); + ASSERT_EQ(asClass->getFunctions()[0].vArguments[0].sType.sBaseInfo.sName, "Vector3"); + ASSERT_EQ(asClass->getFunctions()[0].vArguments[0].sType.sBaseInfo.sPrettyName, "Vector3"); + ASSERT_EQ(asClass->getFunctions()[0].vArguments[0].sType.sBaseInfo.sDefLocation.getPath(), "id0.hpp"); + ASSERT_EQ(asClass->getFunctions()[0].vArguments[0].sType.sBaseInfo.eKind, rg3::cpp::TypeKind::TK_STRUCT_OR_CLASS); ASSERT_EQ(asClass->getFunctions()[0].vArguments[0].sType.sTypeRef.getRefName(), "Vector3"); ASSERT_EQ(asClass->getFunctions()[0].vArguments[0].sType.sDefinitionLocation.has_value(), true); ASSERT_EQ(asClass->getFunctions()[0].vArguments[0].sType.sDefinitionLocation.value().getPath(), "id0.hpp"); @@ -165,6 +169,11 @@ struct TransformComponent ASSERT_EQ(asClass->getFunctions()[1].sReturnType.sDefinitionLocation.has_value(), true); ASSERT_EQ(asClass->getFunctions()[1].sReturnType.sDefinitionLocation.value().getPath(), "id0.hpp"); ASSERT_EQ(asClass->getFunctions()[1].sReturnType.sTypeRef.getRefName(), "Vector3"); + ASSERT_EQ(asClass->getFunctions()[1].sReturnType.sBaseInfo.sName, "Vector3"); + ASSERT_EQ(asClass->getFunctions()[1].sReturnType.sBaseInfo.sPrettyName, "Vector3"); + ASSERT_EQ(asClass->getFunctions()[1].sReturnType.sBaseInfo.sDefLocation.getPath(), "id0.hpp"); + ASSERT_EQ(asClass->getFunctions()[1].sReturnType.sBaseInfo.eKind, rg3::cpp::TypeKind::TK_STRUCT_OR_CLASS); + ASSERT_EQ(asClass->getFunctions()[1].bIsConst, true); ASSERT_EQ(asClass->getFunctions()[2].sName, "IsSomething"); @@ -230,16 +239,28 @@ RegisterType> { ASSERT_EQ(asClass0->getProperties()[0].sName, "x"); ASSERT_EQ(asClass0->getProperties()[0].sAlias, "x"); ASSERT_EQ(asClass0->getProperties()[0].sTypeInfo.sTypeRef.getRefName(), "float"); + ASSERT_EQ(asClass0->getProperties()[0].sTypeInfo.sBaseInfo.sName, "float"); + ASSERT_EQ(asClass0->getProperties()[0].sTypeInfo.sBaseInfo.sPrettyName, "float"); + ASSERT_EQ(asClass0->getProperties()[0].sTypeInfo.sBaseInfo.eKind, rg3::cpp::TypeKind::TK_TRIVIAL); ASSERT_EQ(asClass0->getProperties()[1].sName, "y"); ASSERT_EQ(asClass0->getProperties()[1].sAlias, "y"); + ASSERT_EQ(asClass0->getProperties()[1].sTypeInfo.sBaseInfo.sName, "float"); + ASSERT_EQ(asClass0->getProperties()[1].sTypeInfo.sBaseInfo.sPrettyName, "float"); + ASSERT_EQ(asClass0->getProperties()[1].sTypeInfo.sBaseInfo.eKind, rg3::cpp::TypeKind::TK_TRIVIAL); ASSERT_EQ(asClass0->getProperties()[1].sTypeInfo.sTypeRef.getRefName(), "float"); ASSERT_EQ(asClass0->getProperties()[2].sName, "z"); ASSERT_EQ(asClass0->getProperties()[2].sAlias, "z"); + ASSERT_EQ(asClass0->getProperties()[2].sTypeInfo.sBaseInfo.sName, "float"); + ASSERT_EQ(asClass0->getProperties()[2].sTypeInfo.sBaseInfo.sPrettyName, "float"); + ASSERT_EQ(asClass0->getProperties()[2].sTypeInfo.sBaseInfo.eKind, rg3::cpp::TypeKind::TK_TRIVIAL); ASSERT_EQ(asClass0->getProperties()[2].sTypeInfo.sTypeRef.getRefName(), "float"); ASSERT_EQ(asClass0->getFunctions().size(), 1); ASSERT_EQ(asClass0->getFunctions()[0].sOwnerClassName, "engine::core::Vec3"); ASSERT_EQ(asClass0->getFunctions()[0].sReturnType.sTypeRef.getRefName(), "float"); + ASSERT_EQ(asClass0->getFunctions()[0].sReturnType.sBaseInfo.sName, "float"); + ASSERT_EQ(asClass0->getFunctions()[0].sReturnType.sBaseInfo.eKind, rg3::cpp::TypeKind::TK_TRIVIAL); + ASSERT_EQ(asClass0->getFunctions()[0].sReturnType.sBaseInfo.sPrettyName, "float"); ASSERT_EQ(asClass0->getFunctions()[0].bIsConst, true); ASSERT_EQ(asClass0->getFunctions()[0].vArguments.size(), 1); ASSERT_EQ(asClass0->getFunctions()[0].vArguments[0].bHasDefaultValue, false); @@ -247,6 +268,9 @@ RegisterType> { ASSERT_EQ(asClass0->getFunctions()[0].vArguments[0].sType.sTypeRef.getRefName(), "float"); ASSERT_EQ(asClass0->getFunctions()[0].vArguments[0].sType.bIsPtrConst, true); ASSERT_EQ(asClass0->getFunctions()[0].vArguments[0].sType.bIsReference, true); + ASSERT_EQ(asClass0->getFunctions()[0].vArguments[0].sType.sBaseInfo.sName, "float"); + ASSERT_EQ(asClass0->getFunctions()[0].vArguments[0].sType.sBaseInfo.sPrettyName, "float"); + ASSERT_EQ(asClass0->getFunctions()[0].vArguments[0].sType.sBaseInfo.eKind, rg3::cpp::TypeKind::TK_TRIVIAL); // Second type ASSERT_EQ(analyzeResult.vFoundTypes[1]->getKind(), rg3::cpp::TypeKind::TK_STRUCT_OR_CLASS); @@ -258,12 +282,24 @@ RegisterType> { ASSERT_EQ(asClass1->getProperties()[0].sName, "x"); ASSERT_EQ(asClass1->getProperties()[0].sAlias, "x"); ASSERT_EQ(asClass1->getProperties()[0].sTypeInfo.sTypeRef.getRefName(), "int"); + ASSERT_EQ(asClass1->getProperties()[0].sTypeInfo.sBaseInfo.sName, "int"); + ASSERT_EQ(asClass1->getProperties()[0].sTypeInfo.sBaseInfo.sPrettyName, "int"); + ASSERT_EQ(asClass1->getProperties()[0].sTypeInfo.sBaseInfo.eKind, rg3::cpp::TypeKind::TK_TRIVIAL); + ASSERT_EQ(asClass1->getProperties()[0].sTypeInfo.sTypeRef.getRefName(), "int"); ASSERT_EQ(asClass1->getProperties()[1].sName, "y"); ASSERT_EQ(asClass1->getProperties()[1].sAlias, "y"); ASSERT_EQ(asClass1->getProperties()[1].sTypeInfo.sTypeRef.getRefName(), "int"); + ASSERT_EQ(asClass1->getProperties()[1].sTypeInfo.sBaseInfo.sName, "int"); + ASSERT_EQ(asClass1->getProperties()[1].sTypeInfo.sBaseInfo.sPrettyName, "int"); + ASSERT_EQ(asClass1->getProperties()[1].sTypeInfo.sBaseInfo.eKind, rg3::cpp::TypeKind::TK_TRIVIAL); + ASSERT_EQ(asClass1->getProperties()[1].sTypeInfo.sTypeRef.getRefName(), "int"); ASSERT_EQ(asClass1->getProperties()[2].sName, "z"); ASSERT_EQ(asClass1->getProperties()[2].sAlias, "z"); ASSERT_EQ(asClass1->getProperties()[2].sTypeInfo.sTypeRef.getRefName(), "int"); + ASSERT_EQ(asClass1->getProperties()[2].sTypeInfo.sBaseInfo.sName, "int"); + ASSERT_EQ(asClass1->getProperties()[2].sTypeInfo.sBaseInfo.sPrettyName, "int"); + ASSERT_EQ(asClass1->getProperties()[2].sTypeInfo.sBaseInfo.eKind, rg3::cpp::TypeKind::TK_TRIVIAL); + ASSERT_EQ(asClass1->getProperties()[2].sTypeInfo.sTypeRef.getRefName(), "int"); ASSERT_EQ(asClass1->getFunctions().size(), 1); ASSERT_EQ(asClass1->getFunctions()[0].sOwnerClassName, "engine::core::Vec3"); @@ -275,6 +311,9 @@ RegisterType> { ASSERT_EQ(asClass1->getFunctions()[0].vArguments[0].sType.sTypeRef.getRefName(), "int"); ASSERT_EQ(asClass1->getFunctions()[0].vArguments[0].sType.bIsPtrConst, true); ASSERT_EQ(asClass1->getFunctions()[0].vArguments[0].sType.bIsReference, true); + ASSERT_EQ(asClass1->getFunctions()[0].vArguments[0].sType.sBaseInfo.sName, "int"); + ASSERT_EQ(asClass1->getFunctions()[0].vArguments[0].sType.sBaseInfo.sPrettyName, "int"); + ASSERT_EQ(asClass1->getFunctions()[0].vArguments[0].sType.sBaseInfo.eKind, rg3::cpp::TypeKind::TK_TRIVIAL); } TEST_F(Tests_MemberFunctions, CheckMemberPropertyTypeReferenceForm) @@ -342,8 +381,24 @@ namespace engine { ASSERT_EQ(analyzeResult.vFoundTypes[0]->getPrettyName(), "cool::name::space::at::all::Vector3"); ASSERT_EQ(analyzeResult.vFoundTypes[0]->getKind(), rg3::cpp::TypeKind::TK_STRUCT_OR_CLASS); + ASSERT_EQ(analyzeResult.vFoundTypes[1]->getPrettyName(), "cool::name::space::at::all::TVector2"); ASSERT_EQ(analyzeResult.vFoundTypes[1]->getKind(), rg3::cpp::TypeKind::TK_STRUCT_OR_CLASS); + auto* asClass0 = reinterpret_cast(analyzeResult.vFoundTypes[1].get()); + ASSERT_EQ(asClass0->getProperties().size(), 2); + ASSERT_EQ(asClass0->getProperties()[0].sName, "x"); + ASSERT_EQ(asClass0->getProperties()[0].sAlias, "x"); + ASSERT_EQ(asClass0->getProperties()[0].sTypeInfo.sBaseInfo.sName, "float"); + ASSERT_EQ(asClass0->getProperties()[0].sTypeInfo.sBaseInfo.eKind, rg3::cpp::TypeKind::TK_TRIVIAL); + ASSERT_EQ(asClass0->getProperties()[0].sTypeInfo.sBaseInfo.sDefLocation.isAngledPath(), false); + ASSERT_EQ(asClass0->getProperties()[0].sTypeInfo.sBaseInfo.sDefLocation.getPath().empty(), true); + ASSERT_EQ(asClass0->getProperties()[1].sName, "y"); + ASSERT_EQ(asClass0->getProperties()[1].sAlias, "y"); + ASSERT_EQ(asClass0->getProperties()[1].sTypeInfo.sBaseInfo.sName, "float"); + ASSERT_EQ(asClass0->getProperties()[1].sTypeInfo.sBaseInfo.eKind, rg3::cpp::TypeKind::TK_TRIVIAL); + ASSERT_EQ(asClass0->getProperties()[1].sTypeInfo.sBaseInfo.sDefLocation.isAngledPath(), false); + ASSERT_EQ(asClass0->getProperties()[1].sTypeInfo.sBaseInfo.sDefLocation.getPath().empty(), true); + ASSERT_EQ(analyzeResult.vFoundTypes[2]->getPrettyName(), "engine::TransformComponent"); ASSERT_EQ(analyzeResult.vFoundTypes[2]->getKind(), rg3::cpp::TypeKind::TK_STRUCT_OR_CLASS); @@ -353,16 +408,32 @@ namespace engine { ASSERT_EQ(asClass->getProperties()[0].sName, "position"); ASSERT_EQ(asClass->getProperties()[0].sAlias, "vPos"); ASSERT_EQ(asClass->getProperties()[0].sTypeInfo.sTypeRef.getRefName(), "cool::name::space::at::all::Vector3"); + ASSERT_EQ(asClass->getProperties()[0].sTypeInfo.sBaseInfo.sName, "Vector3"); + ASSERT_EQ(asClass->getProperties()[0].sTypeInfo.sBaseInfo.sPrettyName, "cool::name::space::at::all::Vector3"); + ASSERT_EQ(asClass->getProperties()[0].sTypeInfo.sBaseInfo.eKind, rg3::cpp::TypeKind::TK_STRUCT_OR_CLASS); + ASSERT_EQ(asClass->getProperties()[0].sTypeInfo.sBaseInfo.sDefLocation.getPath(), "id0.hpp"); ASSERT_EQ(asClass->getProperties()[1].sName, "direction"); ASSERT_EQ(asClass->getProperties()[1].sAlias, "vDir"); ASSERT_EQ(asClass->getProperties()[1].sTypeInfo.sTypeRef.getRefName(), "cool::name::space::at::all::Vector3"); + ASSERT_EQ(asClass->getProperties()[1].sTypeInfo.sBaseInfo.sName, "Vector3"); + ASSERT_EQ(asClass->getProperties()[1].sTypeInfo.sBaseInfo.sPrettyName, "cool::name::space::at::all::Vector3"); + ASSERT_EQ(asClass->getProperties()[1].sTypeInfo.sBaseInfo.eKind, rg3::cpp::TypeKind::TK_STRUCT_OR_CLASS); + ASSERT_EQ(asClass->getProperties()[1].sTypeInfo.sBaseInfo.sDefLocation.getPath(), "id0.hpp"); ASSERT_EQ(asClass->getProperties()[2].sName, "up"); ASSERT_EQ(asClass->getProperties()[2].sAlias, "vUP"); ASSERT_EQ(asClass->getProperties()[2].sTypeInfo.sTypeRef.getRefName(), "cool::name::space::at::all::TVector2"); + ASSERT_EQ(asClass->getProperties()[2].sTypeInfo.sBaseInfo.sName, "TVector2"); + ASSERT_EQ(asClass->getProperties()[2].sTypeInfo.sBaseInfo.sPrettyName, "cool::name::space::at::all::TVector2"); + ASSERT_EQ(asClass->getProperties()[2].sTypeInfo.sBaseInfo.eKind, rg3::cpp::TypeKind::TK_STRUCT_OR_CLASS); + ASSERT_EQ(asClass->getProperties()[2].sTypeInfo.sBaseInfo.sDefLocation.getPath(), "id0.hpp"); ASSERT_EQ(asClass->getProperties()[3].sName, "texUV"); ASSERT_EQ(asClass->getProperties()[3].sAlias, "vTex0UV"); ASSERT_EQ(asClass->getProperties()[3].sTypeInfo.sTypeRef.getRefName(), "engine::render::Vec2I"); + ASSERT_EQ(asClass->getProperties()[3].sTypeInfo.sBaseInfo.sName, "Vec2I"); + ASSERT_EQ(asClass->getProperties()[3].sTypeInfo.sBaseInfo.sPrettyName, "engine::render::Vec2I"); + ASSERT_EQ(asClass->getProperties()[3].sTypeInfo.sBaseInfo.eKind, rg3::cpp::TypeKind::TK_STRUCT_OR_CLASS); + ASSERT_EQ(asClass->getProperties()[3].sTypeInfo.sBaseInfo.sDefLocation.getPath(), "id0.hpp"); } \ No newline at end of file