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