cgatools::util::DelimitedLineParser Class Reference

A class that parses delimited lines. More...

#include <DelimitedLineParser.hpp>

List of all members.

Public Types

enum  EmptyFieldHandling { PROCESS_EMPTY_FIELDS = 0, SKIP_EMPTY_FIELDS = 1 }
 

Enumeration to describe how empty fields are handled in DelimitedLineParser::parseLine().

More...
enum  StrictnessChecking { STRICT_CHECKING = 0, RELAXED_CHECKING = 1 }
 

Enumeration to describe how strictly we should check for badly formed input.

More...
typedef std::vector
< boost::shared_ptr
< DelimitedFieldParser > > 
Fields

Public Member Functions

 DelimitedLineParser ()
 Construct a DelimitedLineParser with no fields.
template<class Field >
DelimitedLineParseraddField (const Field &field)
 Adds another DelimitedFieldParser to this DelimitedLineParser.
template<class Field >
DelimitedLineParsersetField (size_t offset, const Field &field)
 Overrides the DelimitedFieldParser at a given field offset.
void parseLine (const char *first, const char *last, char delimiter= '\t', EmptyFieldHandling emptyHandling=PROCESS_EMPTY_FIELDS, StrictnessChecking strictnessChecking=RELAXED_CHECKING)
 Parses the given line.
void parseLine (const std::string &line, char delimiter= '\t', EmptyFieldHandling emptyHandling=PROCESS_EMPTY_FIELDS, StrictnessChecking strictnessChecking=RELAXED_CHECKING)
const Fields & getFields () const
 Provides read-only access to the list of currently defined fields.

Friends

class DelimitedFile

Detailed Description

A class that parses delimited lines.


Member Enumeration Documentation

Enumeration to describe how empty fields are handled in DelimitedLineParser::parseLine().

Enumerator:
PROCESS_EMPTY_FIELDS 

Treat empty fields like any other field.

Fields with empty names at the end of the line are still ignored.

SKIP_EMPTY_FIELDS 

Skip empty fields, such that they do not contribute to the field count for the line.

Enumeration to describe how strictly we should check for badly formed input.

Enumerator:
STRICT_CHECKING 

Strict syntax checking -- no fields at the end of the line, for example.

RELAXED_CHECKING 

Relaxed syntax checking -- allows empty header fields at the end of the line, for example.


Member Function Documentation

template<class Field >
DelimitedLineParser& cgatools::util::DelimitedLineParser::addField ( const Field &  field  )  [inline]

Adds another DelimitedFieldParser to this DelimitedLineParser.

The DelimitedFieldParsers must be added in order from left to right.


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