#include <csvmanager.h>
Signals | |
void | dataReady (const QVector< QVector< QString > > &data) |
Signal emitted when the data is ready. | |
Public Member Functions | |
CSVManager (QObject *parent=nullptr) | |
QVector< QVector< QString > > | readCSV (const QString &filename, const QString &delimiter, bool firstRowHeader=true) |
Reads a CSV file and returns the data as a 2D QVector of QString values. | |
QVector< QVector< QString > > | filterByColumn (int column, const QString &value) const |
Filters the data based on a specific column and value. | |
QVector< QVector< QString > > | filterByColumn (const QVector< QVector< QString > > &data, int column, const QString &value) const |
Filters the provided data based on a specific column and value. | |
QStringList | getDistinctColumnValues (int column) const |
Retrieves the distinct values in a specific column. | |
QVector< QString > | getColumnValues (const QVector< QVector< QString > > &data, int column) const |
Retrieves the values in a specific column from the provided data. | |
|
explicit |
|
signal |
Signal emitted when the data is ready.
data | The data as a QVector of QVector<QString>. |
QVector< QVector< QString > > CSVManager::filterByColumn | ( | const QVector< QVector< QString > > & | data, |
int | column, | ||
const QString & | value | ||
) | const |
Filters the provided data based on a specific column and value.
data | The data to filter. |
column | The index of the column to filter by. |
value | The value to filter for in the specified column. |
QVector< QVector< QString > > CSVManager::filterByColumn | ( | int | column, |
const QString & | value | ||
) | const |
Filters the data based on a specific column and value.
column | The index of the column to filter by. |
value | The value to filter for in the specified column. |
QVector< QString > CSVManager::getColumnValues | ( | const QVector< QVector< QString > > & | data, |
int | column | ||
) | const |
Retrieves the values in a specific column from the provided data.
data | The data to extract column values from. |
column | The index of the column to extract values from. |
QStringList CSVManager::getDistinctColumnValues | ( | int | column | ) | const |
Retrieves the distinct values in a specific column.
column | The index of the column to retrieve distinct values from. |
QVector< QVector< QString > > CSVManager::readCSV | ( | const QString & | filename, |
const QString & | delimiter, | ||
bool | firstRowHeader = true |
||
) |
Reads a CSV file and returns the data as a 2D QVector of QString values.
filename | The filename of the CSV file to read. |
delimiter | The delimiter used in the CSV file. |
firstRowHeader | Flag indicating whether the first row is a header row. |