added json to SPF_GetArrayLinks
This commit is contained in:
@@ -1,3 +1,3 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#define VERSION_SPF "2420"
|
#define VERSION_SPF "2421"
|
||||||
|
|||||||
@@ -1158,8 +1158,6 @@ int SPF_GetArrayLinks(void*& context, int winHandler, short *options, short *pro
|
|||||||
{
|
{
|
||||||
runPassesForVisualizer(projName, { CALL_GRAPH2 } );
|
runPassesForVisualizer(projName, { CALL_GRAPH2 } );
|
||||||
|
|
||||||
string resVal = "";
|
|
||||||
|
|
||||||
map<DIST::Array*, set<DIST::Array*>> linkedArrays;
|
map<DIST::Array*, set<DIST::Array*>> linkedArrays;
|
||||||
for (auto& inMap : arrayLinksByFuncCalls)
|
for (auto& inMap : arrayLinksByFuncCalls)
|
||||||
{
|
{
|
||||||
@@ -1173,17 +1171,24 @@ int SPF_GetArrayLinks(void*& context, int winHandler, short *options, short *pro
|
|||||||
linkedArrays[ref].insert(toAdd);
|
linkedArrays[ref].insert(toAdd);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
json links;
|
||||||
|
json allLinks = json::array();
|
||||||
|
|
||||||
for (auto& array : linkedArrays)
|
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)
|
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] == '|')
|
string resVal = allLinks.dump();
|
||||||
resVal.erase(resVal.size() - 1);
|
|
||||||
|
|
||||||
copyStringToShort(result, resVal);
|
copyStringToShort(result, resVal);
|
||||||
retSize = (int)resVal.size() + 1;
|
retSize = (int)resVal.size() + 1;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user