29 #ifndef MEMORY_FILE_HPP
30 #define MEMORY_FILE_HPP
41 class memory_file :
public generic_file
55 bool skip(
const infinint & pos);
57 bool skip_relative(S_I x);
58 infinint get_position() {
if(
is_terminated())
throw SRC_BUG;
return position; };
59 void reset() {
if(
is_terminated())
throw SRC_BUG; position = 0; data = storage(0); };
66 infinint get_data_size()
const {
if(
is_terminated())
throw SRC_BUG;
return data.size(); };
69 const storage & get_raw_data()
const {
if(
is_terminated())
throw SRC_BUG;
return data; };
70 void set_raw_data(
const storage & val) {
if(
is_terminated())
throw SRC_BUG; data = val; position = 0; };
72 #ifdef LIBDAR_SPECIAL_ALLOC
73 USE_SPECIAL_ALLOC(memory_file);
77 U_I inherited_read(
char *a, U_I size);
78 void inherited_write(
const char *a, U_I size);
79 void inherited_sync_write() {};
80 void inherited_terminate() {};