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

Method number

dlib/cpp_pretty_printer/cpp_pretty_printer_kernel_2.h:460–492  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 1

getMethod · 0.45

Tested by

no test coverage detected