blob: 022ee13d165b413a5bae62fa5e7461432b0ab5a9 [file] [log] [blame]
Ed Tanous57fce802019-05-21 13:00:34 -07001#include <nlohmann/json.hpp>
2
3#include <algorithm>
4
5namespace json_html_util
6{
7
8static constexpr uint8_t utf8Accept = 0;
9static constexpr uint8_t utf8Reject = 1;
10
11inline uint8_t decode(uint8_t& state, uint32_t& codePoint,
12 const uint8_t byte) noexcept
13{
14 // clang-format off
15 static const std::array<std::uint8_t, 400> utf8d =
16 {
17 {
18 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 00..1F
19 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 20..3F
20 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 40..5F
21 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 60..7F
22 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, // 80..9F
23 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, // A0..BF
24 8, 8, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, // C0..DF
25 0xA, 0x3, 0x3, 0x3, 0x3, 0x3, 0x3, 0x3, 0x3, 0x3, 0x3, 0x3, 0x3, 0x4, 0x3, 0x3, // E0..EF
26 0xB, 0x6, 0x6, 0x6, 0x5, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, // F0..FF
27 0x0, 0x1, 0x2, 0x3, 0x5, 0x8, 0x7, 0x1, 0x1, 0x1, 0x4, 0x6, 0x1, 0x1, 0x1, 0x1, // s0..s0
28 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, // s1..s2
29 1, 2, 1, 1, 1, 1, 1, 2, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, // s3..s4
30 1, 2, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, 1, 3, 1, 1, 1, 1, 1, 1, // s5..s6
31 1, 3, 1, 1, 1, 1, 1, 3, 1, 3, 1, 1, 1, 1, 1, 1, 1, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 // s7..s8
32 }
33 };
34 // clang-format on
35
36 if (state > 0x8)
37 {
38 return state;
39 }
40
41 const uint8_t type = utf8d[byte];
42
43 codePoint = (state != utf8Accept)
Ed Tanousdbb59d42022-01-25 11:09:55 -080044 ? (byte & 0x3fU) | (codePoint << 6)
Ed Tanous57fce802019-05-21 13:00:34 -070045 : static_cast<uint32_t>(0xff >> type) & (byte);
46
Ed Tanousdbb59d42022-01-25 11:09:55 -080047 state = utf8d[256U + state * 16U + type];
Ed Tanous57fce802019-05-21 13:00:34 -070048 return state;
49}
50
51inline void dumpEscaped(std::string& out, const std::string& str)
52{
53 std::array<char, 512> stringBuffer{{}};
54 uint32_t codePoint = 0;
55 uint8_t state = utf8Accept;
56 std::size_t bytes = 0; // number of bytes written to string_buffer
57
58 // number of bytes written at the point of the last valid byte
Ed Tanous2c70f802020-09-28 14:29:23 -070059 std::size_t bytesAfterLastAccept = 0;
Ed Tanous57fce802019-05-21 13:00:34 -070060 std::size_t undumpedChars = 0;
61
62 for (std::size_t i = 0; i < str.size(); ++i)
63 {
64 const uint8_t byte = static_cast<uint8_t>(str[i]);
65
66 switch (decode(state, codePoint, byte))
67 {
68 case utf8Accept: // decode found a new code point
69 {
70 switch (codePoint)
71 {
72 case 0x08: // backspace
73 {
74 stringBuffer[bytes++] = '\\';
75 stringBuffer[bytes++] = 'b';
76 break;
77 }
78
79 case 0x09: // horizontal tab
80 {
81 stringBuffer[bytes++] = '\\';
82 stringBuffer[bytes++] = 't';
83 break;
84 }
85
86 case 0x0A: // newline
87 {
88 stringBuffer[bytes++] = '\\';
89 stringBuffer[bytes++] = 'n';
90 break;
91 }
92
93 case 0x0C: // formfeed
94 {
95 stringBuffer[bytes++] = '\\';
96 stringBuffer[bytes++] = 'f';
97 break;
98 }
99
100 case 0x0D: // carriage return
101 {
102 stringBuffer[bytes++] = '\\';
103 stringBuffer[bytes++] = 'r';
104 break;
105 }
106
107 case 0x22: // quotation mark
108 {
109 stringBuffer[bytes++] = '&';
110 stringBuffer[bytes++] = 'q';
111 stringBuffer[bytes++] = 'u';
112 stringBuffer[bytes++] = 'o';
113 stringBuffer[bytes++] = 't';
114 stringBuffer[bytes++] = ';';
115 break;
116 }
117
118 case 0x27: // apostrophe
119 {
120 stringBuffer[bytes++] = '&';
121 stringBuffer[bytes++] = 'a';
122 stringBuffer[bytes++] = 'p';
123 stringBuffer[bytes++] = 'o';
124 stringBuffer[bytes++] = 's';
125 stringBuffer[bytes++] = ';';
126 break;
127 }
128
129 case 0x26: // ampersand
130 {
131 stringBuffer[bytes++] = '&';
132 stringBuffer[bytes++] = 'a';
133 stringBuffer[bytes++] = 'm';
134 stringBuffer[bytes++] = 'p';
135 stringBuffer[bytes++] = ';';
136 break;
137 }
138
139 case 0x3C: // less than
140 {
141 stringBuffer[bytes++] = '\\';
142 stringBuffer[bytes++] = 'l';
143 stringBuffer[bytes++] = 't';
144 stringBuffer[bytes++] = ';';
145 break;
146 }
147
148 case 0x3E: // greater than
149 {
150 stringBuffer[bytes++] = '\\';
151 stringBuffer[bytes++] = 'g';
152 stringBuffer[bytes++] = 't';
153 stringBuffer[bytes++] = ';';
154 break;
155 }
156
157 default:
158 {
159 // escape control characters (0x00..0x1F)
160 if ((codePoint <= 0x1F) or (codePoint >= 0x7F))
161 {
162 if (codePoint <= 0xFFFF)
163 {
Ed Tanous49d1eea2022-01-07 09:39:33 -0800164 // NOLINTNEXTLINE(cppcoreguidelines-pro-type-vararg)
165 std::snprintf(stringBuffer.data() + bytes, 7,
166 "\\u%04x",
167 static_cast<uint16_t>(codePoint));
Ed Tanous57fce802019-05-21 13:00:34 -0700168 bytes += 6;
169 }
170 else
171 {
Ed Tanous49d1eea2022-01-07 09:39:33 -0800172 // NOLINTNEXTLINE(cppcoreguidelines-pro-type-vararg)
173 std::snprintf(
Ed Tanous57fce802019-05-21 13:00:34 -0700174 stringBuffer.data() + bytes, 13,
175 "\\u%04x\\u%04x",
176 static_cast<uint16_t>(0xD7C0 +
177 (codePoint >> 10)),
178 static_cast<uint16_t>(0xDC00 +
179 (codePoint & 0x3FF)));
180 bytes += 12;
181 }
182 }
183 else
184 {
185 // copy byte to buffer (all previous bytes
186 // been copied have in default case above)
187 stringBuffer[bytes++] = str[i];
188 }
189 break;
190 }
191 }
192
193 // write buffer and reset index; there must be 13 bytes
194 // left, as this is the maximal number of bytes to be
195 // written ("\uxxxx\uxxxx\0") for one code point
196 if (stringBuffer.size() - bytes < 13)
197 {
198 out.append(stringBuffer.data(), bytes);
199 bytes = 0;
200 }
201
202 // remember the byte position of this accept
Ed Tanous2c70f802020-09-28 14:29:23 -0700203 bytesAfterLastAccept = bytes;
Ed Tanous57fce802019-05-21 13:00:34 -0700204 undumpedChars = 0;
205 break;
206 }
207
208 case utf8Reject: // decode found invalid UTF-8 byte
209 {
210 // in case we saw this character the first time, we
211 // would like to read it again, because the byte
212 // may be OK for itself, but just not OK for the
213 // previous sequence
214 if (undumpedChars > 0)
215 {
216 --i;
217 }
218
219 // reset length buffer to the last accepted index;
220 // thus removing/ignoring the invalid characters
Ed Tanous2c70f802020-09-28 14:29:23 -0700221 bytes = bytesAfterLastAccept;
Ed Tanous57fce802019-05-21 13:00:34 -0700222
223 stringBuffer[bytes++] = '\\';
224 stringBuffer[bytes++] = 'u';
225 stringBuffer[bytes++] = 'f';
226 stringBuffer[bytes++] = 'f';
227 stringBuffer[bytes++] = 'f';
228 stringBuffer[bytes++] = 'd';
229
Ed Tanous2c70f802020-09-28 14:29:23 -0700230 bytesAfterLastAccept = bytes;
Ed Tanous57fce802019-05-21 13:00:34 -0700231
232 undumpedChars = 0;
233
234 // continue processing the string
235 state = utf8Accept;
236 break;
237
238 break;
239 }
240
241 default: // decode found yet incomplete multi-byte code point
242 {
243 ++undumpedChars;
244 break;
245 }
246 }
247 }
248
249 // we finished processing the string
250 if (state == utf8Accept)
251 {
252 // write buffer
253 if (bytes > 0)
254 {
255 out.append(stringBuffer.data(), bytes);
256 }
257 }
258 else
259 {
260 // write all accepted bytes
Ed Tanous2c70f802020-09-28 14:29:23 -0700261 out.append(stringBuffer.data(), bytesAfterLastAccept);
Ed Tanous57fce802019-05-21 13:00:34 -0700262 out += "\\ufffd";
263 }
264}
265
266inline unsigned int countDigits(uint64_t number) noexcept
267{
Ed Tanous2c70f802020-09-28 14:29:23 -0700268 unsigned int nDigits = 1;
Ed Tanous57fce802019-05-21 13:00:34 -0700269 for (;;)
270 {
271 if (number < 10)
272 {
Ed Tanous2c70f802020-09-28 14:29:23 -0700273 return nDigits;
Ed Tanous57fce802019-05-21 13:00:34 -0700274 }
275 if (number < 100)
276 {
Ed Tanous2c70f802020-09-28 14:29:23 -0700277 return nDigits + 1;
Ed Tanous57fce802019-05-21 13:00:34 -0700278 }
279 if (number < 1000)
280 {
Ed Tanous2c70f802020-09-28 14:29:23 -0700281 return nDigits + 2;
Ed Tanous57fce802019-05-21 13:00:34 -0700282 }
283 if (number < 10000)
284 {
Ed Tanous2c70f802020-09-28 14:29:23 -0700285 return nDigits + 3;
Ed Tanous57fce802019-05-21 13:00:34 -0700286 }
Ed Tanousdbb59d42022-01-25 11:09:55 -0800287 number = number / 10000U;
Ed Tanous2c70f802020-09-28 14:29:23 -0700288 nDigits += 4;
Ed Tanous57fce802019-05-21 13:00:34 -0700289 }
290}
291
292template <typename NumberType,
293 std::enable_if_t<std::is_same<NumberType, uint64_t>::value or
294 std::is_same<NumberType, int64_t>::value,
295 int> = 0>
296void dumpInteger(std::string& out, NumberType number)
297{
298 std::array<char, 64> numberbuffer{{}};
299
Ed Tanous2c70f802020-09-28 14:29:23 -0700300 static constexpr std::array<std::array<char, 2>, 100> digitsTo99{{
Ed Tanous57fce802019-05-21 13:00:34 -0700301 {'0', '0'}, {'0', '1'}, {'0', '2'}, {'0', '3'}, {'0', '4'}, {'0', '5'},
302 {'0', '6'}, {'0', '7'}, {'0', '8'}, {'0', '9'}, {'1', '0'}, {'1', '1'},
303 {'1', '2'}, {'1', '3'}, {'1', '4'}, {'1', '5'}, {'1', '6'}, {'1', '7'},
304 {'1', '8'}, {'1', '9'}, {'2', '0'}, {'2', '1'}, {'2', '2'}, {'2', '3'},
305 {'2', '4'}, {'2', '5'}, {'2', '6'}, {'2', '7'}, {'2', '8'}, {'2', '9'},
306 {'3', '0'}, {'3', '1'}, {'3', '2'}, {'3', '3'}, {'3', '4'}, {'3', '5'},
307 {'3', '6'}, {'3', '7'}, {'3', '8'}, {'3', '9'}, {'4', '0'}, {'4', '1'},
308 {'4', '2'}, {'4', '3'}, {'4', '4'}, {'4', '5'}, {'4', '6'}, {'4', '7'},
309 {'4', '8'}, {'4', '9'}, {'5', '0'}, {'5', '1'}, {'5', '2'}, {'5', '3'},
310 {'5', '4'}, {'5', '5'}, {'5', '6'}, {'5', '7'}, {'5', '8'}, {'5', '9'},
311 {'6', '0'}, {'6', '1'}, {'6', '2'}, {'6', '3'}, {'6', '4'}, {'6', '5'},
312 {'6', '6'}, {'6', '7'}, {'6', '8'}, {'6', '9'}, {'7', '0'}, {'7', '1'},
313 {'7', '2'}, {'7', '3'}, {'7', '4'}, {'7', '5'}, {'7', '6'}, {'7', '7'},
314 {'7', '8'}, {'7', '9'}, {'8', '0'}, {'8', '1'}, {'8', '2'}, {'8', '3'},
315 {'8', '4'}, {'8', '5'}, {'8', '6'}, {'8', '7'}, {'8', '8'}, {'8', '9'},
316 {'9', '0'}, {'9', '1'}, {'9', '2'}, {'9', '3'}, {'9', '4'}, {'9', '5'},
317 {'9', '6'}, {'9', '7'}, {'9', '8'}, {'9', '9'},
318 }};
319
320 // special case for "0"
321 if (number == 0)
322 {
323 out += '0';
324 return;
325 }
326
327 // use a pointer to fill the buffer
328 auto bufferPtr = begin(numberbuffer);
329
330 const bool isNegative = std::is_same<NumberType, int64_t>::value &&
331 !(number >= 0); // see issue #755
Ed Tanous543f4402022-01-06 13:12:53 -0800332 uint64_t absValue = 0;
Ed Tanous57fce802019-05-21 13:00:34 -0700333
Ed Tanous543f4402022-01-06 13:12:53 -0800334 unsigned int nChars = 0;
Ed Tanous57fce802019-05-21 13:00:34 -0700335
336 if (isNegative)
337 {
338 *bufferPtr = '-';
339 absValue = static_cast<uint64_t>(0 - number);
340
341 // account one more byte for the minus sign
342 nChars = 1 + countDigits(absValue);
343 }
344 else
345 {
346 absValue = static_cast<uint64_t>(number);
347 nChars = countDigits(absValue);
348 }
349
350 // spare 1 byte for '\0'
351 if (nChars >= numberbuffer.size() - 1)
352 {
353 return;
354 }
355
356 // jump to the end to generate the string from backward
357 // so we later avoid reversing the result
Ed Tanousca45aa32022-01-07 09:28:45 -0800358 // NOLINTNEXTLINE(cppcoreguidelines-pro-bounds-pointer-arithmetic)
Ed Tanous57fce802019-05-21 13:00:34 -0700359 bufferPtr += nChars;
360
361 // Fast int2ascii implementation inspired by "Fastware" talk by Andrei
362 // Alexandrescu See: https://www.youtube.com/watch?v=o4-CwDo2zpg
363 while (absValue >= 100)
364 {
365 const auto digitsIndex = static_cast<unsigned>((absValue % 100));
366 absValue /= 100;
Ed Tanous2c70f802020-09-28 14:29:23 -0700367 *(--bufferPtr) = digitsTo99[digitsIndex][1];
368 *(--bufferPtr) = digitsTo99[digitsIndex][0];
Ed Tanous57fce802019-05-21 13:00:34 -0700369 }
370
371 if (absValue >= 10)
372 {
373 const auto digitsIndex = static_cast<unsigned>(absValue);
Ed Tanous2c70f802020-09-28 14:29:23 -0700374 *(--bufferPtr) = digitsTo99[digitsIndex][1];
375 *(--bufferPtr) = digitsTo99[digitsIndex][0];
Ed Tanous57fce802019-05-21 13:00:34 -0700376 }
377 else
378 {
379 *(--bufferPtr) = static_cast<char>('0' + absValue);
380 }
381
382 out.append(numberbuffer.data(), nChars);
383}
384
385inline void dumpfloat(std::string& out, double number,
386 std::true_type /*isIeeeSingleOrDouble*/)
387{
388 std::array<char, 64> numberbuffer{{}};
389 char* begin = numberbuffer.data();
Ed Tanousca45aa32022-01-07 09:28:45 -0800390
391 // NOLINTNEXTLINE(cppcoreguidelines-pro-bounds-pointer-arithmetic)
Ed Tanous57fce802019-05-21 13:00:34 -0700392 ::nlohmann::detail::to_chars(begin, begin + numberbuffer.size(), number);
393
394 out += begin;
395}
396
397inline void dumpfloat(std::string& out, double number,
398 std::false_type /*isIeeeSingleOrDouble*/)
399{
400 std::array<char, 64> numberbuffer{{}};
401 // get number of digits for a float -> text -> float round-trip
402 static constexpr auto d = std::numeric_limits<double>::max_digits10;
403
404 // the actual conversion
Ed Tanous49d1eea2022-01-07 09:39:33 -0800405 // NOLINTNEXTLINE(cppcoreguidelines-pro-type-vararg)
Ed Tanous3c2a8d02021-09-22 10:07:25 -0700406 std::ptrdiff_t len = std::snprintf(numberbuffer.data(), numberbuffer.size(),
407 "%.*g", d, number);
Ed Tanous57fce802019-05-21 13:00:34 -0700408
409 // negative value indicates an error
410 if (len <= 0)
411 {
412 return;
413 }
414
415 // check if buffer was large enough
416 if (numberbuffer.size() < static_cast<std::size_t>(len))
417 {
418 return;
419 }
420
421 const auto end =
422 std::remove(numberbuffer.begin(), numberbuffer.begin() + len, ',');
423 std::fill(end, numberbuffer.end(), '\0');
424
425 if ((end - numberbuffer.begin()) > len)
426 {
427 return;
428 }
429 len = (end - numberbuffer.begin());
430
431 out.append(numberbuffer.data(), static_cast<std::size_t>(len));
432
433 // determine if need to append ".0"
434 const bool valueIsIntLike =
435 std::none_of(numberbuffer.begin(), numberbuffer.begin() + len + 1,
436 [](char c) { return (c == '.' or c == 'e'); });
437
438 if (valueIsIntLike)
439 {
440 out += ".0";
441 }
442}
443
444inline void dumpfloat(std::string& out, double number)
445{
446 // NaN / inf
447 if (!std::isfinite(number))
448 {
449 out += "null";
450 return;
451 }
452
453 // If float is an IEEE-754 single or double precision number,
454 // use the Grisu2 algorithm to produce short numbers which are
455 // guaranteed to round-trip, using strtof and strtod, resp.
456 //
457 // NB: The test below works if <long double> == <double>.
458 static constexpr bool isIeeeSingleOrDouble =
459 (std::numeric_limits<double>::is_iec559 and
460 std::numeric_limits<double>::digits == 24 and
461 std::numeric_limits<double>::max_exponent == 128) or
462 (std::numeric_limits<double>::is_iec559 and
463 std::numeric_limits<double>::digits == 53 and
464 std::numeric_limits<double>::max_exponent == 1024);
465
466 dumpfloat(out, number,
467 std::integral_constant<bool, isIeeeSingleOrDouble>());
468}
469
470inline void dump(std::string& out, const nlohmann::json& val)
471{
472 switch (val.type())
473 {
474 case nlohmann::json::value_t::object:
475 {
476 if (val.empty())
477 {
478 out += "{}";
479 return;
480 }
481
482 out += "{";
483
484 out += "<div class=tab>";
485 for (auto i = val.begin(); i != val.end();)
486 {
487 out += "&quot";
488 dumpEscaped(out, i.key());
489 out += "&quot: ";
490
491 bool inATag = false;
492 if (i.key() == "@odata.id" || i.key() == "@odata.context" ||
493 i.key() == "Members@odata.nextLink" || i.key() == "Uri")
494 {
495 inATag = true;
496 out += "<a href=\"";
497 dumpEscaped(out, i.value());
498 out += "\">";
499 }
500 dump(out, i.value());
501 if (inATag)
502 {
503 out += "</a>";
504 }
505 i++;
506 if (i != val.end())
507 {
508 out += ",";
509 }
510 out += "<br>";
511 }
512 out += "</div>";
513 out += '}';
514
515 return;
516 }
517
518 case nlohmann::json::value_t::array:
519 {
520 if (val.empty())
521 {
522 out += "[]";
523 return;
524 }
525
526 out += "[";
527
528 out += "<div class=tab>";
529
530 // first n-1 elements
531 for (auto i = val.cbegin(); i != val.cend() - 1; ++i)
532 {
533 dump(out, *i);
534 out += ",<br>";
535 }
536
537 // last element
538 dump(out, val.back());
539
540 out += "</div>";
541 out += ']';
542
543 return;
544 }
545
546 case nlohmann::json::value_t::string:
547 {
548 out += '\"';
549 const std::string* ptr = val.get_ptr<const std::string*>();
550 dumpEscaped(out, *ptr);
551 out += '\"';
552 return;
553 }
554
555 case nlohmann::json::value_t::boolean:
556 {
557 if (*(val.get_ptr<const bool*>()))
558 {
559 out += "true";
560 }
561 else
562 {
563 out += "false";
564 }
565 return;
566 }
567
568 case nlohmann::json::value_t::number_integer:
569 {
570 dumpInteger(out, *(val.get_ptr<const int64_t*>()));
571 return;
572 }
573
574 case nlohmann::json::value_t::number_unsigned:
575 {
576 dumpInteger(out, *(val.get_ptr<const uint64_t*>()));
577 return;
578 }
579
580 case nlohmann::json::value_t::number_float:
581 {
582 dumpfloat(out, *(val.get_ptr<const double*>()));
583 return;
584 }
585
586 case nlohmann::json::value_t::discarded:
587 {
588 out += "<discarded>";
589 return;
590 }
591
592 case nlohmann::json::value_t::null:
593 {
594 out += "null";
595 return;
596 }
Ed Tanous3e4c7792020-09-25 08:12:41 -0700597 case nlohmann::json::value_t::binary:
598 {
599 // Do nothing; Should never happen.
600 return;
601 }
Ed Tanous57fce802019-05-21 13:00:34 -0700602 }
603}
604
605inline void dumpHtml(std::string& out, const nlohmann::json& json)
606{
607 out += "<html>\n"
608 "<head>\n"
609 "<title>Redfish API</title>\n"
610 "<link href=\"/redfish.css\" rel=\"stylesheet\">\n"
611 "</head>\n"
612 "<body>\n"
613 "<div class=\"container\">\n"
614 "<img src=\"/DMTF_Redfish_logo_2017.svg\" alt=\"redfish\" "
615 "height=\"406px\" "
616 "width=\"576px\">\n"
617 "<div class=\"content\">\n";
618 dump(out, json);
619 out += "</div>\n"
620 "</div>\n"
621 "</body>\n"
622 "</html>\n";
623}
624
625} // namespace json_html_util