-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathScanTable.h
More file actions
53 lines (36 loc) · 1.01 KB
/
ScanTable.h
File metadata and controls
53 lines (36 loc) · 1.01 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
#ifndef SCANTABLE_H
#define SCANTABLE_H
#include <cstdio>
struct DataDescription
{
char relname[30];
char fieldname[30];
char fieldtype;
int startpos;
int fieldsize;
};
class ScanTable
{
public:
FILE *fp;
int fd;
char TableName[33]; // Name of the relation
char true_Relname[33];
DataDescription DataDes[10]; /* Holds data descriptions
for upto 10 fields */
int n_fields; /* Actual # fields */
int record_size;
char buf[1000]; // Buffer to store tuples
int Open(char *relname);
int GetNext();
void Close();
int getAttrType( char *attrName ); // Get data type of attr attrName
int getAttrSize( char *attrName ); // Get size of attr attrName
void *getAttrPtr( char *attrName ); // Get pointer to attrName in buf[1000]
void PrintTuple();
void PrintRelationInfo();
//void Write(char c);
void Write(int fd, char c);
bool findAttr(char *attrName);
};
#endif