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::TextReader Class Reference

#include "textio.hh"

Inheritance diagram for multovl::io::TextReader:
multovl::io::TrackReader

Public Member Functions

 TextReader (const std::string &infname, Fileformat::Kind format)
 
virtual std::string read_into (std::string &chrom, Region &reg)
 
virtual void add_error (const std::string &msg)
 Adds an error message to _errors, nicely decorated with linecount.
 
- Public Member Functions inherited from multovl::io::TrackReader
 TrackReader ()
 default init
 
const Errorserrors () const
 

Detailed Description

TextReader objects encapsulate an input stream from which they can read into a Reader object, one by one. TextReader-s are init-ed with a file name, the ctor opens the file for writing and the dtor closes it, RAII-style. Clients should instantiate a TextReader, then invoke its read_into() method, and use the resulting Region immediately for building up a MultiOverlap object.

Constructor & Destructor Documentation

multovl::io::TextReader::TextReader ( const std::string &  infname,
Fileformat::Kind  format 
)

Init a TextReader object to read from a file.

Parameters
infnamethe input file name.
formatthe format of the input file (must be known)

Member Function Documentation

virtual std::string multovl::io::TextReader::read_into ( std::string &  chrom,
Region reg 
)
virtual

Attempts to read from the wrapped input stream into a region. Reads the stream internally line-by-line, parses each line until a valid data line is found with which /reg/ is then updated. Comment and metainfo lines are ignored.

Parameters
chromstring to store the chromosome name for /reg/
regthe region this method tries to read into.
Returns
message containing information about how the parsing went. "" if all is OK, "EOF" if the internal stream was exhausted, or some error message.

Implements multovl::io::TrackReader.


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