-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathproject.cpp
More file actions
31 lines (27 loc) · 770 Bytes
/
Copy pathproject.cpp
File metadata and controls
31 lines (27 loc) · 770 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#include "project.h"
#include <QDebug>
#include <QFile>
#include <QRegExp>
Project::Project(QString filename)
{
this->filename = filename;
QFile file(filename);
if (!file.open(QIODevice::ReadOnly | QIODevice::Text))
return;
prepareFields(file.readLine());
while (!file.atEnd()) {
QString line = file.readLine();
}
}
void Project::prepareFields(QString line){
QRegExp rx("^.*\"");
rx.setMinimal(true);
line = line.remove(rx);
rx = QRegExp("\"[^\"]*$");
line = line.remove(rx);
QStringList strings = line.split("\",\"", QString::SkipEmptyParts);
QVector<QString> * vect = new QVector<QString>();
for(auto a = strings.constBegin(); a < strings.constEnd(); a++){
vect->push_back(*a);
}
}