This file looks large and may slow your browser down if we attempt
to syntax highlight it, so we are showing it without any
pretty colors.
Highlight
it anyway.
| 1 |
#ifndef UTILS_H |
| 2 |
#define UTILS_H |
| 3 |
|
| 4 |
#include <QString> |
| 5 |
#include <QMap> |
| 6 |
#include <QSharedPointer> |
| 7 |
#include "introspection.h" |
| 8 |
|
| 9 |
class QXmlStreamReader; |
| 10 |
class QXmlStreamWriter; |
| 11 |
class LEInputStream; |
| 12 |
class LEOutputStream; |
| 13 |
|
| 14 |
// function declarations for accessing the generated parser classes |
| 15 |
const Introspectable* parse(const QString& key, LEInputStream& in); |
| 16 |
void serialize(const Introspectable* i, const QString& key, LEOutputStream& out); |
| 17 |
const QMap<QString,QSharedPointer<const Introspectable> > parse(QXmlStreamReader& in); |
| 18 |
|
| 19 |
// |
| 20 |
QByteArray escapeByteArray(const QByteArray& b); |
| 21 |
|
| 22 |
QVector<quint16> toUInt16Vector(const QString& s); |
| 23 |
|
| 24 |
QString toString(const QVector<quint16>& v); |
| 25 |
|
| 26 |
void print(QXmlStreamWriter& out, const Introspectable* i); |
| 27 |
|
| 28 |
QMap<QString, QByteArray> readStreams(const QString& file); |
| 29 |
|
| 30 |
QMap<QString, QSharedPointer<const Introspectable> > |
| 31 |
parseStreams(const QMap<QString, QByteArray>& streams); |
| 32 |
|
| 33 |
QMap<QString, QByteArray> serialize(const QMap<QString, QSharedPointer<const Introspectable> >& m); |
| 34 |
|
| 35 |
QByteArray streamsToXml(const QMap<QString, QSharedPointer<const Introspectable> >& streams); |
| 36 |
|
| 37 |
QByteArray streamsToExtendedXml(const QMap<QString, QSharedPointer<const Introspectable> >& streams); |
| 38 |
|
| 39 |
void write(const QString& name, const QByteArray& data); |
| 40 |
|
| 41 |
void printWithExtendedParser(QXmlStreamWriter& out, const Introspectable* i); |
| 42 |
|
| 43 |
#endif |