# libdar::generic_file Class Reference
[Private]

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

`#include <generic_file.hpp>`

Inherited by hide_file, libdar::cache, libdar::compressor, libdar::contextual, libdar::fichier, libdar::null_file, libdar::scrambler, libdar::string_file, libdar::trivial_sar, libdar::tronc, libdar::tronconneuse, and libdar::tuyau.

List of all members.

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

## 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.

Note:
  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 108 of file generic_file.hpp.

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

- generic_file.hpp