STIR
6.2.0
|
A class to read/store the file signature. More...
#include "stir/IO/FileSignature.h"
Public Member Functions | |
FileSignature (std::istream &input) | |
read signature More... | |
FileSignature (const std::string &filename) | |
open file and read signature | |
const char * | get_signature () const |
get access to the signature More... | |
std::size_t | size () const |
return size of valid signature read from the file | |
A class to read/store the file signature.
Most file formats have a 'magic number' at the start, which allows easy recognition. This class provides an interface to reading and storing that signature.
The current implementation reads a signature of maximum 1024 bytes. The buffer is initialised to zero before reading.
|
inlineexplicit |
read signature
The signature will be read from the current point in the stream. The seekg pointer will be advanced by max 1024.
|
inline |
get access to the signature
Data is only valid up to size() (currently max 1024)
Referenced by stir::ecat::ecat7::ECAT7DynamicDiscretisedDensityInputFileFormat::actual_can_read(), stir::ecat::ecat7::ECAT966ListmodeInputFileFormat::actual_can_read(), stir::ecat::ecat7::ECAT966ListmodeInputFileFormat::can_read(), stir::ProjData::read_from_file(), stir::DynamicProjData::set_start_time_in_secs_since_1970(), and stir::TimeFrameDefinitions::TimeFrameDefinitions().