Disk ARchive  2.4.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Defines
.pc/delete2/zapette.hpp
00001 /*********************************************************************/
00002 // dar - disk archive - a backup/restoration program
00003 // Copyright (C) 2002-2052 Denis Corbin
00004 //
00005 // This program is free software; you can redistribute it and/or
00006 // modify it under the terms of the GNU General Public License
00007 // as published by the Free Software Foundation; either version 2
00008 // of the License, or (at your option) any later version.
00009 // 
00010 // This program is distributed in the hope that it will be useful,
00011 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00012 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013 // GNU General Public License for more details.
00014 // 
00015 // You should have received a copy of the GNU General Public License
00016 // along with this program; if not, write to the Free Software
00017 // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
00018 //
00019 // to contact the author : dar.linux@free.fr
00020 /*********************************************************************/
00021 // $Id$
00022 //
00023 /*********************************************************************/
00024 //
00025 
00026 #ifndef ZAPETTE_HPP
00027 #define ZAPETTE_HPP
00028 
00029 #pragma interface
00030 
00031 #include "generic_file.hpp"
00032 #include "integers.hpp"
00033 
00034 class zapette: public generic_file
00035 {
00036 public:
00037 
00038     zapette(generic_file *input, generic_file *output);
00039     ~zapette();
00040 
00041         // inherited methods
00042     bool skip(const infinint &pos);
00043     bool skip_to_eof() { position = file_size; return true; };
00044     bool skip_relative(S_I x);
00045     infinint get_position() { return position; };
00046 
00047 protected:
00048     S_I inherited_read(char *a, size_t size);
00049     S_I inherited_write(char *a, size_t size);
00050 
00051 private:
00052     generic_file *in, *out;
00053     infinint position, file_size;
00054     char serial_counter;
00055 
00056     void make_transfert(U_16 size, const infinint &offset, char *data, S_I & lu, infinint & arg);
00057 };
00058 
00059 class slave_zapette
00060 {
00061 public:
00062     slave_zapette(generic_file *input, generic_file *output, generic_file *data);
00063     ~slave_zapette();
00064 
00065     void action();
00066     
00067 private:
00068     generic_file *in, *out, *src;
00069 };
00070 
00071 #endif
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Defines