multovl  1.3
Multiple overlaps of genomic regions
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Pages
Public Member Functions | List of all members
multovl::io::FileReader Class Reference

#include "fileio.hh"

Inheritance diagram for multovl::io::FileReader:

Public Member Functions

 FileReader (const std::string &infname, Fileformat::Kind format=Fileformat::UNKNOWN)
 
bool read_into (std::string &chrom, Region &reg)
 
bool finished () const
 
const Errorserrors () const
 

Detailed Description

FileReader objects implement reading regions from a track file. Clients should instantiate a FileReader with a file name, then invoke its read_into() method repeatedly, and use the resulting Region immediately for building up a MultiOverlap object.

Constructor & Destructor Documentation

multovl::io::FileReader::FileReader ( const std::string &  infname,
Fileformat::Kind  format = Fileformat::UNKNOWN 
)
explicit

Init a FileReader object to read from a file.

Parameters
infnamethe input file name.
formatthe file format if known. By default or if UNKNOWN is specified, then the format will be deduced automatically, see the Fileformat class for details.

Member Function Documentation

const Errors& multovl::io::FileReader::errors ( ) const
Returns
const access to the reader implementation's error collection object
bool multovl::io::FileReader::finished ( ) const
inline
Returns
true if all input has been squeezed out of the input file.
bool multovl::io::FileReader::read_into ( std::string &  chrom,
Region reg 
)

Attempts to read from the wrapped input file into a region. We keep reading the file so that the user gets all problems in one go.

Parameters
chromstring to store the chromosome name for /reg/
regthe region this method tries to read into.
Returns
/true/ if all went well, /false/ on errors. For details, invoke errors() and finished().

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