Public Types | Signals | Public Member Functions | List of all members
pqDelimitedTextParser Class Reference

Parses a delimited text file (e.g. More...

#include <pqDelimitedTextParser.h>

Inherits QObject.

Public Types

enum  SeriesT { COLUMN_SERIES }
 

Signals

void startParsing ()
 Signal emitted when parsing begins. More...
 
void parseSeries (const QStringList &)
 Signal that will be emitted once for each data series contained in the parsed file. More...
 
void finishParsing ()
 Signal emitted when parsing ends. More...
 

Public Member Functions

 pqDelimitedTextParser (SeriesT series, char delimiter)
 Initializes the parser with the delimiter that will be used to separate fields on the same line within parsed files. More...
 
void parse (const QString &path)
 Call this to parse a filesystem file. More...
 

Detailed Description

Parses a delimited text file (e.g.

a CSV or tab-delimited file), and emits signals that represent data series from the file.

To use it, create an instance of pqDelimitedTextParser, passing the delimiter character in the constructor. Then, connect the startParsing(), parseSeries(), and finishParsing() signals to slots. Call parse() with the filename of the file to be parsed, and the parseSeries() signal will be emitted for each series of values contained within the file.

Definition at line 26 of file pqDelimitedTextParser.h.

Member Enumeration Documentation

◆ SeriesT

Enumerator
COLUMN_SERIES 

Data series are organized in columns.

Definition at line 31 of file pqDelimitedTextParser.h.

Constructor & Destructor Documentation

◆ pqDelimitedTextParser()

pqDelimitedTextParser::pqDelimitedTextParser ( SeriesT  series,
char  delimiter 
)

Initializes the parser with the delimiter that will be used to separate fields on the same line within parsed files.

Member Function Documentation

◆ parse()

void pqDelimitedTextParser::parse ( const QString &  path)

Call this to parse a filesystem file.

◆ startParsing

void pqDelimitedTextParser::startParsing ( )
signal

Signal emitted when parsing begins.

◆ parseSeries

void pqDelimitedTextParser::parseSeries ( const QStringList &  )
signal

Signal that will be emitted once for each data series contained in the parsed file.

◆ finishParsing

void pqDelimitedTextParser::finishParsing ( )
signal

Signal emitted when parsing ends.


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