[go: up one dir, main page]

Menu

[d56ae5]: / types.h  Maximize  Restore  History

Download this file

113 lines (98 with data), 2.2 kB

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
#ifndef TYPES_H
#define TYPES_H
#include <QHash>
#include <QSet>
#include <QString>
typedef QHash<QString, QString> StringHash;
typedef QHash<QString, int> IntHash;
typedef QSet<QString> StringSet;
typedef QSet<int> IntSet;
#ifdef Q_WS_WIN
typedef unsigned long long uLong;
typedef long long sLong;
#else
typedef unsigned long uLong;
typedef long sLong;
#endif
union AllTypes
{
double f8;
float f4;
uLong u8;
sLong i8;
unsigned int u4;
int i4;
unsigned short u2;
short i2;
unsigned char b[8];
unsigned char u1;
signed char i1;
char c;
bool b1;
};
union AllTypes16
{
double f8[2];
float f4[4];
sLong i8[2];
int i4[4];
short i2[8];
char c1[16];
signed char i1[16];
uLong u8[2];
unsigned int u4[4];
unsigned short u2[8];
unsigned char u1[16];
};
class AllTypesArray
{
public:
AllTypesArray(int size=8);
AllTypesArray(AllTypesArray &x);
int size; // in bytes
uLong *data;
double & f8(int i);
float & f4(int i);
sLong & i8(int i);
int & i4(int i);
short & i2(int i);
char & c1(int i);
signed char & i1(int i);
uLong & u8(int i);
unsigned int & u4(int i);
unsigned short & u2(int i);
unsigned char & u1(int i);
};
struct Range
{
int first;
int last;
};
QString binary(AllTypes &a, int n);
QString hexFloat(AllTypes &a);
QString hexDouble(AllTypes &a);
QString binaryFloat(AllTypes &a);
QString binaryDouble(AllTypes &a);
QString fieldsFloat(AllTypes &a);
QString fieldsDouble(AllTypes &a);
class FileLine
{
public:
QString file;
int line;
FileLine(QString f = "", int l = 0);
};
bool operator<(const FileLine &a, const FileLine &b);
bool operator==(const FileLine &a, const FileLine &b);
uint qHash(const FileLine &f);
class FileLabel
{
public:
QString file;
QString label;
FileLabel(QString f = "", QString l = 0);
};
bool operator==(const FileLabel &a, const FileLabel &b);
bool operator<(const FileLabel &a, const FileLabel &b);
uint qHash(const FileLabel &f);
#endif