SpectMorph
smstdioin.hh
1 // Licensed GNU LGPL v3 or later: http://www.gnu.org/licenses/lgpl.html
2 
3 #ifndef SPECTMORPH_STDIO_IN_HH
4 #define SPECTMORPH_STDIO_IN_HH
5 
6 #include <string>
7 #include "smgenericin.hh"
8 
9 namespace SpectMorph
10 {
11 
12 class StdioIn : public GenericIn
13 {
14  FILE *file;
15  std::string filename;
16 
17  StdioIn (FILE *file, const std::string& filename);
18  ~StdioIn();
19 public:
20  static GenericIn* open (const std::string& filename);
21 
22  int get_byte(); // like fgetc
23  int read (void *ptr, size_t size);
24  bool skip (size_t size);
25  unsigned char *mmap_mem (size_t& remaining);
26  size_t get_pos();
27  GenericIn *open_subfile (size_t pos, size_t len);
28 };
29 
30 }
31 
32 #endif /* SPECTMORPH_STDIO_IN_HH */
size_t get_pos()
Definition: smstdioin.cc:68
GenericIn * open_subfile(size_t pos, size_t len)
Definition: smstdioin.cc:74
Generic Input Stream.
Definition: smgenericin.hh:17
Definition: smstdioin.hh:12
int get_byte()
Definition: smstdioin.cc:42
unsigned char * mmap_mem(size_t &remaining)
Definition: smstdioin.cc:62
bool skip(size_t size)
Definition: smstdioin.cc:54
Definition: smalignedarray.cc:7
int read(void *ptr, size_t size)
Definition: smstdioin.cc:48