fvfile.h
00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #ifndef __FIREVISION_FVUTILS_FILEFORMAT_FVFILE_H_
00025 #define __FIREVISION_FVUTILS_FILEFORMAT_FVFILE_H_
00026
00027 #include <fvutils/fileformat/fvff.h>
00028 #include <fvutils/fileformat/fvfile_block.h>
00029 #include <cstdlib>
00030 #include <list>
00031
00032 class FireVisionDataFile
00033 {
00034 public:
00035 FireVisionDataFile(unsigned short int magic_token, unsigned short int version);
00036 virtual ~FireVisionDataFile();
00037
00038 unsigned int magic_token();
00039 unsigned int version();
00040 bool is_big_endian();
00041 bool is_little_endian();
00042 size_t num_blocks();
00043
00044 const char * get_comment() const;
00045 void set_comment(const char *comment);
00046
00047 void set_owns_blocks(bool owns_blocks);
00048
00049 virtual void add_block(FireVisionDataFileBlock *block);
00050 virtual void clear();
00051
00052 virtual void write(const char *file_name);
00053 virtual void read(const char *file_name);
00054
00055 static unsigned short int read_magic_token(const char *filename);
00056 static bool has_magic_token(const char *filename, unsigned short int magic_token);
00057
00058
00059 typedef std::list<FireVisionDataFileBlock *> BlockList;
00060 BlockList & blocks();
00061
00062 protected:
00063 void *_spec_header;
00064 size_t _spec_header_size;
00065
00066 private:
00067 fvff_header_t *__header;
00068 BlockList __blocks;
00069 BlockList::iterator __bi;
00070
00071 unsigned int __magic_token;
00072 unsigned int __version;
00073
00074 char * __comment;
00075
00076 bool __owns_blocks;
00077 };
00078
00079
00080 #endif