output_indent Class Reference

#include <indent.h>

Inheritance diagram for output_indent:

output

Public Types

typedef aegis_shared_ptr
< output_indent
ipointer

Public Member Functions

virtual ~output_indent ()
void indent_more ()
void indent_less ()

Static Public Member Functions

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

Protected Member Functions

nstring filename () const
const char * type_name () const
long ftell_inner () const
void write_inner (const void *data, size_t length)
void end_of_line_inner ()
int page_width () const
int page_length () const

Private Types

enum  { INDENT = 8 }

Private Member Functions

 output_indent (const output::pointer &deeper)
 output_indent ()
 output_indent (const output_indent &)
output_indentoperator= (const output_indent &)

Private Attributes

output::pointer deeper
int depth
int in_col
int out_col
int continuation_line
long pos

Detailed Description

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

Definition at line 29 of file indent.h.


Member Typedef Documentation

Definition at line 33 of file indent.h.


Member Enumeration Documentation

anonymous enum [private]

Enumerator:
INDENT  This defines the width of a tab on output.

Definition at line 101 of file indent.h.


Constructor & Destructor Documentation

virtual output_indent::~output_indent (  )  [virtual]

The destructor.

output_indent::output_indent ( const output::pointer deeper  )  [private]

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

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

output_indent::output_indent (  )  [private]

The default constructor. Do not use.

output_indent::output_indent ( const output_indent  )  [private]

The copy constructor. Do not use.


Member Function Documentation

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

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

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

void output_indent::indent_more (  ) 

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

Note:
There must be a matching indent_less call.

void output_indent::indent_less (  ) 

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.

nstring output_indent::filename (  )  const [protected, virtual]

The filename method is used to obtain the filename of this output.

Implements output.

const char* output_indent::type_name (  )  const [protected, virtual]

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

Implements output.

long output_indent::ftell_inner (  )  const [protected, virtual]

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

Implements output.

void output_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.

Implements output.

void output_indent::end_of_line_inner (  )  [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.

Implements output.

int output_indent::page_width (  )  const [protected, virtual]

The page_width method is used to obtain the width of the page of the output device.

Reimplemented from output.

int output_indent::page_length (  )  const [protected, virtual]

The page_length method is used to obtain the length of the page of the output device.

Reimplemented from output.

output_indent& output_indent::operator= ( const output_indent  )  [private]

The assignment operator. Do not use.


Field Documentation

The deeper instance variable is used to remember the deeper output stream on which this filter writes to.

Definition at line 112 of file indent.h.

int output_indent::depth [private]

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

Definition at line 118 of file indent.h.

int output_indent::in_col [private]

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 125 of file indent.h.

int output_indent::out_col [private]

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

Definition at line 131 of file indent.h.

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 140 of file indent.h.

long output_indent::pos [private]

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

Definition at line 146 of file indent.h.


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

Generated on Wed Mar 12 23:37:41 2008 for Aegis by  doxygen 1.5.5