added json to SPF_GetArrayLinks
This commit is contained in:
@@ -1158,8 +1158,6 @@ int SPF_GetArrayLinks(void*& context, int winHandler, short *options, short *pro
|
||||
{
|
||||
runPassesForVisualizer(projName, { CALL_GRAPH2 } );
|
||||
|
||||
string resVal = "";
|
||||
|
||||
map<DIST::Array*, set<DIST::Array*>> linkedArrays;
|
||||
for (auto& inMap : arrayLinksByFuncCalls)
|
||||
{
|
||||
@@ -1173,17 +1171,24 @@ int SPF_GetArrayLinks(void*& context, int winHandler, short *options, short *pro
|
||||
linkedArrays[ref].insert(toAdd);
|
||||
}
|
||||
|
||||
json links;
|
||||
json allLinks = json::array();
|
||||
|
||||
for (auto& array : linkedArrays)
|
||||
{
|
||||
resVal += to_string(array.first->GetId()) + "|" + to_string(array.second.size()) + "|";
|
||||
json currLink;
|
||||
currLink["id"] = array.first->GetId();
|
||||
|
||||
json links = json::array();
|
||||
for (auto& link : array.second)
|
||||
resVal += to_string(link->GetId()) + "|";
|
||||
links.push_back(link->GetId());
|
||||
currLink["links"] = links;
|
||||
|
||||
allLinks.push_back(currLink);
|
||||
}
|
||||
links["allLinks"] = allLinks;
|
||||
|
||||
if (resVal[resVal.size() - 1] == '|')
|
||||
resVal.erase(resVal.size() - 1);
|
||||
|
||||
string resVal = allLinks.dump();
|
||||
copyStringToShort(result, resVal);
|
||||
retSize = (int)resVal.size() + 1;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user