23
23
#include " Common/generated/ImplementationReportVeraPDFXsl.h"
24
24
#include " Common/generated/ImplementationReportDPFManagerXsl.h"
25
25
#include " Common/generated/ImplementationReportDisplayHtmlXsl.h"
26
+ #include " Common/generated/ImplementationReportDisplayJsonXsl.h"
26
27
#include " Common/generated/ImplementationReportDisplayCSVXsl.h"
27
28
#include " Common/generated/ImplementationReportDisplaySimpleXsl.h"
28
29
#if defined(_WIN32) || defined(WIN32)
@@ -69,6 +70,8 @@ int Reports::checker_get_report(CheckerReport& cr, MediaConchLib::Checker_Report
69
70
transform_with_xslt_text_memory (result->report , result->report );
70
71
else if (cr.format == MediaConchLib::format_Html)
71
72
transform_with_xslt_html_memory (result->report , result->report );
73
+ else if (cr.format == MediaConchLib::format_Json)
74
+ transform_with_xslt_json_memory (result->report , result->report );
72
75
else if (cr.format == MediaConchLib::format_Simple)
73
76
transform_with_xslt_simple_memory (result->report , result->report );
74
77
else if (cr.format == MediaConchLib::format_CSV)
@@ -93,6 +96,7 @@ int Reports::checker_get_report(CheckerReport& cr, MediaConchLib::Checker_Report
93
96
case MediaConchLib::format_Xml:
94
97
case MediaConchLib::format_MaXml:
95
98
case MediaConchLib::format_Html:
99
+ case MediaConchLib::format_Json:
96
100
case MediaConchLib::format_OrigXml:
97
101
case MediaConchLib::format_Simple:
98
102
case MediaConchLib::format_CSV:
@@ -280,6 +284,8 @@ int Reports::get_reports_output(int user, const std::vector<long>& files,
280
284
{
281
285
// No transformation for XML
282
286
}
287
+ else if (f == MediaConchLib::format_Json)
288
+ transform_with_xslt_json_memory (tmp, tmp);
283
289
else if (f == MediaConchLib::format_Simple)
284
290
transform_with_xslt_simple_memory (tmp, tmp);
285
291
else if (f == MediaConchLib::format_CSV)
@@ -335,6 +341,8 @@ int Reports::get_reports_output(int user, const std::vector<long>& files,
335
341
{
336
342
if (f == MediaConchLib::format_Html)
337
343
transform_with_xslt_html_memory (transformed, transformed);
344
+ else if (f == MediaConchLib::format_Json)
345
+ transform_with_xslt_json_memory (transformed, transformed);
338
346
else if (f == MediaConchLib::format_Simple)
339
347
transform_with_xslt_simple_memory (transformed, transformed);
340
348
else if (f == MediaConchLib::format_CSV)
@@ -380,7 +388,9 @@ int Reports::get_reports_output(int user, const std::vector<long>& files,
380
388
{
381
389
if (f == MediaConchLib::format_Html)
382
390
transform_with_xslt_html_memory (transformed, transformed);
383
- if (f == MediaConchLib::format_Simple)
391
+ else if (f == MediaConchLib::format_Json)
392
+ transform_with_xslt_json_memory (transformed, transformed);
393
+ else if (f == MediaConchLib::format_Simple)
384
394
transform_with_xslt_simple_memory (transformed, transformed);
385
395
else if (f == MediaConchLib::format_CSV)
386
396
transform_with_xslt_csv_memory (transformed, transformed);
@@ -416,7 +426,9 @@ int Reports::get_reports_output(int user, const std::vector<long>& files,
416
426
{
417
427
if (f == MediaConchLib::format_Html)
418
428
transform_with_xslt_html_memory (report, report);
419
- if (f == MediaConchLib::format_Simple)
429
+ else if (f == MediaConchLib::format_Json)
430
+ transform_with_xslt_json_memory (report, report);
431
+ else if (f == MediaConchLib::format_Simple)
420
432
transform_with_xslt_simple_memory (report, report);
421
433
else if (f == MediaConchLib::format_CSV)
422
434
transform_with_xslt_csv_memory (report, report);
@@ -1315,6 +1327,14 @@ int Reports::transform_with_xslt_html_memory(const std::string& report, std::str
1315
1327
return transform_with_xslt_memory (report, memory, opts, result);
1316
1328
}
1317
1329
1330
+ // ---------------------------------------------------------------------------
1331
+ int Reports::transform_with_xslt_json_memory (const std::string& report, std::string& result)
1332
+ {
1333
+ std::map<std::string, std::string> opts;
1334
+ std::string memory (implementation_report_display_json_xsl);
1335
+ return transform_with_xslt_memory (report, memory, opts, result);
1336
+ }
1337
+
1318
1338
// ---------------------------------------------------------------------------
1319
1339
int Reports::transform_with_xslt_simple_memory (const std::string& report, std::string& result)
1320
1340
{
0 commit comments