40 lines
955 B
C++
40 lines
955 B
C++
|
|
#ifndef FIEBDC_H
|
||
|
|
#define FIEBDC_H
|
||
|
|
|
||
|
|
#include <QString>
|
||
|
|
#include <QVector>
|
||
|
|
#include <QMap>
|
||
|
|
#include <QRegularExpression>
|
||
|
|
|
||
|
|
|
||
|
|
class Budget {
|
||
|
|
public:
|
||
|
|
QString filename;
|
||
|
|
};
|
||
|
|
|
||
|
|
class FIEBDC {
|
||
|
|
private:
|
||
|
|
Budget* __budget;
|
||
|
|
QString __filename;
|
||
|
|
bool __cancel;
|
||
|
|
QVector<QString> __format_list;
|
||
|
|
QMap<QString, QString> __character_sets_dict;
|
||
|
|
QString __file_format;
|
||
|
|
QString __generator;
|
||
|
|
QString __character_set;
|
||
|
|
QMap<QString, QRegularExpression> __pattern;
|
||
|
|
void initializePatterns();
|
||
|
|
void parseV(QStringList field_list);
|
||
|
|
void cancel();
|
||
|
|
QString eraseControlCharacters(const QString& input);
|
||
|
|
bool validateCode(const QString& code);
|
||
|
|
QDate parseDate(const QString& date);
|
||
|
|
void parseRecord(const QString& record);
|
||
|
|
|
||
|
|
public:
|
||
|
|
FIEBDC(QString filename = "", Budget* budget = nullptr);
|
||
|
|
void readFile(Budget* budget = nullptr, QString filename = "");
|
||
|
|
};
|
||
|
|
|
||
|
|
#endif // FIEBDC_H
|