blob: 29550f649388ae0b8746f774bab712128cd9c2f5 (
plain)
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
|
#include <string>
#include <vector>
using namespace std;
struct RowItem;
struct Row;
struct ColHeader;
struct Table;
struct RowItem{
union { //watch the pointerness or not-pointerness of the attributes!
int rh_int32;
unsigned int rh_uint32;
unsigned char *rh_bytes;
} u;
};
enum ColHeaderType{
RH_INT32,
RH_UINT32,
RH_BYTES //takes length argument
};
struct ColHeader{
ColHeaderType type;
int arg;
};
struct Row{
const Table *table; //pointer to the parent table; don't delete!
RowItem *items;
Row(const int nc,const Table *const _t);
~Row(void);
Row(Row &&other);
Row(const Row &other);
};
struct Table{
const string name;
const int nc;
ColHeader *header;
vector<Row> rows;
Table(const string &_n,const int _nc,const ColHeader *const _hd);
~Table(void);
Table(Table &&other);
void insert(Row &&row);
void insert(Row &row);
};
|