MCPcopy Create free account
hub / github.com/davisking/dlib / number

Method number

dlib/cpp_pretty_printer/cpp_pretty_printer_kernel_2.h:451–483  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

449 typename tok
450 >
451 void cpp_pretty_printer_kernel_2<stack,tok>::
452 number (
453 std::istream& in,
454 std::ostream& out
455 ) const
456 {
457 if (!out)
458 throw std::ios::failure("error occurred in cpp_pretty_printer_kernel_2::number");
459
460 std::string space = "&nbsp;&nbsp;&nbsp;";
461 std::ios::int_type ch;
462 unsigned long count = 1;
463 while ((ch=in.get()) != EOF)
464 {
465 if (ch != '\n')
466 {
467 out << (char)ch;
468 }
469 else
470 {
471 out << "\n<i><font face='Courier New'>" << count << " </font></i> " + space;
472 ++count;
473 if (count == 10)
474 space = "&nbsp;&nbsp;";
475 if (count == 100)
476 space = "&nbsp;";
477 if (count == 1000)
478 space = "";
479 }
480 }
481 if (!out)
482 throw std::ios::failure("error occurred in cpp_pretty_printer_kernel_2::number");
483 }
484
485// ----------------------------------------------------------------------------------------
486

Callers

nothing calls this directly

Calls 1

getMethod · 0.45

Tested by

no test coverage detected