cgatools::util::DelimitedFile Class Reference

Used to parse files delimited in the way found in a typical Complete Genomics data file. More...

#include <DelimitedFile.hpp>

List of all members.

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 MetadatagetMetadata () const
const std::vector< std::string > & getColumnHeaders () const
size_t getFieldOffset (const std::string &fieldName) const
bool hasField (const std::string &fieldName) const
DelimitedLineParsergetDelimitedLineParser ()
const std::string & getLine () const

Detailed Description

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;

The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Defines

Generated by  doxygen 1.6.2