core/vidl_vil1/vidl_vil1_file_sequence.h

Go to the documentation of this file.
00001 // This is core/vidl_vil1/vidl_vil1_file_sequence.h
00002 #ifndef vidl_vil1_file_sequence_h_
00003 #define vidl_vil1_file_sequence_h_
00004 //:
00005 // \file
00006 // \author awf@robots.ox.ac.uk
00007 // Created: 18 Dec 01
00008 // copied by l.e.galup to vxl/vidl_vil1
00009 // 10-18-02
00010 
00011 #include <vcl_cstdio.h>
00012 #include <vcl_vector.h>
00013 #include <vcl_string.h>
00014 
00015 #include <vxl_config.h> // for vxl_int_64
00016 
00017 class vidl_vil1_file_sequence
00018 {
00019 #if VXL_HAS_INT_64
00020   typedef vxl_int_64 offset_t;
00021 #else // vcl_int_64 is #defined to void
00022   typedef long offset_t;
00023 #endif
00024  public:
00025   vidl_vil1_file_sequence() {}
00026   vidl_vil1_file_sequence(vcl_string const& fmt) { open(fmt); }
00027   ~vidl_vil1_file_sequence() {}
00028 
00029   bool open(vcl_string const& fmt);
00030   void close();
00031 
00032   void seek(offset_t to);
00033   offset_t tell() const;
00034   int read(void*, unsigned int);
00035   bool ok() const { return current_file_index != -1; }
00036 
00037  private:
00038   int current_file_index;
00039   vcl_vector<vcl_string> filenames;
00040   vcl_vector<vcl_FILE*> fps;
00041   vcl_vector<unsigned int> filesizes;
00042   vcl_vector<offset_t> start_byte;
00043 };
00044 
00045 #endif   // vidl_vil1_file_sequence_h_

Generated on Tue Dec 2 05:09:13 2008 for core/vidl_vil1 by  doxygen 1.5.1