| 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 = " "; |
| 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 = " "; |
| 561 | if (count == 100) |
| 562 | space = " "; |
| 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 | |