Aegis  4.25.D505
Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes
input_crlf Class Reference

#include <crlf.h>

Inheritance diagram for input_crlf:
input_ty

Public Member Functions

virtual ~input_crlf ()
nstring name ()
off_t length ()
void keepalive ()
ssize_t read_inner (void *data, size_t nbytes)
off_t ftell_inner ()
bool is_remote () const

Static Public Member Functions

static input create (input &deeper, bool esc_nl=false)

Private Member Functions

 input_crlf (input &deeper, bool esc_nl)
 input_crlf ()
 input_crlf (const input_crlf &arg)
input_crlfoperator= (const input_crlf &arg)

Private Attributes

input deeper
off_t pos
long line_number
bool prev_was_newline
nstring name_cache
bool newlines_may_be_escaped

Detailed Description

The input_crlf class is used to transparently filter CRLF sequences into NL sequences.

Definition at line 28 of file crlf.h.


Constructor & Destructor Documentation

virtual input_crlf::~input_crlf ( ) [virtual]

The destructor.

input_crlf::input_crlf ( input deeper,
bool  esc_nl 
) [private]

The constructor.

Parameters:
deeperThe data source we are to filter.
esc_nltrue if we are to operate in a mode where \
and \\r\n sequences are to be removed.
input_crlf::input_crlf ( ) [private]

The default constructor. Do not use.

input_crlf::input_crlf ( const input_crlf arg) [private]

The copy constructor. Do not use.


Member Function Documentation

static input input_crlf::create ( input deeper,
bool  esc_nl = false 
) [static]

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

Parameters:
deeperThe data source we are to filter.
esc_nltrue if we are to operate in a mode where \
and \\r\n sequences are to be removed.
off_t input_crlf::ftell_inner ( ) [virtual]

The ftell_inner method is used to determine the unbuffered current position within the input.

Implements input_ty.

bool input_crlf::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 from input_ty.

void input_crlf::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_crlf::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_crlf::name ( ) [virtual]

The name method is used to determine the name of the input.

Implements input_ty.

input_crlf& input_crlf::operator= ( const input_crlf arg) [private]

The assignment operator. Do not use.

ssize_t input_crlf::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.

Parameters:
dataWhere to put the results of the read.
nbytesThe maximum number of bytes to read.
Returns:
The actual number of bytes read, or zero for end-of-file.

Implements input_ty.


Field Documentation

The deeper instance variable is used to remember the deeper input source of this filter.

Definition at line 85 of file crlf.h.

long input_crlf::line_number [private]

Definition at line 88 of file crlf.h.

Definition at line 90 of file crlf.h.

The newlines_may_be_escaped instance variable is used to remember whether we are in the mode where \
and \\r\n sequenes are removed.

Definition at line 97 of file crlf.h.

off_t input_crlf::pos [private]

Definition at line 87 of file crlf.h.

Definition at line 89 of file crlf.h.


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