|
Aegis
4.25.D505
|
#include <file.h>
Public Member Functions | |
| virtual | ~input_file () |
| input_file (const nstring &path, bool unlink_on_close=false, bool empty_if_absent=false) | |
| nstring | name () |
| off_t | length () |
| void | keepalive () |
| ssize_t | read_inner (void *data, size_t nbytes) |
| off_t | ftell_inner () |
| void | unlink_on_close () |
Private Member Functions | |
| input_file () | |
| input_file (const input_file &arg) | |
| input_file & | operator= (const input_file &arg) |
Private Attributes | |
| nstring | path |
| int | fd |
| bool | unlink_on_close_flag |
| off_t | pos |
| bool | empty_if_absent_flag |
The input_file class is used to represent an input stream which is read from a file.
| virtual input_file::~input_file | ( | ) | [virtual] |
The destructor.
| input_file::input_file | ( | const nstring & | path, |
| bool | unlink_on_close = false, |
||
| bool | empty_if_absent = false |
||
| ) |
The constructor.
| path | The path of the file to be opened. |
| unlink_on_close | If true, the file is to be unlinked in the destructor. Defaults to false if not specified. |
| empty_if_absent | If true, the file is to be treated as if it was empty if it does not exist. No warning message will be issued. Defaults to false if not specified. |
| input_file::input_file | ( | ) | [private] |
The default constructor. Do not use.
| input_file::input_file | ( | const input_file & | arg | ) | [private] |
The copy constructor. Do not use.
| off_t input_file::ftell_inner | ( | ) | [virtual] |
The ftell_inner method is used to determine the unbuffered current position within the input.
Implements input_ty.
| void input_file::keepalive | ( | ) | [virtual] |
The keepalive method is used to set the SO_KEEPALIVE socket option, if the file is a socket. Does nothing otherwise.
Reimplemented from input_ty.
| off_t input_file::length | ( | ) | [virtual] |
The length method is used to determine the length of the input. May return -1 if the length is unknown.
Implements input_ty.
| nstring input_file::name | ( | ) | [virtual] |
The name method is used to determine the name of the input.
Implements input_ty.
| input_file& input_file::operator= | ( | const input_file & | arg | ) | [private] |
The assignment operator. Do not use.
| ssize_t input_file::read_inner | ( | void * | data, |
| size_t | nbytes | ||
| ) | [virtual] |
The read_inner method is used to read unbuffered data from the given input stream. At most nbytes bytes will be read into data. The number of bytes actually read will be returned. At end-of-file, a value <= 0 will be returned, and data will be unchanged. All file read errors or format errors are fatal, and will cause the method to not return.
| data | Where to put the results of the read. |
| nbytes | The maximum number of bytes to read. |
Implements input_ty.
| void input_file::unlink_on_close | ( | ) |
The unlink_on_close method may be used to specify that the file is to be removed when it is closed (in the destructor).
bool input_file::empty_if_absent_flag [private] |
int input_file::fd [private] |
nstring input_file::path [private] |
off_t input_file::pos [private] |
bool input_file::unlink_on_close_flag [private] |
1.7.6.1