STIR 6.4.0
stir::FileSignature Class Reference

A class to read/store the file signature. More...

#include "stir/IO/FileSignature.h"

Public Member Functions

 FileSignature (std::istream &input)
 read signature
 
 FileSignature (const std::string &filename)
 open file and read signature
 
const char * get_signature () const
 get access to the signature
 
std::size_t size () const
 return size of valid signature read from the file
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ FileSignature()

stir::FileSignature::FileSignature ( std::istream & input)
inlineexplicit

read signature

The signature will be read from the current point in the stream. The seekg pointer will be advanced by max 1024.

Member Function Documentation

◆ get_signature()


The documentation for this class was generated from the following file: