STIR  6.2.0
Public Member Functions | List of all members
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 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
 

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()

const char* stir::FileSignature::get_signature ( ) const
inline

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