PythonQtWrapper_QTextStream.h
98 lines
| 5.4 KiB
| text/x-c
|
CLexer
florianlink
|
r13 | #ifndef PYTHONQTWRAPPER_QTEXTSTREAM_H | ||
#define PYTHONQTWRAPPER_QTEXTSTREAM_H | ||||
#include <qtextstream.h> | ||||
#include <QObject> | ||||
florianlink
|
r24 | #include <PythonQt.h> | ||
florianlink
|
r13 | #include <QVariant> | ||
#include <qbytearray.h> | ||||
#include <qiodevice.h> | ||||
#include <qtextcodec.h> | ||||
#include <qtextstream.h> | ||||
florianlink
|
r24 | class PythonQtShell_QTextStream : public QTextStream | ||
{ | ||||
public: | ||||
PythonQtShell_QTextStream():QTextStream(),_wrapper(NULL) {}; | ||||
PythonQtShell_QTextStream(QIODevice* device):QTextStream(device),_wrapper(NULL) {}; | ||||
PythonQtShell_QTextStream(const QByteArray& array, QIODevice::OpenMode openMode = QIODevice::ReadOnly):QTextStream(array, openMode),_wrapper(NULL) {}; | ||||
PythonQtInstanceWrapper* _wrapper; | ||||
}; | ||||
florianlink
|
r13 | class PythonQtWrapper_QTextStream : public QObject | ||
{ Q_OBJECT | ||||
public: | ||||
Q_ENUMS(RealNumberNotation NumberFlag FieldAlignment Status ) | ||||
florianlink
|
r73 | Q_FLAGS(NumberFlags ) | ||
florianlink
|
r13 | enum RealNumberNotation{ | ||
SmartNotation = QTextStream::SmartNotation, FixedNotation = QTextStream::FixedNotation, ScientificNotation = QTextStream::ScientificNotation}; | ||||
enum NumberFlag{ | ||||
ShowBase = QTextStream::ShowBase, ForcePoint = QTextStream::ForcePoint, ForceSign = QTextStream::ForceSign, UppercaseBase = QTextStream::UppercaseBase, UppercaseDigits = QTextStream::UppercaseDigits}; | ||||
enum FieldAlignment{ | ||||
AlignLeft = QTextStream::AlignLeft, AlignRight = QTextStream::AlignRight, AlignCenter = QTextStream::AlignCenter, AlignAccountingStyle = QTextStream::AlignAccountingStyle}; | ||||
enum Status{ | ||||
Ok = QTextStream::Ok, ReadPastEnd = QTextStream::ReadPastEnd, ReadCorruptData = QTextStream::ReadCorruptData}; | ||||
florianlink
|
r73 | Q_DECLARE_FLAGS(NumberFlags, NumberFlag) | ||
florianlink
|
r13 | public slots: | ||
QTextStream* new_QTextStream(); | ||||
QTextStream* new_QTextStream(QIODevice* device); | ||||
QTextStream* new_QTextStream(const QByteArray& array, QIODevice::OpenMode openMode = QIODevice::ReadOnly); | ||||
void delete_QTextStream(QTextStream* obj) { delete obj; } | ||||
florianlink
|
r73 | QTextCodec* codec(QTextStream* theWrappedObject) const; | ||
void skipWhiteSpace(QTextStream* theWrappedObject); | ||||
bool generateByteOrderMark(QTextStream* theWrappedObject) const; | ||||
void setFieldAlignment(QTextStream* theWrappedObject, QTextStream::FieldAlignment alignment); | ||||
void setGenerateByteOrderMark(QTextStream* theWrappedObject, bool generate); | ||||
QTextStream* readShort(QTextStream* theWrappedObject, signed short& i); | ||||
int fieldWidth(QTextStream* theWrappedObject) const; | ||||
QTextStream* writeFloat(QTextStream* theWrappedObject, float f); | ||||
bool seek(QTextStream* theWrappedObject, qint64 pos); | ||||
bool autoDetectUnicode(QTextStream* theWrappedObject) const; | ||||
QTextStream::FieldAlignment fieldAlignment(QTextStream* theWrappedObject) const; | ||||
void setNumberFlags(QTextStream* theWrappedObject, QTextStream::NumberFlags flags); | ||||
void setPadChar(QTextStream* theWrappedObject, QChar ch); | ||||
int integerBase(QTextStream* theWrappedObject) const; | ||||
bool atEnd(QTextStream* theWrappedObject) const; | ||||
QTextStream* writeShort(QTextStream* theWrappedObject, signed short i); | ||||
florianlink
|
r28 | QString read(QTextStream* theWrappedObject, qint64 maxlen); | ||
florianlink
|
r73 | QTextStream* writeBoolean(QTextStream* theWrappedObject, QBool b); | ||
QString readLine(QTextStream* theWrappedObject, qint64 maxlen = 0); | ||||
QTextStream* readUShort(QTextStream* theWrappedObject, unsigned short& i); | ||||
void resetStatus(QTextStream* theWrappedObject); | ||||
QIODevice* device(QTextStream* theWrappedObject) const; | ||||
QTextStream* readLongLong(QTextStream* theWrappedObject, qlonglong& i); | ||||
QChar padChar(QTextStream* theWrappedObject) const; | ||||
QTextStream* writeInt(QTextStream* theWrappedObject, signed int i); | ||||
void setFieldWidth(QTextStream* theWrappedObject, int width); | ||||
QTextStream* writeString(QTextStream* theWrappedObject, const QString& s); | ||||
florianlink
|
r28 | void flush(QTextStream* theWrappedObject); | ||
florianlink
|
r73 | QString readAll(QTextStream* theWrappedObject); | ||
QTextStream* writeByte(QTextStream* theWrappedObject, char ch); | ||||
florianlink
|
r28 | QTextStream::NumberFlags numberFlags(QTextStream* theWrappedObject) const; | ||
florianlink
|
r73 | QTextStream* readUInt(QTextStream* theWrappedObject, unsigned int& i); | ||
void setIntegerBase(QTextStream* theWrappedObject, int base); | ||||
florianlink
|
r24 | QTextStream::RealNumberNotation realNumberNotation(QTextStream* theWrappedObject) const; | ||
void setCodec(QTextStream* theWrappedObject, QTextCodec* codec); | ||||
florianlink
|
r73 | int realNumberPrecision(QTextStream* theWrappedObject) const; | ||
florianlink
|
r24 | void setCodec(QTextStream* theWrappedObject, const char* codecName); | ||
florianlink
|
r73 | QTextStream* writeByteArray(QTextStream* theWrappedObject, const QByteArray& array); | ||
QTextStream* readDouble(QTextStream* theWrappedObject, double& f); | ||||
florianlink
|
r28 | void setStatus(QTextStream* theWrappedObject, QTextStream::Status status); | ||
florianlink
|
r73 | QTextStream* writeDouble(QTextStream* theWrappedObject, double f); | ||
qint64 pos(QTextStream* theWrappedObject) const; | ||||
void setDevice(QTextStream* theWrappedObject, QIODevice* device); | ||||
QTextStream* readFloat(QTextStream* theWrappedObject, float& f); | ||||
florianlink
|
r24 | QTextStream::Status status(QTextStream* theWrappedObject) const; | ||
florianlink
|
r73 | void setAutoDetectUnicode(QTextStream* theWrappedObject, bool enabled); | ||
void setRealNumberNotation(QTextStream* theWrappedObject, QTextStream::RealNumberNotation notation); | ||||
QTextStream* readInt(QTextStream* theWrappedObject, signed int& i); | ||||
florianlink
|
r28 | void reset(QTextStream* theWrappedObject); | ||
florianlink
|
r73 | void setRealNumberPrecision(QTextStream* theWrappedObject, int precision); | ||
QTextStream* readByte(QTextStream* theWrappedObject, char& ch); | ||||
florianlink
|
r13 | }; | ||
#endif // PYTHONQTWRAPPER_QTEXTSTREAM_H | ||||