Used to parse files delimited in the way found in a typical Complete Genomics data file. More...
#include <DelimitedFile.hpp>
Public Types | |
enum | FieldParserType { REQUIRED = 0, OPTIONAL = 1 } |
typedef DelimitedFileMetadata | Metadata |
typedef DelimitedLineParser::EmptyFieldHandling | EmptyFieldHandling |
typedef DelimitedLineParser::StrictnessChecking | StrictnessChecking |
Public Member Functions | |
DelimitedFile (std::istream &in, const std::string &fileName, char delimiter= '\t', EmptyFieldHandling emptyHandling=DelimitedLineParser::PROCESS_EMPTY_FIELDS, StrictnessChecking strictnessChecking=DelimitedLineParser::RELAXED_CHECKING) | |
template<class Field > | |
void | addField (const Field &parser, FieldParserType ft=REQUIRED) |
void | addAllFields (std::vector< std::string > &fields) |
bool | next () |
const Metadata & | getMetadata () const |
const std::vector< std::string > & | getColumnHeaders () const |
size_t | getFieldOffset (const std::string &fieldName) const |
bool | hasField (const std::string &fieldName) const |
DelimitedLineParser & | getDelimitedLineParser () |
const std::string & | getLine () const |
Used to parse files delimited in the way found in a typical Complete Genomics data file.
Example:
string chromosome; uint32_t offset; DelimitedFile df(cin); df.addField(StringField("chromosome", &chromosome)); df.addField(ValueField<uint32_t>("offset", &offset)); while (df.next()) cout << chromosome << "\t" << offset << endl;