26#ifndef SECU_MEMORY_FILE_HPP
27#define SECU_MEMORY_FILE_HPP
45 secu_memory_file(
const secu_memory_file & ref) =
default;
46 secu_memory_file(secu_memory_file && ref)
noexcept =
default;
47 secu_memory_file & operator = (
const secu_memory_file & ref) =
default;
48 secu_memory_file & operator = (secu_memory_file && ref)
noexcept =
default;
49 ~secu_memory_file() =
default;
54 void reset(U_I size) {
if(
is_terminated())
throw SRC_BUG; position = 0; data.resize(size); };
57 infinint get_size()
const {
return data.get_size(); };
60 infinint get_allocated_size()
const {
return data.get_allocated_size(); };
63 void randomize(U_I size) {
if(size > data.get_allocated_size()) reset(size); data.randomize(size); };
67 virtual bool skippable(skippability direction,
const infinint & amount)
override {
return true; };
68 virtual bool skip(
const infinint & pos)
override;
70 virtual bool skip_relative(S_I x)
override;
71 virtual bool truncatable(
const infinint & pos)
const override {
return false; };
74 const secu_string & get_contents()
const {
return data; };
79 virtual void inherited_read_ahead(
const infinint & amount)
override {};
80 virtual U_I inherited_read(
char *a, U_I size)
override;
81 virtual void inherited_write(
const char *a, U_I size)
override;
82 virtual void inherited_truncate(
const infinint & pos)
override {
throw Efeature(
"truncate a secu_memory_file object"); };
this is the interface class from which all other data transfer classes inherit
virtual void inherited_sync_write()=0
write down any pending data
generic_file(gf_mode m)
main constructor
virtual infinint get_position() const =0
get the current read/write position
virtual bool skip_to_eof()=0
skip to the end of file
bool is_terminated() const
virtual void inherited_terminate()=0
destructor-like call, except that it is allowed to throw exceptions
virtual void inherited_flush_read()=0
reset internal engine, flush caches in order to read the data at current position
class generic_file is defined here as well as class fichier
@ gf_read_write
read and write access
libdar namespace encapsulate all libdar symbols
this file contains the definition of secu_string class, a std::string like class but allocated in sec...
contains a class that permits arbitrary large data storage