-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDOctaveVault.h
52 lines (37 loc) · 1.06 KB
/
DOctaveVault.h
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#ifndef DVAULTOCTAVE_H
#define DVAULTOCTAVE_H
#include <QList>
#include <QString>
#include <QFile>
#include <QTextStream>
/**
* Cool Feature. Write Octave-Files in correct syntax to provide some extra informations after logging.
*/
class DOctaveVault{
public:
DOctaveVault(QString filename, QList<QString> &logValues);
virtual ~DOctaveVault();
friend DOctaveVault& operator<<(DOctaveVault& cont,const QList<double> values){
cont.AddLogValue(values);
return cont;
}
int isOpen();
int size();
int rows();
int cols();
protected:
private:
void AddLogValue(const QList<double> logdata);
QString filename;
QFile logFile;
QTextStream logStream;
int m_nrOfCols;
int m_nrOfRows;
// extra-cool: allow editing of lines after they have been written. normally, files are just a stream of data with no understanding of a "line"
qint64 m_replaceRowNrPosition;
qint64 m_replaceColNrPosition;
void writeHeader();
void finishMatrixToOctaveFile();
void addValueToOctaveFile( QString name, QString data);
};
#endif // DVAULTOCTAVE_H