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

Method number

dlib/cpp_pretty_printer/cpp_pretty_printer_kernel_1.h:514–546  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

512 typename tok
513 >
514 void cpp_pretty_printer_kernel_1<stack,tok>::
515 number (
516 std::istream& in,
517 std::ostream& out
518 ) const
519 {
520 if (!out)
521 throw std::ios::failure("error occurred in cpp_pretty_printer_kernel_1::number");
522
523 std::string space = "&nbsp;&nbsp;&nbsp;";
524 std::ios::int_type ch;
525 unsigned long count = 1;
526 while ((ch=in.get()) != EOF)
527 {
528 if (ch != '\n')
529 {
530 out << (char)ch;
531 }
532 else
533 {
534 out << "\n<font color='555555'>" << count << " </font> " + space;
535 ++count;
536 if (count == 10)
537 space = "&nbsp;&nbsp;";
538 if (count == 100)
539 space = "&nbsp;";
540 if (count == 1000)
541 space = "";
542 }
543 }
544 if (!out)
545 throw std::ios::failure("error occurred in cpp_pretty_printer_kernel_1::number");
546 }
547
548// ----------------------------------------------------------------------------------------
549

Callers

nothing calls this directly

Calls 1

getMethod · 0.45

Tested by

no test coverage detected