|
Aegis
4.25.D505
|
#include <file.h>
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) |
| static output::pointer | compressed_text_open (const nstring &filename) |
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) |
| int | page_width (void) const |
| int | page_length (void) const |
Private Member Functions | |
| output_file (const nstring &file_name, bool binary=false) | |
| output_file () | |
| output_file (const output_file &) | |
| output_file & | operator= (const output_file &) |
Private Attributes | |
| nstring | file_name |
| int | fd |
| bool | bol |
| size_t | pos |
The output_file class is used to represent the state of an output stream to a regular file.
| 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.
| 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.
| static output::pointer output_file::binary_open | ( | string_ty * | fn | ) | [inline, static] |
| static output::pointer output_file::binary_open | ( | const nstring & | fn | ) | [inline, static] |
| static output::pointer output_file::compressed_text_open | ( | const nstring & | filename | ) | [static] |
The compressed_text_open class method is used to openb a file, for example a report output, while taking into the file's extension to determine whether or not to also compress the output.
If the file name is ampty or "-" the standard output will be used.
If the fil ename ends with ".gz" (case insensitive) the output will be gzipped. If the file ends with ".bz" or ".bz2" the output will be bzip2ed.
| filename | The name of the file |
| void output_file::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_file::filename | ( | void | ) | const [protected, virtual] |
The filename method is used to obtain the filename of this output.
Implements output.
| long output_file::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.
| static output::pointer output_file::open | ( | const nstring & | fn, |
| bool | binary = false |
||
| ) | [static] |
The open class method is used to open an output file.
| 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). |
| output_file& output_file::operator= | ( | const output_file & | ) | [private] |
The assignment operator. Do not use.
| int output_file::page_length | ( | void | ) | const [protected, virtual] |
The page_length method is used to obtain the length of the page of the output device.
Reimplemented from output.
| int output_file::page_width | ( | void | ) | const [protected, virtual] |
The page_width method is used to obtain the width of the page of the output device.
Reimplemented from output.
| static output::pointer output_file::text_open | ( | string_ty * | fn | ) | [inline, static] |
| static output::pointer output_file::text_open | ( | const nstring & | fn | ) | [inline, static] |
| nstring output_file::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_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.
bool output_file::bol [private] |
int output_file::fd [private] |
nstring output_file::file_name [private] |
size_t output_file::pos [private] |
1.7.6.1