3 #ifndef __stir_IO_InputFileFormat_h__ 4 #define __stir_IO_InputFileFormat_h__ 38 template <
class DataT>
42 typedef DataT data_type;
45 virtual bool can_read(
const FileSignature& signature, std::istream& input)
const 47 return this->actual_can_read(signature, input);
49 virtual bool can_read(
const FileSignature& signature,
const std::string& filename)
const 53 return this->actual_can_read(signature, input);
61 virtual unique_ptr<DataT>
read_from_file(std::istream& input)
const = 0;
75 virtual const std::string get_name()
const = 0;
78 virtual bool actual_can_read(
const FileSignature& signature, std::istream& input)
const = 0;
A class to read/store the file signature.
Definition: FileSignature.h:34
This file declares various utility functions.
FILE *& open_read_binary(FILE *&fptr, const string &name)
opens a FILE for reading binary data. Calls error() when it does not succeed.
Definition: utilities.cxx:79
unique_ptr< DataT > read_from_file(const FileSignature &signature, FileT file)
Function that reads data from file using the default InputFileFormatRegistry, using the provided File...
Definition: read_from_file.h:46
Declaration of class stir::FileSignature.
Import of std::unique_ptr into the stir namespace, together with work-arounds for other compilers...