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

Method number

dlib/cpp_pretty_printer/cpp_pretty_printer_kernel_1.h:537–569  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

535 typename tok
536 >
537 void cpp_pretty_printer_kernel_1<stack,tok>::
538 number (
539 std::istream& in,
540 std::ostream& out
541 ) const
542 {
543 if (!out)
544 throw std::ios::failure("error occurred in cpp_pretty_printer_kernel_1::number");
545
546 std::string space = "&nbsp;&nbsp;&nbsp;";
547 std::ios::int_type ch;
548 unsigned long count = 1;
549 while ((ch=in.get()) != EOF)
550 {
551 if (ch != '\n')
552 {
553 out << (char)ch;
554 }
555 else
556 {
557 out << "\n<font color='555555'>" << count << " </font> " + space;
558 ++count;
559 if (count == 10)
560 space = "&nbsp;&nbsp;";
561 if (count == 100)
562 space = "&nbsp;";
563 if (count == 1000)
564 space = "";
565 }
566 }
567 if (!out)
568 throw std::ios::failure("error occurred in cpp_pretty_printer_kernel_1::number");
569 }
570
571// ----------------------------------------------------------------------------------------
572

Callers

nothing calls this directly

Calls 1

getMethod · 0.45

Tested by

no test coverage detected