50 #ifndef GENERIC_FILE_HPP
51 #define GENERIC_FILE_HPP
54 #include "../my_config.h"
88 extern gf_mode generic_file_get_mode(S_I fd);
89 extern const char * generic_file_get_name(
gf_mode mode);
134 U_I
read(
char *a, U_I size);
139 void write(
const char *a, U_I size);
144 void write(
const std::string & arg);
195 bool crc_status()
const {
return active_read == &generic_file::read_crc; };
201 void get_crc(crc & val) { enable_crc(
false); val = checksum; };
207 void set_mode(
gf_mode x) { rw = x; };
252 void (
generic_file::* active_write)(
const char *a, U_I size);
254 void enable_crc(
bool mode);
256 U_I read_crc(
char *a, U_I size);
257 void write_crc(
const char *a, U_I size);
262 #define CONTEXT_INIT "init"
263 #define CONTEXT_OP "operation"
264 #define CONTEXT_LAST_SLICE "last_slice"
288 contextual() { status =
""; };
289 virtual ~contextual() {};
291 virtual void set_info_status(
const std::string & s) { status = s; };
292 virtual std::string get_info_status()
const {
return status; };
293 virtual bool is_an_old_start_end_archive()
const = 0;
295 virtual const label & get_data_name()
const = 0;