2018-07-11 23:09:22 -04:00
|
|
|
#ifndef VARICODE_H
|
|
|
|
#define VARICODE_H
|
|
|
|
|
2018-07-12 09:54:56 -04:00
|
|
|
/**
|
|
|
|
* (C) 2018 Jordan Sherer <kn4crd@gmail.com> - All Rights Reserved
|
|
|
|
**/
|
|
|
|
|
|
|
|
#include <QBitArray>
|
2018-07-12 15:14:41 -04:00
|
|
|
#include <QRegularExpression>
|
|
|
|
#include <QRegExp>
|
2018-07-11 23:09:22 -04:00
|
|
|
#include <QString>
|
2018-07-12 09:54:56 -04:00
|
|
|
#include <QVector>
|
2018-07-11 23:09:22 -04:00
|
|
|
|
2018-07-12 15:14:41 -04:00
|
|
|
|
2018-07-11 23:09:22 -04:00
|
|
|
class Varicode
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
//Varicode();
|
|
|
|
|
2018-07-12 15:14:41 -04:00
|
|
|
static QStringList parseCallsigns(QString const &input);
|
|
|
|
static QStringList parseGrids(QString const &input);
|
|
|
|
|
|
|
|
|
2018-07-12 09:54:56 -04:00
|
|
|
QVector<bool> intToBits(qint64 value, int expected=0);
|
|
|
|
qint64 bitsToInt(QVector<bool> const value);
|
|
|
|
|
|
|
|
qint8 unpack5bits(QString const& value);
|
|
|
|
QString pack5bits(qint8 packed);
|
|
|
|
|
|
|
|
qint16 unpack16bits(QString const& value);
|
2018-07-11 23:09:22 -04:00
|
|
|
QString pack16bits(qint16 packed);
|
2018-07-12 09:54:56 -04:00
|
|
|
|
|
|
|
qint32 unpack32bits(QString const& value);
|
|
|
|
QString pack32bits(qint32 packed);
|
|
|
|
|
|
|
|
qint64 unpack64bits(QString const& value);
|
|
|
|
QString pack64bits(qint64 packed);
|
2018-07-11 23:09:22 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // VARICODE_H
|