output_memory Class Reference

#include <memory.h>

Inheritance diagram for output_memory:

output

Public Types

typedef aegis_shared_ptr
< output_memory
mpointer

Public Member Functions

virtual ~output_memory ()
void forward (output::pointer deeper)
nstring mkstr ()

Static Public Member Functions

static mpointer create ()

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 ()

Private Member Functions

 output_memory ()
 output_memory (const output_memory &)
output_memoryoperator= (const output_memory &)

Private Attributes

nstring_accumulator buffer

Detailed Description

The output_memory class is used to represent an output stream which writes to a block of dynamically allocated memory.

Definition at line 30 of file memory.h.


Member Typedef Documentation

Definition at line 34 of file memory.h.


Constructor & Destructor Documentation

virtual output_memory::~output_memory (  )  [virtual]

The destructor.

output_memory::output_memory (  )  [private]

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

output_memory::output_memory ( const output_memory  )  [private]

The copy constructor. Do not use.


Member Function Documentation

static mpointer output_memory::create (  )  [static]

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

void output_memory::forward ( output::pointer  deeper  ) 

The forward method is used to forward the data held by this object to a different output stream. It does not affect this output stream's data.

Note:
: The only reason this method isn't const is that we have to call flush() before we do anything else, to make sure all the data is in the memory buffer.

nstring output_memory::mkstr (  ) 

The mkstr method is used to turn the accumulated data into a string.

Note:
: The only reason this method isn't const is that we have to call flush() before we do anything else, to make sure all the data is in the memory buffer.

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

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

Implements output.

const char* output_memory::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_memory::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_memory::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_memory::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.

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

The assignment operator. Do not use.


Field Documentation

The buffer instance variable is used to remember the dynamically alloocated buffer to hold the data written to this output stream.

Reimplemented from output.

Definition at line 100 of file memory.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