Aegis  4.25.D505
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes
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 (void)

Static Public Member Functions

static mpointer create (void)

Protected Member Functions

nstring filename (void) const
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 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 29 of file memory.h.


Member Typedef Documentation

Definition at line 33 of file memory.h.


Constructor & Destructor Documentation

virtual output_memory::~output_memory ( ) [virtual]

The destructor.

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

The copy constructor. Do not use.


Member Function Documentation

static mpointer output_memory::create ( void  ) [static]

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

void output_memory::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.

Implements output.

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

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

Implements output.

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.
long output_memory::ftell_inner ( void  ) const [protected, virtual]

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

Implements output.

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.
output_memory& output_memory::operator= ( const output_memory ) [private]

The assignment operator. Do not use.

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

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

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.


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 99 of file memory.h.


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