|
Aegis
4.25.D505
|
#include <input.h>
Public Types | |
| typedef input_ty * | pointer |
Public Member Functions | |
| virtual | ~input_ty () |
| input_ty () | |
| ssize_t | read (void *data, size_t nbytes) |
| void | read_strictest (void *data, size_t size) |
| bool | read_strict (void *data, size_t size) |
| void | skip (size_t size) |
| void | fatal_error (const char *msg) |
| void | error (const char *msg) |
| bool | one_line (nstring &result) |
| off_t | ftell () |
| virtual nstring | name ()=0 |
| virtual off_t | length ()=0 |
| int | getch () |
| void | ungetc (int c) |
| int | peek () |
| virtual void | keepalive () |
| void | pushback_transfer (input &from) |
| void | pullback_transfer (input_ty::pointer to) |
| void | pullback_transfer (input &to) |
| void | unread (const void *data, size_t nbytes) |
| bool | at_end () |
| virtual bool | is_remote () const |
| void | reference_count_up () |
| void | reference_count_down () |
| bool | reference_count_valid () const |
Protected Member Functions | |
| virtual ssize_t | read_inner (void *data, size_t nbytes)=0 |
| virtual off_t | ftell_inner ()=0 |
| int | getc_complicated () |
| void | ungetc_complicated (int c) |
Private Attributes | |
| long | reference_count |
| unsigned char * | buffer |
| size_t | buffer_size |
| unsigned char * | buffer_position |
| unsigned char * | buffer_end |
The input_ty abstract class represent a generic input source.
| typedef input_ty* input_ty::pointer |
| virtual input_ty::~input_ty | ( | ) | [virtual] |
The destructor is used to close the given input, and delete all resources associated with it. Once this returns, the given input is no longer available for *any* use. (Think of this method as "close" if it helps.)
The default constructor.
| bool input_ty::at_end | ( | ) |
The at_end method is used to determine whether or not this input stream is at the end of input.
| void input_ty::error | ( | const char * | msg | ) |
The error method is used to report an error on an input stream.
| msg | The error message to be printed. |
| void input_ty::fatal_error | ( | const char * | msg | ) |
The fatal_error method is used to report a fatal error on an input stream. This method does not return.
| msg | The error message to be printed. |
| off_t input_ty::ftell | ( | ) |
The ftell method is used to determine the current buffered data position within the input.
| virtual off_t input_ty::ftell_inner | ( | ) | [protected, pure virtual] |
The ftell_inner method is used to determine the unbuffered current position within the input.
Implemented in input_quoted_printable, input_crlf, input_multipart, input_curl, input_tar, input_file, input_bunzip2, input_crop, input_gunzip, input_uudecode, input_svt_checkout, input_verify_checksum, input_822wrap, input_stdin, input_base64, input_cpio, input_null, input_string, input_catenate, and input_env.
| int input_ty::getc_complicated | ( | ) | [protected] |
The getc_complicated method is used to get a character from the input. Usually users do not call this method directly, but use the getch method instead.
| int input_ty::getch | ( | ) | [inline] |
| virtual bool input_ty::is_remote | ( | ) | const [virtual] |
The is_remote method is used to determine whether or not an input stream is from a local file or a remote source. This is only intended to be a generally informative thing, to provide information to the user, it isn't (and can't be) utterly precise.
Reimplemented in input_quoted_printable, input_crlf, input_multipart, input_curl, input_bunzip2, input_crop, input_gunzip, input_uudecode, input_verify_checksum, input_822wrap, input_base64, input_cpio, and input_catenate.
| virtual void input_ty::keepalive | ( | ) | [virtual] |
The keepalive method is used to set the SO_KEEPALIVE socket option, if the file is a socket. Does nothing otherwise.
Reimplemented in input_quoted_printable, input_crlf, input_multipart, input_file, input_bunzip2, input_crop, input_gunzip, input_uudecode, input_822wrap, input_stdin, input_base64, and input_catenate.
| virtual off_t input_ty::length | ( | ) | [pure virtual] |
The length method is used to determine the length of the input. May return -1 if the length is unknown.
Implemented in input_quoted_printable, input_crlf, input_curl, input_multipart, input_tar, input_file, input_svt_checkout, input_verify_checksum, input_bunzip2, input_crop, input_gunzip, input_uudecode, input_cpio, input_822wrap, input_null, input_stdin, input_string, input_base64, input_catenate, and input_env.
| virtual nstring input_ty::name | ( | ) | [pure virtual] |
The name method is used to determine the name of the input.
Implemented in input_quoted_printable, input_crlf, input_curl, input_multipart, input_tar, input_file, input_verify_checksum, input_bunzip2, input_crop, input_gunzip, input_svt_checkout, input_uudecode, input_cpio, input_822wrap, input_null, input_stdin, input_string, input_base64, input_catenate, and input_env.
| bool input_ty::one_line | ( | nstring & | result | ) |
The one_line method is used to read one line from the input (up to the next newline character or end of input).
| result | Where the text is stored. The newline is not included in the returned string. |
| int input_ty::peek | ( | ) | [inline] |
| void input_ty::pullback_transfer | ( | input_ty::pointer | to | ) |
The pullback_transfer method is used by input filter classes' destructors to return unused buffeered input.
| void input_ty::pullback_transfer | ( | input & | to | ) |
The pullback_transfer method is used by input filter classes' destructors to return unused buffeered input.
| void input_ty::pushback_transfer | ( | input & | from | ) |
The pushback_transfer method is used by input filter classes' destructors to return unused buffeered input.
| ssize_t input_ty::read | ( | void * | data, |
| size_t | nbytes | ||
| ) |
The read method is used to read buffered data from the given input stream. At most size bytes will be read into buffer. The number of bytes actually read will be returned. At end-of-file, a value <=0 will be returned, and buffer 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. |
| virtual ssize_t input_ty::read_inner | ( | void * | data, |
| size_t | nbytes | ||
| ) | [protected, pure 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. |
Implemented in input_quoted_printable, input_crlf, input_multipart, input_curl, input_tar, input_file, input_bunzip2, input_crop, input_gunzip, input_uudecode, input_822wrap, input_stdin, input_base64, input_cpio, input_svt_checkout, input_null, input_string, input_catenate, input_verify_checksum, and input_env.
| bool input_ty::read_strict | ( | void * | data, |
| size_t | size | ||
| ) |
The read_strict method is used to read data from the given input stream. Exactly size bytes will be read into buffer, or zero bytes at end-of-file. If there are less than size bytes available, a fatal error will result.
| data | Where to put the results of the read. |
| size | The number of bytes to read. |
| void input_ty::read_strictest | ( | void * | data, |
| size_t | size | ||
| ) |
The read_strictest method is used to read data from the given input stream. Exactly size bytes will be read into buffer. If there are less than size bytes available, a fatal error will result.
| data | Where to put the results of the read. |
| size | The number of bytes to read. |
| void input_ty::reference_count_down | ( | ) |
| void input_ty::reference_count_up | ( | ) |
| bool input_ty::reference_count_valid | ( | ) | const [inline] |
| void input_ty::skip | ( | size_t | size | ) |
The skip method is used to read data from the given input stream and discard it. Exactly size bytes will be read. If there are less than size bytes available, a fatal error will result.
| size | The number of bytes to discard. |
| void input_ty::ungetc | ( | int | c | ) | [inline] |
| void input_ty::ungetc_complicated | ( | int | c | ) | [protected] |
The ungetc_complicated method is used to push a character back onto an input. Usually users do not call this method directly, but use the input_ungetc macro instead.
| void input_ty::unread | ( | const void * | data, |
| size_t | nbytes | ||
| ) |
The unread method may be used to reverse the effects of the read method. The data is pushed into the buffer. Think of it as a whole bunhs of ungetc calls (backwards).
| data | The base of the array of bytes to be returned. |
| nbytes | The number of bytes to be returned. |
unsigned char* input_ty::buffer [private] |
unsigned char* input_ty::buffer_end [private] |
unsigned char* input_ty::buffer_position [private] |
size_t input_ty::buffer_size [private] |
long input_ty::reference_count [private] |
1.7.6.1