complete parsing
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
#include "./ui_mainwindow.h"
|
||||
#include "goods/goods.h"
|
||||
#include "check/check.h"
|
||||
|
||||
#include "settings.h"
|
||||
#include <iostream>
|
||||
|
||||
MainWindow::MainWindow(QWidget *parent)
|
||||
@@ -17,9 +17,11 @@ void MainWindow::setupStoresList() {
|
||||
// Make file format that is a regeeex which parse check, load these files
|
||||
// here
|
||||
parser = *(new Parser());
|
||||
#ifdef DEBUG
|
||||
for (auto module : parser.search_modules()) {
|
||||
std::cout << module << std::endl;
|
||||
std::cout << "Module: " << module << std::endl;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
void MainWindow::on_checkType_currentIndexChanged(int index) {
|
||||
@@ -34,5 +36,15 @@ void MainWindow::on_checkType_currentIndexChanged(int index) {
|
||||
}
|
||||
|
||||
void MainWindow::on_parseButton_clicked() {
|
||||
std::cout << ui->checkContent->toPlainText().toStdString() << std::endl;
|
||||
QString s(ui->checkContent->toPlainText());
|
||||
std::wstring check_plaintext = s.toStdWString();
|
||||
parser.set_module(parser.search_modules()[0]);
|
||||
|
||||
std::vector<Goods> c = parser.parse(check_plaintext);
|
||||
|
||||
Check check;
|
||||
|
||||
for (auto g : c) {
|
||||
check.add_goods(g);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user