26 #ifndef MEMORY_FILE_HPP
27 #define MEMORY_FILE_HPP
38 class memory_file :
public generic_file
52 bool skip(
const infinint & pos);
54 bool skip_relative(S_I x);
55 infinint get_position() {
if(
is_terminated())
throw SRC_BUG;
return position; };
56 void reset() {
if(
is_terminated())
throw SRC_BUG; position = 0; data = storage(0); };
63 infinint get_data_size()
const {
if(
is_terminated())
throw SRC_BUG;
return data.size(); };
66 const storage & get_raw_data()
const {
if(
is_terminated())
throw SRC_BUG;
return data; };
67 void set_raw_data(
const storage & val) {
if(
is_terminated())
throw SRC_BUG; data = val; position = 0; };
69 #ifdef LIBDAR_SPECIAL_ALLOC
70 USE_SPECIAL_ALLOC(memory_file);
74 U_I inherited_read(
char *a, U_I size);
75 void inherited_write(
const char *a, U_I size);
76 void inherited_sync_write() {};
77 void inherited_terminate() {};
class generic_file is defined here as well as class fichierthe generic_file interface is widely used ...
contains a class that permits arbitrary large data storage
gf_mode
generic_file openning modes
bool is_terminated() const
generic_file(gf_mode m)
main constructor
libdar namespace encapsulate all libdar symbols