Logo Search packages:      
Sourcecode: dar version File versions

libdar::generic_file Class Reference

#include <generic_file.hpp>

Inheritance diagram for libdar::generic_file:

libdar::cache libdar::compressor libdar::contextual libdar::fichier libdar::null_file libdar::scrambler libdar::tronc libdar::tronconneuse libdar::tuyau

List of all members.

Detailed Description

this is the interface class from which all other data transfer classes inherit

it provides mainly read and write operations, skip operations and few other functions.

the read and write method are similar to the read and write system calls except that they never return negative values, but throw exception instead. returning zero means end of generic_file. The call is blocked if no data is available for reading. write returns the number of bytes written, and never make partial writtings. Thus, it is blocked until all bytes are written or occures an exception inconsequences the returned value is always the value of the argument "size".

Definition at line 100 of file generic_file.hpp.

Public Member Functions

infinint copy_to (generic_file &ref, infinint size)
 copy the given amount to the object in argument
U_32 copy_to (generic_file &ref, U_32 size)
 small copy (up to 4GB) with CRC calculation
void copy_to (generic_file &ref, crc &value)
 copy all data from the current position to the object in argument and computes a CRC value of the transmitted data
void copy_to (generic_file &ref)
 copy all data from current position to the object in argument
bool diff (generic_file &f)
 compares the contents with the object in argument
 generic_file (const generic_file &ref)
 copy constructor
 generic_file (user_interaction &dialog, gf_mode m)
 main constructor
void get_crc (crc &val)
 get CRC of the transfered date since last reset
user_interactionget_gf_ui () const
 get the cached user_interaction for inherited classes in particular (this stay a public method, not a protected one)
gf_mode get_mode () const
 retreive the openning mode for this object
virtual infinint get_position ()=0
 get the current read/write position
generic_fileoperator= (const generic_file &ref)
 assignment operator
S_I read (char *a, size_t size)
 read data from the generic_file
S_I read_back (char &a)
 skip back one char, read on char and skip back one char
S_I read_forward (char &a)
 read one char
void reset_crc ()
 reset CRC on read or writen data
virtual bool skip (const infinint &pos)=0
 skip at the absolute position
virtual bool skip_relative (S_I x)=0
 skip relatively to the current position
virtual bool skip_to_eof ()=0
 skip to the end of file
S_I write (const std::string &arg)
 write a string to the generic_file
S_I write (char *a, size_t size)
 write data to the generic_file
virtual ~generic_file ()

Protected Member Functions

virtual S_I inherited_read (char *a, size_t size)=0
virtual S_I inherited_write (char *a, size_t size)=0
void set_mode (gf_mode x)

Private Member Functions

void compute_crc (char *a, S_I size)
void copy_from (const generic_file &ref)
void detruire ()
void enable_crc (bool mode)
S_I read_crc (char *a, size_t size)
S_I write_crc (char *a, size_t size)

Private Attributes

S_I(generic_file::* active_read )(char *a, size_t size)
S_I(generic_file::* active_write )(char *a, size_t size)
S_I crc_offset
gf_mode rw
crc value

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

Generated by  Doxygen 1.6.0   Back to index