00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #ifndef SPECTMORPH_STDIO_SUB_IN_HH
00019 #define SPECTMORPH_STDIO_SUB_IN_HH
00020
00021 #include <string>
00022 #include "smgenericin.hh"
00023
00024 namespace SpectMorph
00025 {
00026
00027 class StdioSubIn : public GenericIn
00028 {
00029 FILE *file;
00030 size_t file_pos;
00031 size_t file_len;
00032
00033 StdioSubIn (FILE *file, size_t pos, size_t len);
00034 public:
00035 static GenericIn* open (const std::string& filename, size_t pos, size_t len);
00036
00037 int get_byte();
00038 int read (void *ptr, size_t size);
00039 bool skip (size_t size);
00040 unsigned char *mmap_mem (size_t& remaining);
00041 size_t get_pos();
00042 GenericIn *open_subfile (size_t pos, size_t len);
00043 };
00044
00045 }
00046
00047 #endif