output_file Class Reference

#include <file.h>

Inheritance diagram for output_file:

output

Public Member Functions

virtual ~output_file ()

Static Public Member Functions

static output::pointer open (const nstring &fn, bool binary=false)
static output::pointer text_open (string_ty *fn)
static output::pointer text_open (const nstring &fn)
static output::pointer binary_open (string_ty *fn)
static output::pointer binary_open (const nstring &fn)

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 Member Functions

 output_file (const nstring &file_name, bool binary=false)
 output_file ()
 output_file (const output_file &)
output_fileoperator= (const output_file &)

Private Attributes

nstring file_name
int fd
bool bol
size_t pos

Detailed Description

The output_file class is used to represent the state of an output stream to a regular file.

Definition at line 32 of file file.h.


Constructor & Destructor Documentation

virtual output_file::~output_file (  )  [virtual]

The destructor.

output_file::output_file ( const nstring file_name,
bool  binary = false 
) [private]

The constructor. It is private on purpose, use one of the open class methods instead.

Parameters:
file_name The name of the file to be opened for output. (Make absolutely sure it is not NULL or empty.)
binary Whether the file is binary (true) or text (false).

output_file::output_file (  )  [private]

The default constructor. Do not use.

output_file::output_file ( const output_file  )  [private]

The copy constructor. Do not use.


Member Function Documentation

static output::pointer output_file::open ( const nstring fn,
bool  binary = false 
) [static]

The open class method is used to open an output file.

Parameters:
fn The path name of the file to be opened. If the poijnter is NULL or the string is empty, the standard output is used.
binary Wherther or not the file is binary. Defaults to false (i.e. text).

static output::pointer output_file::text_open ( string_ty fn  )  [inline, static]

The text_open class method is used to open a text output file.

Parameters:
fn The path name of the file to be opened. If the poijnter is NULL or the string is empty, the standard output is used.

Definition at line 74 of file file.h.

static output::pointer output_file::text_open ( const nstring fn  )  [inline, static]

The text_open class method is used to open a text output file.

Parameters:
fn The path name of the file to be opened. If the poijnter is NULL or the string is empty, the standard output is used.

Definition at line 87 of file file.h.

static output::pointer output_file::binary_open ( string_ty fn  )  [inline, static]

The binary_open class method is used to open a binary output file.

Parameters:
fn The path name of the file to be opened. If the poijnter is NULL or the string is empty, the standard output is used.

Definition at line 100 of file file.h.

static output::pointer output_file::binary_open ( const nstring fn  )  [inline, static]

The binary_open class method is used to open a binary output file.

Parameters:
fn The path name of the file to be opened. If the poijnter is NULL or the string is empty, the standard output is used.

Definition at line 113 of file file.h.

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

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

Implements output.

const char* output_file::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_file::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_file::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_file::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_file::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_file::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_file& output_file::operator= ( const output_file  )  [private]

The assignment operator. Do not use.


Field Documentation

The file_name instance variable is used to remember the name of the file opened for writing.

Definition at line 145 of file file.h.

int output_file::fd [private]

The fd instance variable is used to remember the number of the file descriptor opened for writing.

Definition at line 151 of file file.h.

bool output_file::bol [private]

The bol instance variable is used to remember whether or not we are at the start of a line.

Definition at line 157 of file file.h.

size_t output_file::pos [private]

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

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