A class that parses delimited lines. More...
#include <DelimitedLineParser.hpp>
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 > | |
DelimitedLineParser & | addField (const Field &field) |
Adds another DelimitedFieldParser to this DelimitedLineParser. | |
template<class Field > | |
DelimitedLineParser & | setField (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 |
A class that parses delimited lines.
Enumeration to describe how empty fields are handled in DelimitedLineParser::parseLine().
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.