cassiniindexfile.cpp
48 lines
| 990 B
| text/x-c
|
CppLexer
r5 | #include "cassiniindexfile.h" | |||
#include <QFile> | ||||
#include <stdio.h> | ||||
#include <QStringList> | ||||
CassiniIndexFile::CassiniIndexFile() | ||||
{ | ||||
} | ||||
CassiniIndexFile::~CassiniIndexFile() | ||||
{ | ||||
} | ||||
QList<CassiniIndexLine> CassiniIndexFile::loadFile(const QString &file) | ||||
{ | ||||
QFile dataFile(file); | ||||
dataFile.open(QIODevice::ReadOnly); | ||||
QList<CassiniIndexLine> lines; | ||||
if(dataFile.isOpen()) | ||||
{ | ||||
QString line; | ||||
QStringList cels; | ||||
CassiniIndexLine indexLine; | ||||
line=dataFile.readLine(); | ||||
while(!dataFile.atEnd()) | ||||
{ | ||||
line=dataFile.readLine(); | ||||
cels= line.split(','); | ||||
for(int i=0;i<8;i++) | ||||
{ | ||||
indexLine.cels[i]=""; | ||||
} | ||||
if(cels.count()<=8) | ||||
{ | ||||
for(int i=0;i<cels.count();i++) | ||||
{ | ||||
indexLine.cels[i]=cels.at(i); | ||||
} | ||||
lines.append(indexLine); | ||||
} | ||||
} | ||||
} | ||||
return lines; | ||||
} | ||||