MCPcopy Create free account
hub / github.com/beefytech/Beef / GetTypeDefInfo

Method GetTypeDefInfo

IDEHelper/Compiler/BfCompiler.cpp:9600–9647  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

9598}
9599
9600String BfCompiler::GetTypeDefInfo(const StringImpl& inTypeName)
9601{
9602 Array<BfTypeDef*> typeDefs;
9603 GetTypeDefs(inTypeName, typeDefs);
9604
9605 String result;
9606 TypeDefMatchHelper matchHelper(result);
9607
9608 for (auto typeDef : typeDefs)
9609 {
9610 auto refNode = typeDef->GetRefNode();
9611 result += "S";
9612 matchHelper.AddLocation(refNode);
9613 result += "\n";
9614
9615 for (auto fieldDef : typeDef->mFields)
9616 {
9617 result += "F";
9618 result += fieldDef->mName;
9619 matchHelper.AddFieldDef(fieldDef);
9620 }
9621
9622 for (auto propDef : typeDef->mProperties)
9623 {
9624 if (propDef->GetRefNode() == NULL)
9625 continue;
9626
9627 result += "P";
9628 matchHelper.AddPropertyDef(typeDef, propDef);
9629 }
9630
9631 for (auto methodDef : typeDef->mMethods)
9632 {
9633 if ((methodDef->mMethodType != BfMethodType_Normal) &&
9634 (methodDef->mMethodType != BfMethodType_Mixin) &&
9635 (methodDef->mMethodType != BfMethodType_Ctor) &&
9636 (methodDef->mMethodType != BfMethodType_Dtor))
9637 continue;
9638
9639 if (methodDef->mMethodDeclaration == NULL)
9640 continue;
9641
9642 result += "M";
9643 matchHelper.AddMethodDef(methodDef);
9644 }
9645 }
9646 return result;
9647}
9648
9649int BfCompiler::GetTypeId(const StringImpl& typeName)
9650{

Callers 1

Calls 5

AddLocationMethod · 0.80
AddFieldDefMethod · 0.80
AddPropertyDefMethod · 0.80
AddMethodDefMethod · 0.80
GetRefNodeMethod · 0.45

Tested by

no test coverage detected