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

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 virtual 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 > -> auto
Return a unique_ptr to an instance of the specified ReaderType.

Function documentation

template<class ReaderType>
auto arcsdec::v_1_0_0::details::CreateReader<ReaderType>::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.

Parameters
filename in The name of the file to choose a FileReader
selection
formats in Set of supported formats
readers in Set of available file readers