summaryrefslogtreecommitdiff
path: root/logger.cpp
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--logger.cpp19
1 files changed, 19 insertions, 0 deletions
diff --git a/logger.cpp b/logger.cpp
index 74b3d59..641987f 100644
--- a/logger.cpp
+++ b/logger.cpp
@@ -63,3 +63,22 @@ void writeReadingToFile(QString data, QString filename) {
out << data;
file.close();
}
+
+QString getLineFromFile(int lineNumber, QString filename) {
+ QFile file(filename);
+ if (!file.open(QIODevice::ReadWrite | QIODevice::Text)) {
+ qDebug() << "failed to open file";
+ return "0 : 0";
+ }
+ QTextStream inStream(&file);
+ QString line;
+ int i;
+ while(!inStream.atEnd() & (i < lineNumber | i < 0))
+ {
+ line = inStream.readLine();
+ qDebug() << line;
+ i++;
+ }
+ file.close();
+ return line;
+}