namespace OmniReader {
Reader *GetReader(OmniReader::Format option) {
switch (option) {
case OmniReader::Format::PlainText:
return new PlainTextReader();
case OmniReader::Format::BZ2:
return new BZ2Reader();
case OmniReader::Format::GZ:
return new GZReader();
default:
return nullptr;
Has a high chance of leaking memory due to using a raw pointer for the reader. We should use a std::shared_ptr<XReader>
or `std::unique_ptr<XReader> instead.
Has a high chance of leaking memory due to using a raw pointer for the reader. We should use a
std::shared_ptr<XReader>
or`std::unique_ptr<XReader>
instead.