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>
55 virtual void write(
const char *file_name);
56 virtual void read(
const char *file_name);
62 typedef std::list<FireVisionDataFileBlock *>
BlockList;
72 BlockList::iterator bi_;
74 unsigned int magic_token_;
75 unsigned int version_;
FireVision File Format data block.
FireVision File Format for data files.
unsigned int version()
Get the version of the file.
virtual void read(const char *file_name)
Read file.
void * _spec_header
Content specific header.
unsigned int magic_token()
Get the magic token of the file.
FireVisionDataFile(unsigned short int magic_token, unsigned short int version)
Constructor.
virtual void clear()
Clear internal storage.
size_t num_blocks()
Get the number of available info blocks.
bool is_little_endian()
Check if data is encoded as little endian.
size_t _spec_header_size
Size in bytes of _spec_header.
static unsigned short int read_magic_token(const char *filename)
Get magic token from file.
void set_comment(const char *comment)
Set comment.
virtual void add_block(FireVisionDataFileBlock *block)
Add a block.
std::list< FireVisionDataFileBlock * > BlockList
List of FireVision data file blocks.
const char * get_comment() const
Get comment.
static bool has_magic_token(const char *filename, unsigned short int magic_token)
Check if file has a certain magic token.
bool is_big_endian()
Check if data is encoded as big endian.
virtual void write(const char *file_name)
Write file.
void set_owns_blocks(bool owns_blocks)
Lets the file take over the ownership and give up the ownership of the blocks, respectively.
BlockList & blocks()
Get blocks.
virtual ~FireVisionDataFile()
Destructor.