zapette.hpp
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00034
00035 #ifndef ZAPETTE_HPP
00036 #define ZAPETTE_HPP
00037
00038 #include "../my_config.h"
00039 #include "infinint.hpp"
00040 #include "generic_file.hpp"
00041 #include "integers.hpp"
00042
00043 namespace libdar
00044 {
00045
00047
00052 class zapette : public contextual
00053 {
00054 public:
00055
00057
00061 zapette(user_interaction & dialog, generic_file *input, generic_file *output);
00062 ~zapette();
00063
00064
00065 bool skip(const infinint &pos);
00066 bool skip_to_eof() { position = file_size; return true; };
00067 bool skip_relative(S_I x);
00068 infinint get_position() { return position; };
00069
00070
00071 void set_info_status(const std::string & s);
00072 std::string get_info_status() const { return info; };
00073
00074 protected:
00075 S_I inherited_read(char *a, size_t size);
00076 S_I inherited_write(const char *a, size_t size);
00077
00078 private:
00079 generic_file *in, *out;
00080 infinint position, file_size;
00081 char serial_counter;
00082 std::string info;
00083
00084 void make_transfert(U_16 size, const infinint &offset, char *data, const std::string & info, S_I & lu, infinint & arg);
00085 };
00086
00088
00092 class slave_zapette
00093 {
00094 public:
00095
00097
00101 slave_zapette(generic_file *input, generic_file *output, contextual *data);
00102 ~slave_zapette();
00103
00104
00106
00109 void action();
00110
00111 private:
00112 generic_file *in, *out;
00113 contextual *src;
00114 };
00115
00116 }
00117
00118 #endif