Aegis  4.25.D505
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Private Types | Private Member Functions | Private Attributes
output_filter_indent Class Reference

#include <indent.h>

Inheritance diagram for output_filter_indent:
output_filter output

Public Types

typedef aegis_shared_ptr
< output_filter_indent
ipointer

Public Member Functions

virtual ~output_filter_indent ()
void indent_more (void)
void indent_less (void)

Static Public Member Functions

static ipointer create (const output::pointer &deeper)

Protected Member Functions

nstring type_name (void) const
long ftell_inner (void) const
void write_inner (const void *data, size_t length)
void end_of_line_inner (void)

Private Types

enum  { INDENT = 8 }

Private Member Functions

 output_filter_indent (const output::pointer &deeper)
 output_filter_indent ()
 output_filter_indent (const output_filter_indent &)
output_filter_indentoperator= (const output_filter_indent &)

Private Attributes

int depth
int in_col
int out_col
int continuation_line
long pos

Detailed Description

The output_filter_indent class is used to represent an output stream which automatically indents its C-like input.

Definition at line 28 of file indent.h.


Member Typedef Documentation

Definition at line 32 of file indent.h.


Member Enumeration Documentation

anonymous enum [private]
Enumerator:
INDENT 

This defines the width of a tab on output.

Definition at line 89 of file indent.h.


Constructor & Destructor Documentation

The destructor.

The constructor. It is private on purpose, use the "create" class method instead.

Parameters:
deeperthe deeper output stream on which this filter writes to.

The default constructor. Do not use.

The copy constructor. Do not use.


Member Function Documentation

static ipointer output_filter_indent::create ( const output::pointer deeper) [static]

The create class method is used to create new dynamically allocated instances of this class.

Parameters:
deeperthe deeper output stream on which this filter writes to.
void output_filter_indent::end_of_line_inner ( void  ) [protected, 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.

Reimplemented from output_filter.

long output_filter_indent::ftell_inner ( void  ) const [protected, virtual]

The ftell_inner method is used to determine the current file position, without taking the buffering into account.

Reimplemented from output_filter.

The indent_less function is used to decrease the indenting to less than the automatically calculated indent.

Note:
There must be a matching indent_more call.

The indent_more method is used to increase the indenting beyond the automatically calculated indent.

Note:
There must be a matching indent_less call.
output_filter_indent& output_filter_indent::operator= ( const output_filter_indent ) [private]

The assignment operator. Do not use.

nstring output_filter_indent::type_name ( void  ) const [protected, virtual]

The type_name method is used to determine the name of this output device or file or type.

Reimplemented from output_filter.

void output_filter_indent::write_inner ( const void *  data,
size_t  length 
) [protected, virtual]

The write_inner method is used write data to the output, without taking the buffering into account.

Reimplemented from output_filter.


Field Documentation

The continuation_line instance variable is used to remember whether or not the current line is a continuation line.

State 0 means that it is not, state 1 means that a backslash (\) has been seen, and state 2 means that "\\\n" has been seen.

Definition at line 122 of file indent.h.

The depth instance variable is used to remember the current level of indenting. Will never be negative.

Definition at line 100 of file indent.h.

The in_col instance variable is used to remember the current input column. This can differe from the output column when white space is being optimized.

Definition at line 107 of file indent.h.

The out_col instance variable is used to remember the current output column.

Definition at line 113 of file indent.h.

long output_filter_indent::pos [private]

The pos instance variable is used to remember the current output position.

Definition at line 128 of file indent.h.


The documentation for this class was generated from the following file: