24 #ifndef __FIREVISION_FVUTILS_FILEFORMAT_FVFILE_H_ 25 #define __FIREVISION_FVUTILS_FILEFORMAT_FVFILE_H_ 27 #include <fvutils/fileformat/fvff.h> 28 #include <fvutils/fileformat/fvfile_block.h> 57 virtual void write(
const char *file_name);
58 virtual void read(
const char *file_name);
61 static bool has_magic_token(
const char *filename,
unsigned short int magic_token);
64 typedef std::list<FireVisionDataFileBlock *>
BlockList;
74 BlockList::iterator __bi;
76 unsigned int __magic_token;
77 unsigned int __version;
size_t num_blocks()
Get the number of available info blocks.
size_t _spec_header_size
Size in bytes of _spec_header.
virtual void add_block(FireVisionDataFileBlock *block)
Add a block.
virtual ~FireVisionDataFile()
Destructor.
FireVision File Format data block.
bool is_big_endian()
Check if data is encoded as big endian.
std::list< FireVisionDataFileBlock * > BlockList
List of FireVision data file blocks.
bool is_little_endian()
Check if data is encoded as little endian.
static bool has_magic_token(const char *filename, unsigned short int magic_token)
Check if file has a certain magic token.
virtual void write(const char *file_name)
Write file.
virtual void read(const char *file_name)
Read file.
const char * get_comment() const
Get comment.
static unsigned short int read_magic_token(const char *filename)
Get magic token from file.
unsigned int version()
Get the version of the file.
FireVisionDataFile(unsigned short int magic_token, unsigned short int version)
Constructor.
void * _spec_header
Content specific header.
void set_owns_blocks(bool owns_blocks)
Lets the file take over the ownership and give up the ownership of the blocks, respectively.
FireVision File Format for data files.
void set_comment(const char *comment)
Set comment.
unsigned int magic_token()
Get the magic token of the file.
virtual void clear()
Clear internal storage.
BlockList & blocks()
Get blocks.