|
Aegis
4.25.D505
|
#include <pretty.h>
Data Structures | |
| struct | column_ty |
| struct | emit_ty |
Public Member Functions | |
| virtual | ~col_pretty () |
Static Public Member Functions | |
| static pointer | create (const wide_output::pointer &deeper) |
Protected Member Functions | |
| output::pointer | create (int left, int right, const char *title) |
| void | title (const nstring &first, const nstring &second) |
| void | eoln () |
| void | need (int n) |
| void | eject () |
| void | flush () |
| void | forget (const output::pointer &op) |
Private Member Functions | |
| col_pretty (const wide_output::pointer &deeper) | |
| void | emit (size_t argc, emit_ty *argv, int minlines, bool is_the_header) |
| void | emit_header () |
| void | emit_content () |
| col_pretty () | |
| col_pretty (const col_pretty &) | |
| col_pretty & | operator= (const col_pretty &) |
Private Attributes | |
| wide_output::pointer | deeper |
| bool | need_to_emit_headers |
| size_t | ncolumns |
| size_t | ncolumns_max |
| column_ty * | column |
The col_pretty class is used to represent multi-column output with line wrap around the column values, and formatting across multiple lines.
| virtual col_pretty::~col_pretty | ( | ) | [virtual] |
The destructor.
| col_pretty::col_pretty | ( | const wide_output::pointer & | deeper | ) | [private] |
The constructor. Its is private on pupose, use the create class method instead.
| deeper | The output stream upon which to write the columnar output. |
| col_pretty::col_pretty | ( | ) | [private] |
The default constructor. Do not use.
| col_pretty::col_pretty | ( | const col_pretty & | ) | [private] |
The copy constructor. Do not use.
| static pointer col_pretty::create | ( | const wide_output::pointer & | deeper | ) | [static] |
The create class method is used to create new dynamically allocated instances of this class.
| deeper | The output stream upon which to write the columnar output. |
| output::pointer col_pretty::create | ( | int | left, |
| int | right, | ||
| const char * | title | ||
| ) | [protected, virtual] |
The create method is used to specify a range of locations for an output column.
The contents will be de-tabbed and wrapped before output.
| left | the left-hand edge of the column. If you say -1, it will use the righ-hand side of the previous column, plus one. (Note: NOT the right-most column.) |
| right | the right-hand edge of the column, plus one. zero means the rest of the line |
| title | the column title to use. Give NULL pointer for none. |
Implements col.
| void col_pretty::eject | ( | ) | [protected, virtual] |
The eject method is used to move to the top of the next page, if we aren't there already.
Implements col.
| void col_pretty::emit | ( | size_t | argc, |
| emit_ty * | argv, | ||
| int | minlines, | ||
| bool | is_the_header | ||
| ) | [private] |
The emit method is used to emit the given values of text out of the deeper output stream. The emitting is factored into this common method, rather than reproduce the code twice, once for the headers and again for the content.
| void col_pretty::emit_content | ( | ) | [private] |
The emit_content method is used to generate the output, given the content written and formatted via the wide output streams privide by create (below).
Usually, the column headers are handled by the top-of-page callback, however if new columns with headers are created in the middle of the page, this method also causes the new column headings to be emitted, before the content.
| void col_pretty::emit_header | ( | ) | [private] |
The emit_header method is used to emit column headers when necessary. It clears the flag which controls emitting the headers, too.
| void col_pretty::eoln | ( | ) | [protected, virtual] |
The eoln method is used to signal that an entire line of columns has been assembled and that it should be emitted to the output file or pager.
Columns all receive an implicit newline, and are flushed before processing. All of the columns are thus aligned into rows, even when (due to newlines or wrapping) they would otherwise be different lengths.
This is the interface used by clients of this subsystem.
Implements col.
| void col_pretty::flush | ( | ) | [protected, virtual] |
The flush method is used to force output of all buffered data.
Implements col.
| void col_pretty::forget | ( | const output::pointer & | op | ) | [protected, virtual] |
The forget method is used to discontinue an output column.
| op | The column to forget. |
Implements col.
| void col_pretty::need | ( | int | n | ) | [protected, virtual] |
The need method is used to nominate that a number of lines is needed before the end of the page. If the lines are available, a blank line is emitted, otherwise a new page is thrown.
| n | the number of lines, not counting the blank line. |
Implements col.
| col_pretty& col_pretty::operator= | ( | const col_pretty & | ) | [private] |
The assignment operator. Do not use.
| void col_pretty::title | ( | const nstring & | first, |
| const nstring & | second | ||
| ) | [protected, virtual] |
The title method is used to set the two lines of page headings. These are ignored for unformatted output.
| first | first line of heading, NULL means blank |
| second | second line of heading, NULL means blank |
Implements col.
column_ty* col_pretty::column [private] |
wide_output::pointer col_pretty::deeper [private] |
size_t col_pretty::ncolumns [private] |
size_t col_pretty::ncolumns_max [private] |
bool col_pretty::need_to_emit_headers [private] |
1.7.6.1