|
Aegis
4.25.D505
|
#include <output.h>
Public Types | |
| typedef aegis_shared_ptr< output > | pointer |
| typedef void(* | delete_callback_ty )(output *, void *) |
Public Member Functions | |
| virtual | ~output () |
| virtual nstring | filename (void) const =0 |
| long | ftell (void) const |
| void | write (const void *data, size_t nbytes) |
| void | flush (void) |
| virtual int | page_width (void) const |
| virtual int | page_length (void) const |
| void | end_of_line (void) |
| virtual nstring | type_name (void) const =0 |
| void | fputc (char c) |
| void | fputs (const char *str) |
| void | fputs_xml (const char *str, bool paragraphs=false) |
| void | fputs (string_ty *str) |
| void | fputs_xml (string_ty *str, bool paragraphs=false) |
| void | fputs (const nstring &str) |
| void | fputs_xml (const nstring &str, bool paragraphs=false) |
| void | fprintf (const char *fmt,...) |
| void | vfprintf (const char *fmt, va_list) |
| void | register_delete_callback (functor::pointer fp) |
| void | unregister_delete_callback (functor::pointer fp) |
Protected Member Functions | |
| output () | |
Private Member Functions | |
| virtual long | ftell_inner (void) const =0 |
| virtual void | write_inner (const void *data, size_t length)=0 |
| virtual void | end_of_line_inner (void)=0 |
| virtual void | flush_inner (void) |
| void | overflow (char c) |
| output (const output &) | |
| output & | operator= (const output &) |
Private Attributes | |
| functor_stack | callback |
| unsigned char * | buffer |
| size_t | buffer_size |
| unsigned char * | buffer_position |
| unsigned char * | buffer_end |
The output class is used to describe the interface to an arbitrary output destination. It could be a file, it could be a string, or many other things, including several filters.
| typedef void(* output::delete_callback_ty)(output *, void *) |
| typedef aegis_shared_ptr<output> output::pointer |
The pointer type is used to describe a pointer to an output destination.
Reimplemented in output_filter_wrap_simple, output_filter_wrap_make, and output_filter_set_width.
| virtual output::~output | ( | ) | [virtual] |
The destructor.
| output::output | ( | ) | [protected] |
The default constructor. May only be called by derived classes.
| output::output | ( | const output & | ) | [private] |
The copy constructor. Do not use.
| void output::end_of_line | ( | void | ) |
The end_of_line method is used to ensure that the current output position is at the beginning of a line.
| virtual void output::end_of_line_inner | ( | void | ) | [private, pure virtual] |
The end_of_line_inner method is used to ensure that the current output position is at the beginning of a line, without taking the buffering into account.
Implemented in output_file, output_cpio_child, output_memory, output_cpio_child2, output_tar_child, output_pager, output_tee, output_cpio, output_filter_indent, output_tar, output_to_wide, output_bit_bucket, output_stdout, output_filter, output_filter_prefix, output_filter_wrap_simple, output_filter_uuencode, output_filter_bzip2, output_filter_gzip, output_filter_wrap_make, output_filter_base64, output_filter_quoted_printable, and output_filter_dot_blank_lines.
| virtual nstring output::filename | ( | void | ) | const [pure virtual] |
The filename method is used to obtain the filename of this output.
Implemented in output_file, output_cpio_child, output_memory, output_cpio_child2, output_tar_child, output_pager, output_cpio, output_tee, output_tar, output_to_wide, output_bit_bucket, output_stdout, output_filter, and output_filter_uuencode.
| void output::flush | ( | void | ) |
The flush method is used to ensure that any buffered data is written to the output.
| virtual void output::flush_inner | ( | void | ) | [private, virtual] |
The flush_inner method is called by the flush method once all the data has been written. The default implementation does nothing.
Reimplemented in output_cpio_child2, output_pager, output_tee, output_to_wide, and output_filter.
| void output::fprintf | ( | const char * | fmt, |
| ... | |||
| ) |
The fprintf method produces output according to a format as described in the printf(3) man page.
| fmt | This method writes the output under the control of a format string that specifies how subsequent arguments (or arguments accessed via the variable-length argument facilities of stdarg(3)) are converted for output. |
| void output::fputc | ( | char | c | ) | [inline] |
| void output::fputs | ( | const char * | str | ) |
The fputs method is used to write a NUL terminated string to the output stream.
| str | The string to be written out. |
| void output::fputs | ( | string_ty * | str | ) |
The fputs method is used to write a string to the output stream.
| str | The string to be written out. |
| void output::fputs | ( | const nstring & | str | ) |
The fputs method is used to write a string to the output stream.
| str | The string to be written out. |
| void output::fputs_xml | ( | const char * | str, |
| bool | paragraphs = false |
||
| ) |
The fputs method is used to write a NUL terminated string to the output stream, encoding any XML special characters (e.g. "<" becomes "<", etc).
| str | The string to be written out. |
| paragraphs | If true, insert |
for two newlines and
for single newlines; if false, simply pass newlines through.
| void output::fputs_xml | ( | string_ty * | str, |
| bool | paragraphs = false |
||
| ) |
The fputs_xml method is used to write a string to the output stream, encoding any XML special characters (e.g. "<" becomes "<", etc).
| str | The string to be written out. |
| paragraphs | If true, insert |
for two newlines and
for single newlines; if false, simply pass newlines through.
| void output::fputs_xml | ( | const nstring & | str, |
| bool | paragraphs = false |
||
| ) |
The fputs_xml method is used to write a string to the output stream, encoding any XML special characters (e.g. "<" becomes "<", etc).
| str | The string to be written out. |
| paragraphs | If true, insert |
for two newlines and
for single newlines; if false, simply pass newlines through.
| long output::ftell | ( | void | ) | const |
The ftell method is used to determine the current file position of the output.
| virtual long output::ftell_inner | ( | void | ) | const [private, pure virtual] |
The ftell_inner method is used to determine the current file position, without taking the buffering into account.
Implemented in output_file, output_cpio_child, output_memory, output_cpio_child2, output_tar_child, output_pager, output_cpio, output_filter_indent, output_tar, output_tee, output_to_wide, output_bit_bucket, output_stdout, output_filter, output_filter_uuencode, output_filter_base64, output_filter_prefix, output_filter_bzip2, output_filter_gzip, and output_filter_dot_blank_lines.
| void output::overflow | ( | char | c | ) | [private] |
The overflow mwthod is used by the fputc method when the buffer is full. It write the buffer to the output, and then adds the single character to the buffer.
| virtual int output::page_length | ( | void | ) | const [virtual] |
The page_length method is used to obtain the length of the page of the output device.
Reimplemented in output_file, output_to_wide, output_tee, output_bit_bucket, output_stdout, output_filter_uuencode, and output_filter.
| virtual int output::page_width | ( | void | ) | const [virtual] |
The page_width method is used to obtain the width of the page of the output device.
Reimplemented in output_file, output_to_wide, output_tee, output_bit_bucket, output_stdout, output_filter_uuencode, output_filter_quoted_printable, output_filter_prefix, output_filter, and output_filter_set_width.
| void output::register_delete_callback | ( | functor::pointer | fp | ) |
The register_delete_callback method is used to set the callback functor to be called by the destructor.
| virtual nstring output::type_name | ( | void | ) | const [pure virtual] |
The type_name method is used to determine the name of this output device or file or type.
Implemented in output_file, output_cpio_child, output_memory, output_cpio_child2, output_tar_child, output_tee, output_pager, output_filter, output_cpio, output_filter_indent, output_tar, output_to_wide, output_filter_prefix, output_filter_wrap_simple, output_bit_bucket, output_filter_bzip2, output_filter_gzip, output_stdout, output_filter_wrap_make, output_filter_uuencode, output_filter_quoted_printable, output_filter_base64, and output_filter_dot_blank_lines.
The unregister_delete_callback method is used to forget a callback functor to be called by the destructor.
| void output::vfprintf | ( | const char * | fmt, |
| va_list | |||
| ) |
The vfprintf method is equivalent to the fprintf method, except that it is called with a va_list instead of a variable number of arguments. This method does not call the va_end macro. Consequently, the value of ap is undefined after the call. The application should call va_end(ap) itself afterwards.
| void output::write | ( | const void * | data, |
| size_t | nbytes | ||
| ) |
The write method is used to write date to the output.
| virtual void output::write_inner | ( | const void * | data, |
| size_t | length | ||
| ) | [private, pure virtual] |
The write_inner method is used write data to the output, without taking the buffering into account.
Implemented in output_file, output_cpio_child, output_memory, output_cpio_child2, output_tar_child, output_pager, output_cpio, output_filter_indent, output_tar, output_tee, output_to_wide, output_bit_bucket, output_stdout, output_filter, output_filter_uuencode, output_filter_wrap_make, output_filter_wrap_simple, output_filter_base64, output_filter_prefix, output_filter_quoted_printable, output_filter_bzip2, output_filter_gzip, and output_filter_dot_blank_lines.
unsigned char* output::buffer [private] |
The buffer instance variable is used to remember the base of a dynamically allocated array of characters used to buffer the data, to minimize the number of systems calls required.
Reimplemented in output_cpio_child2, and output_memory.
unsigned char* output::buffer_end [private] |
unsigned char* output::buffer_position [private] |
size_t output::buffer_size [private] |
functor_stack output::callback [private] |
1.7.6.1