Force Directed Edge Bundling
 All Classes Functions Pages
Public Member Functions | Protected Member Functions | List of all members
FileParser Class Reference

#include <fileparser.h>

Public Member Functions

void setPattern (QList< QString >)
 
template<typename TYPE >
bool read (QString filename, TYPE &list)
 

Protected Member Functions

bool parseFromString (QList< Airport * > &, QString)
 
bool parseFromString (QList< Route * > &, QString)
 
bool parseFromString (QMap< QString, int > &, QString)
 
bool parseFromString (QMap< int, int > &, QString)
 

Detailed Description

FileParser reads an input stream from a given file location and tries to parse it to different data structures acoording to the structure it gets passed as an argument.

Member Function Documentation

bool FileParser::parseFromString ( QList< Airport * > &  list,
QString  line 
)
protected

Parsing a single line from the instream into a List of objects of type <Airport>

Parameters
listQList of Airport objects. The data structure to be written into.
lineThe line to be parsed.
Returns
boolean value that indicates the success of the file reading process.
bool FileParser::parseFromString ( QList< Route * > &  list,
QString  line 
)
protected

Parsing a single line from the instream into a List of objects of type <Route>

Parameters
listQList of Route objects. The data structure to be written into.
lineThe line to be parsed.
Returns
boolean value that indicates the success of the file reading process.
bool FileParser::parseFromString ( QMap< QString, int > &  map,
QString  line 
)
protected

Parsing a single line from the instream into a QMap objects of type <QString, int>

Parameters
listQMap of objects. The data structure to be written into.
lineThe line to be parsed.
Returns
boolean value that indicates the success of the file reading process.
bool FileParser::parseFromString ( QMap< int, int > &  map,
QString  line 
)
protected

Parsing a single line from the instream into a QMap objects of type <int, int>

Parameters
listQMap of objects. The data structure to be written into.
lineThe line to be parsed.
Returns
boolean value that indicates the success of the file reading process.
template<typename TYPE >
template bool FileParser::read< QMap< int, int > > ( QString  filename,
TYPE &  list 
)

read opens a file for the given filename and exports the containing data line by line into the list of the type TYPE passed as an argument

Parameters
filenameThe filename in a QString representation
listThe data structure to be written into. Several types of list are allowed.
Returns
boolean value that indicates the success of the file reading process.

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