template<class ReaderType>
arcsdec::v_1_0_0::details::CreateReader struct final

Functor to safely create a unique_ptr to a downcasted FileReader.

Template parameters
ReaderType Concrete type of the required FileReader

It will either provide a valid FileReader of the requested type or will throw. It will never silently fail nor provide a nullptr.

Constructors, destructors, conversion operators

~CreateReader() defaulted noexcept
Default destructor.

Public functions

auto operator()(const std::string& filename, const FileReaderSelection& selection, const FormatList& formats, const FileReaders& readers) const -> std::unique_ptr<ReaderType>
Return a unique_ptr to an instance of the specified ReaderType.

Function documentation

template<class ReaderType>
std::unique_ptr<ReaderType> arcsdec::v_1_0_0::details::CreateReader<ReaderType>::operator()(const std::string& filename, const FileReaderSelection& selection, const FormatList& formats, const FileReaders& readers) const

Return a unique_ptr to an instance of the specified ReaderType.

Parameters
filename in The name of the file to choose a FileReader
selection in FileReaderSelection to select from
formats in Set of supported formats
readers in Set of available file readers
Returns Instance of the specified ReaderType