WARNING: USE THIS SOFTWARE AT YOUR OWN RISK! THIS IS EXPERIMENTAL SOFTWARE NOT INTENDED FOR PRODUCTION USE! Zuble is currently an early stage prototype. As such Zuble is minimally tested and inherently unstable. It is provided for experimental, development, and demonstration purposes only. | Zuble QML Types | Zuble C++ Classes | Zuble Overview |
Zuble
0.1
Zuble Framework C++/QML extension API
|
Reads and writes UTF-8 text to an i/o stream. More...
#include <ZTextStream.h>
Public Types | |
enum | RealNumberNotation { SmartNotation = QTextStream::SmartNotation, FixedNotation = QTextStream::FixedNotation, ScientificNotation = QTextStream::ScientificNotation } |
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, WriteFailed = QTextStream::WriteFailed } |
enum | NumberFlag { ShowBase =QTextStream::ShowBase, ForcePoint = QTextStream::ForcePoint, ForceSign = QTextStream::ForceSign, UppercaseBase = QTextStream::UppercaseBase, UppercaseDigits = QTextStream::UppercaseDigits } |
typedef QSharedPointer< QTextStream > | QTextStreamPtr |
Public Slots | |
void | getQDevice (QIODevice **device) |
Public Member Functions | |
ZTextStream (QObject *parent=nullptr) | |
ZTextStream (const ZqIODevicePtr device, QObject *parent=nullptr) | |
ZTextStream (const ZqStringPtr string, QObject *parent=nullptr) | |
virtual | ~ZTextStream () |
QVariant | getTags () |
QObject * | getJsDevice () |
bool | getAutoDetectUnicode () const |
void | setAutoDetectUnicode (bool autoDetectOn) |
uint | getStatus () const |
bool | atEnd () const |
QVariant | pos () const |
void | setFieldAlignment (uint alignment) |
uint | getFieldAlignment () const |
void | setPadChar (uint ch) |
uint | getPadChar () const |
void | setFieldWidth (int width) |
int | getFieldWidth () const |
void | setNumberFlags (uint flags) |
uint | getNumberFlags () const |
void | setIntegerBase (int base) |
int | getIntegerBase () const |
void | setRealNumberNotation (uint notation) |
uint | getRealNumberNotation () const |
void | setRealNumberPrecision (int precision) |
int | getRealNumberPrecision () const |
QString | getString () const |
Q_INVOKABLE void | release () |
Q_INVOKABLE void | resetStatus () |
Q_INVOKABLE void | reset () |
Q_INVOKABLE void | flush () |
Q_INVOKABLE bool | seek (QVariant pos) |
Q_INVOKABLE void | skipWhiteSpace () |
Q_INVOKABLE void | setLocale (const QString &locale) |
Q_INVOKABLE QString | read (qint64 maxSize) |
Q_INVOKABLE QString | readLine (qint64 maxSize) |
Q_INVOKABLE QString | readAll () |
Q_INVOKABLE uint | readChar () |
Q_INVOKABLE signed short | readShort () |
Q_INVOKABLE unsigned short | readUShort () |
Q_INVOKABLE signed int | readInt () |
Q_INVOKABLE unsigned int | readUInt () |
Q_INVOKABLE signed long | readLong () |
Q_INVOKABLE unsigned long | readULong () |
Q_INVOKABLE qlonglong | readLongLong () |
Q_INVOKABLE qulonglong | readULongLong () |
Q_INVOKABLE float | readFloat () |
Q_INVOKABLE double | readDouble () |
Q_INVOKABLE QString | readString () |
Q_INVOKABLE QObject * | readBytes () |
Q_INVOKABLE bool | writeLine (const QString &text) |
Q_INVOKABLE bool | writeChar (uint data) |
Q_INVOKABLE bool | writeShort (signed short data) |
Q_INVOKABLE bool | writeUShort (unsigned short data) |
Q_INVOKABLE bool | writeInt (signed int data) |
Q_INVOKABLE bool | writeUInt (unsigned int data) |
Q_INVOKABLE bool | writeLong (signed long data) |
Q_INVOKABLE bool | writeULong (unsigned long data) |
Q_INVOKABLE bool | writeLongLong (qlonglong data) |
Q_INVOKABLE bool | writeULongLong (qulonglong data) |
Q_INVOKABLE bool | writeFloat (float data) |
Q_INVOKABLE bool | writeDouble (double data) |
Q_INVOKABLE bool | writeString (const QString &text) |
Q_INVOKABLE bool | writeBytes (QObject *data) |
Static Public Member Functions | |
static void | registerType () |
Registers ZTextStream as a QML type. More... | |
Protected Member Functions | |
void | createTags () |
void | initZioDevice () |
void | validateData () const |
void | validateReadable () const |
void | validateWritable () const |
Protected Attributes | |
ZqIODevicePtr | m_d |
QTextStream * | m_t |
ZqStringPtr | m_s |
ZioDevice * | m_zd |
Pointer to contained ZioDevice object. More... | |
Static Protected Attributes | |
static QVariant | m_tags |
QVariantMap of QTextStream enumerations for use by Javascript programs. More... | |
Properties | |
QVariant | tags |
A Javascript object containing QFile enumeration values. More... | |
QObject | device |
A ZioDevice object presents this object's QIODevice interface to Javascript programs. More... | |
bool | autoDetectUnicode |
bool | atEnd |
QVariant | pos |
uint | status |
uint | fieldAlignment |
uint | padChar |
int | fieldWidth |
uint | numberFlags |
int | integerBase |
uint | realNumberNotation |
int | realNumberPrecision |
QString | string |
Reads and writes UTF-8 text to an i/o stream.
This class presents a Javascript interface to Qt QTextStream objects. The text stream can be connected to either a QIODevice or QString object.
Text can be read and written using either Javascript strings, ZByteArray objects (Javascript wrapper objects for QByteArray) or various size integer, float and double types.
TBD: add ability to write bytes from Javascript array of integers?
Definition at line 49 of file ZTextStream.h.
typedef QSharedPointer<QTextStream> Zbl::ZTextStream::QTextStreamPtr |
Definition at line 58 of file ZTextStream.h.
Enumerator | |
---|---|
AlignLeft | |
AlignRight | |
AlignCenter | |
AlignAccountingStyle |
Definition at line 72 of file ZTextStream.h.
Enumerator | |
---|---|
ShowBase | |
ForcePoint | |
ForceSign | |
UppercaseBase | |
UppercaseDigits |
Definition at line 87 of file ZTextStream.h.
Enumerator | |
---|---|
SmartNotation | |
FixedNotation | |
ScientificNotation |
Definition at line 66 of file ZTextStream.h.
Enumerator | |
---|---|
Ok | |
ReadPastEnd | |
ReadCorruptData | |
WriteFailed |
Definition at line 79 of file ZTextStream.h.
|
explicit |
Definition at line 36 of file ZTextStream.cpp.
|
explicit |
Definition at line 52 of file ZTextStream.cpp.
|
explicit |
Definition at line 68 of file ZTextStream.cpp.
|
virtual |
Definition at line 84 of file ZTextStream.cpp.
bool Zbl::ZTextStream::atEnd | ( | ) | const |
Referenced by getStatus().
|
protected |
Definition at line 91 of file ZTextStream.cpp.
Referenced by ZTextStream().
void Zbl::ZTextStream::flush | ( | ) |
Definition at line 387 of file ZTextStream.cpp.
bool Zbl::ZTextStream::getAutoDetectUnicode | ( | ) | const |
Definition at line 186 of file ZTextStream.cpp.
Referenced by seek(), and setLocale().
uint Zbl::ZTextStream::getFieldAlignment | ( | ) | const |
Definition at line 261 of file ZTextStream.cpp.
int Zbl::ZTextStream::getFieldWidth | ( | ) | const |
Definition at line 278 of file ZTextStream.cpp.
int Zbl::ZTextStream::getIntegerBase | ( | ) | const |
Definition at line 329 of file ZTextStream.cpp.
QObject * Zbl::ZTextStream::getJsDevice | ( | ) |
Definition at line 173 of file ZTextStream.cpp.
uint Zbl::ZTextStream::getNumberFlags | ( | ) | const |
Definition at line 227 of file ZTextStream.cpp.
uint Zbl::ZTextStream::getPadChar | ( | ) | const |
Definition at line 312 of file ZTextStream.cpp.
|
slot |
Definition at line 180 of file ZTextStream.cpp.
Referenced by initZioDevice().
uint Zbl::ZTextStream::getRealNumberNotation | ( | ) | const |
Definition at line 244 of file ZTextStream.cpp.
int Zbl::ZTextStream::getRealNumberPrecision | ( | ) | const |
Definition at line 295 of file ZTextStream.cpp.
uint Zbl::ZTextStream::getStatus | ( | ) | const |
Definition at line 203 of file ZTextStream.cpp.
QString Zbl::ZTextStream::getString | ( | ) | const |
Definition at line 346 of file ZTextStream.cpp.
QVariant Zbl::ZTextStream::getTags | ( | ) |
Definition at line 168 of file ZTextStream.cpp.
|
protected |
Definition at line 121 of file ZTextStream.cpp.
Referenced by ZTextStream().
QVariant Zbl::ZTextStream::pos | ( | ) | const |
Referenced by getStatus().
QString Zbl::ZTextStream::read | ( | qint64 | maxSize | ) |
Definition at line 422 of file ZTextStream.cpp.
QString Zbl::ZTextStream::readAll | ( | ) |
Definition at line 431 of file ZTextStream.cpp.
QObject * Zbl::ZTextStream::readBytes | ( | ) |
Definition at line 485 of file ZTextStream.cpp.
readUShort readUInt readULong readULongLong readDouble uint Zbl::ZTextStream::readChar | ( | ) |
Definition at line 463 of file ZTextStream.cpp.
Q_INVOKABLE double Zbl::ZTextStream::readDouble | ( | ) |
Q_INVOKABLE float Zbl::ZTextStream::readFloat | ( | ) |
Q_INVOKABLE signed int Zbl::ZTextStream::readInt | ( | ) |
QString Zbl::ZTextStream::readLine | ( | qint64 | maxSize | ) |
Definition at line 413 of file ZTextStream.cpp.
Q_INVOKABLE signed long Zbl::ZTextStream::readLong | ( | ) |
Q_INVOKABLE qlonglong Zbl::ZTextStream::readLongLong | ( | ) |
Q_INVOKABLE signed short Zbl::ZTextStream::readShort | ( | ) |
QString Zbl::ZTextStream::readString | ( | ) |
Definition at line 474 of file ZTextStream.cpp.
Q_INVOKABLE unsigned int Zbl::ZTextStream::readUInt | ( | ) |
Q_INVOKABLE unsigned long Zbl::ZTextStream::readULong | ( | ) |
Q_INVOKABLE qulonglong Zbl::ZTextStream::readULongLong | ( | ) |
Q_INVOKABLE unsigned short Zbl::ZTextStream::readUShort | ( | ) |
|
static |
Registers ZTextStream as a QML type.
Definition at line 154 of file ZTextStream.cpp.
Referenced by Zbl::Zblcore::registerTypes().
void Zbl::ZTextStream::release | ( | ) |
Definition at line 365 of file ZTextStream.cpp.
void Zbl::ZTextStream::reset | ( | ) |
Definition at line 378 of file ZTextStream.cpp.
void Zbl::ZTextStream::resetStatus | ( | ) |
Definition at line 356 of file ZTextStream.cpp.
bool Zbl::ZTextStream::seek | ( | QVariant | pos | ) |
Definition at line 396 of file ZTextStream.cpp.
void Zbl::ZTextStream::setAutoDetectUnicode | ( | bool | autoDetectOn | ) |
Definition at line 194 of file ZTextStream.cpp.
void Zbl::ZTextStream::setFieldAlignment | ( | uint | alignment | ) |
Definition at line 269 of file ZTextStream.cpp.
void Zbl::ZTextStream::setFieldWidth | ( | int | width | ) |
Definition at line 286 of file ZTextStream.cpp.
void Zbl::ZTextStream::setIntegerBase | ( | int | base | ) |
Definition at line 337 of file ZTextStream.cpp.
void Zbl::ZTextStream::setLocale | ( | const QString & | locale | ) |
Definition at line 159 of file ZTextStream.cpp.
void Zbl::ZTextStream::setNumberFlags | ( | uint | flags | ) |
Definition at line 235 of file ZTextStream.cpp.
void Zbl::ZTextStream::setPadChar | ( | uint | ch | ) |
Definition at line 320 of file ZTextStream.cpp.
void Zbl::ZTextStream::setRealNumberNotation | ( | uint | notation | ) |
Definition at line 252 of file ZTextStream.cpp.
void Zbl::ZTextStream::setRealNumberPrecision | ( | int | precision | ) |
Definition at line 303 of file ZTextStream.cpp.
void Zbl::ZTextStream::skipWhiteSpace | ( | ) |
Definition at line 404 of file ZTextStream.cpp.
|
protected |
Definition at line 129 of file ZTextStream.cpp.
Referenced by flush(), getAutoDetectUnicode(), getFieldAlignment(), getFieldWidth(), getIntegerBase(), getNumberFlags(), getPadChar(), getRealNumberNotation(), getRealNumberPrecision(), getStatus(), getString(), reset(), resetStatus(), seek(), setAutoDetectUnicode(), setFieldAlignment(), setFieldWidth(), setIntegerBase(), setLocale(), setNumberFlags(), setPadChar(), setRealNumberNotation(), setRealNumberPrecision(), skipWhiteSpace(), and validateWritable().
|
protected |
Definition at line 138 of file ZTextStream.cpp.
Referenced by read(), readAll(), readBytes(), readChar(), readLine(), and readString().
|
protected |
Definition at line 145 of file ZTextStream.cpp.
Referenced by writeBytes(), writeChar(), writeLine(), and writeString().
bool Zbl::ZTextStream::writeBytes | ( | QObject * | data | ) |
Definition at line 531 of file ZTextStream.cpp.
writeUShort writeUInt writeULong writeULongLong writeDouble bool Zbl::ZTextStream::writeChar | ( | uint | data | ) |
Definition at line 521 of file ZTextStream.cpp.
Q_INVOKABLE bool Zbl::ZTextStream::writeDouble | ( | double | data | ) |
Q_INVOKABLE bool Zbl::ZTextStream::writeFloat | ( | float | data | ) |
Q_INVOKABLE bool Zbl::ZTextStream::writeInt | ( | signed int | data | ) |
bool Zbl::ZTextStream::writeLine | ( | const QString & | text | ) |
Definition at line 556 of file ZTextStream.cpp.
Q_INVOKABLE bool Zbl::ZTextStream::writeLong | ( | signed long | data | ) |
Q_INVOKABLE bool Zbl::ZTextStream::writeLongLong | ( | qlonglong | data | ) |
Q_INVOKABLE bool Zbl::ZTextStream::writeShort | ( | signed short | data | ) |
bool Zbl::ZTextStream::writeString | ( | const QString & | text | ) |
Definition at line 546 of file ZTextStream.cpp.
Q_INVOKABLE bool Zbl::ZTextStream::writeUInt | ( | unsigned int | data | ) |
Q_INVOKABLE bool Zbl::ZTextStream::writeULong | ( | unsigned long | data | ) |
Q_INVOKABLE bool Zbl::ZTextStream::writeULongLong | ( | qulonglong | data | ) |
Q_INVOKABLE bool Zbl::ZTextStream::writeUShort | ( | unsigned short | data | ) |
|
protected |
Definition at line 217 of file ZTextStream.h.
Referenced by release(), validateData(), validateReadable(), validateWritable(), and ZTextStream().
|
protected |
Definition at line 222 of file ZTextStream.h.
Referenced by validateData(), and ZTextStream().
|
protected |
Definition at line 220 of file ZTextStream.h.
Referenced by flush(), getAutoDetectUnicode(), getFieldAlignment(), getFieldWidth(), getIntegerBase(), getNumberFlags(), getPadChar(), getQDevice(), getRealNumberNotation(), getRealNumberPrecision(), getStatus(), getString(), read(), readAll(), readBytes(), readChar(), readLine(), readString(), release(), reset(), resetStatus(), seek(), setAutoDetectUnicode(), setFieldAlignment(), setFieldWidth(), setIntegerBase(), setLocale(), setNumberFlags(), setPadChar(), setRealNumberNotation(), setRealNumberPrecision(), skipWhiteSpace(), validateData(), writeBytes(), writeLine(), writeString(), ZTextStream(), and ~ZTextStream().
|
staticprotected |
QVariantMap of QTextStream enumerations for use by Javascript programs.
Definition at line 236 of file ZTextStream.h.
Referenced by createTags(), and getTags().
|
protected |
Pointer to contained ZioDevice object.
Definition at line 227 of file ZTextStream.h.
Referenced by getJsDevice(), and initZioDevice().
|
read |
Definition at line 126 of file ZTextStream.h.
|
readwrite |
Definition at line 124 of file ZTextStream.h.
|
read |
A ZioDevice object presents this object's QIODevice interface to Javascript programs.
Definition at line 120 of file ZTextStream.h.
|
readwrite |
Definition at line 130 of file ZTextStream.h.
|
readwrite |
Definition at line 132 of file ZTextStream.h.
|
readwrite |
Definition at line 134 of file ZTextStream.h.
|
readwrite |
Definition at line 133 of file ZTextStream.h.
|
readwrite |
Definition at line 131 of file ZTextStream.h.
|
read |
Definition at line 127 of file ZTextStream.h.
|
readwrite |
Definition at line 135 of file ZTextStream.h.
|
readwrite |
Definition at line 136 of file ZTextStream.h.
|
read |
Definition at line 129 of file ZTextStream.h.
|
read |
Definition at line 137 of file ZTextStream.h.
|
read |
A Javascript object containing QFile enumeration values.
Definition at line 113 of file ZTextStream.h.
Zuble documentation copyright © 2019 Bob Dinitto. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Zuble is a derivative work of Qt version 5. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.