SpectMorph
smgenericin.hh
1 // Licensed GNU LGPL v3 or later: http://www.gnu.org/licenses/lgpl.html
2 
3 #ifndef SPECTMORPH_GENERIC_IN_HH
4 #define SPECTMORPH_GENERIC_IN_HH
5 
6 #include <string>
7 
8 namespace SpectMorph
9 {
10 
17 class GenericIn
18 {
19 public:
20  static GenericIn* open (const std::string& filename);
21 
22  virtual ~GenericIn();
28  virtual int get_byte() = 0; // like fgetc
37  virtual int read (void *ptr, size_t size) = 0;
45  virtual bool skip (size_t size) = 0;
51  virtual size_t get_pos() = 0;
62  virtual unsigned char *mmap_mem (size_t& remaining) = 0;
71  virtual GenericIn *open_subfile (size_t pos, size_t len) = 0;
72 };
73 
74 }
75 
76 #endif /* SPECTMORPH_GENERIC_IN_HH */
virtual size_t get_pos()=0
Generic Input Stream.
Definition: smgenericin.hh:17
static GenericIn * open(const std::string &filename)
Definition: smgenericin.cc:18
virtual bool skip(size_t size)=0
virtual int read(void *ptr, size_t size)=0
Definition: smalignedarray.cc:7
virtual unsigned char * mmap_mem(size_t &remaining)=0
virtual int get_byte()=0
virtual GenericIn * open_subfile(size_t pos, size_t len)=0