added json for line info
This commit is contained in:
@@ -1,3 +1,3 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#define VERSION_SPF "2410"
|
#define VERSION_SPF "2411"
|
||||||
|
|||||||
@@ -1464,18 +1464,32 @@ int SPF_GetFileLineInfo(void*& context, int winHandler, short *options, short *p
|
|||||||
{
|
{
|
||||||
runPassesForVisualizer(projName, { FILE_LINE_INFO });
|
runPassesForVisualizer(projName, { FILE_LINE_INFO });
|
||||||
|
|
||||||
string resVal = "";
|
json metric_array = json::array();
|
||||||
for (auto it = lineInfo.begin(); it != lineInfo.end(); ++it)
|
for (const auto& fileInfo : lineInfo)
|
||||||
{
|
{
|
||||||
if (it != lineInfo.begin())
|
json fileMetric;
|
||||||
resVal += "@";
|
|
||||||
|
|
||||||
auto itD = dirsInfo.find(it->first);
|
fileMetric["file"] = fileInfo.first;
|
||||||
if (itD == dirsInfo.end())
|
fileMetric["linesCount"] = fileInfo.second;
|
||||||
resVal += it->first + "@" + to_string(it->second) + "_0_0";
|
|
||||||
else
|
auto it = dirsInfo.find(fileInfo.first);
|
||||||
resVal += it->first + "@" + to_string(it->second) + "_" + to_string(itD->second.first.size()) + "_" + to_string(itD->second.second.size());
|
if (it == dirsInfo.end())
|
||||||
|
{
|
||||||
|
fileMetric["numSPF"] = 0;
|
||||||
|
fileMetric["numDVM"] = 0;
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
fileMetric["numSPF"] = (int)it->second.first.size();
|
||||||
|
fileMetric["numDVM"] = (int)it->second.second.size();
|
||||||
|
}
|
||||||
|
|
||||||
|
metric_array.push_back(fileMetric);
|
||||||
|
}
|
||||||
|
|
||||||
|
json allMetrics;
|
||||||
|
allMetrics["allMetrics"] = metric_array;
|
||||||
|
string resVal = allMetrics.dump();
|
||||||
|
|
||||||
copyStringToShort(result, resVal);
|
copyStringToShort(result, resVal);
|
||||||
retSize = (int)resVal.size() + 1;
|
retSize = (int)resVal.size() + 1;
|
||||||
|
|||||||
Reference in New Issue
Block a user