TextFile scripting
This commit is contained in:
+16
-1
@@ -8,7 +8,7 @@
|
||||
#include <QThreadPool>
|
||||
#include <QSemaphore>
|
||||
#include "database.h"
|
||||
#include "imageinfo.h"
|
||||
#include "imageinfodata.h"
|
||||
|
||||
class BatchProcessing;
|
||||
class Solver;
|
||||
@@ -48,6 +48,7 @@ public:
|
||||
Q_INVOKABLE QJSValue getFloat(const QString &label = QString(), double value = 0, int decimals = 3) const;
|
||||
Q_INVOKABLE QJSValue getItem(const QStringList &items, const QString &label = "", int current = 0) const;
|
||||
Q_INVOKABLE void plot(const QJSValue &pointsArray);
|
||||
Q_INVOKABLE QJSValue openFile(const QString &fileName, const QString &mode = "r");
|
||||
bool convert(File *file, QString &outpath, const QString &format, const QVariantMap ¶ms, bool async);
|
||||
#ifdef PLATESOLVER
|
||||
Q_INVOKABLE void setSolverProfile(int index);
|
||||
@@ -143,6 +144,20 @@ public:
|
||||
Q_INVOKABLE void addKeyword(const QString &key, const QVariant &value, const QString &comment = QString());
|
||||
};
|
||||
|
||||
class TextFile : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
QFile _fr;
|
||||
public:
|
||||
bool open(const QString &path, const QString &mode);
|
||||
Q_INVOKABLE void write(const QString &data);
|
||||
Q_INVOKABLE QString read(int maxlen);
|
||||
Q_INVOKABLE QString readLine();
|
||||
Q_INVOKABLE QString readAll();
|
||||
Q_INVOKABLE bool seek(qint64 offset);
|
||||
Q_INVOKABLE qint64 pos();
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif // SCRIPTENGINE_H
|
||||
|
||||
Reference in New Issue
Block a user